3 ms·
A large number of configs are created/used by people that don't know any programming languages, it seems rough to exclude all those people.
by SanchoPanda 7y ago
A large number of configs are created/used by people that don't know any programming languages, it seems rough to exclude all those people.
- q3k 7y agoIt seems worse to me to treat them like they can't learn a programming language.
- SanchoPanda 7y agoNot forcing them to is different from assuming they can't.
- DonHopkins 7y agoNot forcing them to learn a programming language, but instead forcing them to learn a half-assed quirky ham-strung config language that's just as complex as a programming language's syntax, and as hard to learn as a programming language, but isn't useful for anything else, or widely supported by any other tools, or well documented, or well designed, certainly isn't doing them any favors, or respecting their time and effort. Case in point, PHP's "Smarty" templating engine. Because lord forbid people learn to use PHP as a templating language (which is ALREADY IS), when instead they can learn to use an ad hoc, informally-specified, bug-ridden, slow implementation of half of PHP, which is implemented in PHP, and dynamically generates PHP code. https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule >Greenspun's tenth rule of programming is an aphorism in computer programming and especially programming language circles that states: >Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp. Your templating engine sucks and everything you have ever written is spaghetti code (yes, you) http://www.workingsoftware.com.au/page/Your_templating_engine_sucks_and_everything_you_have_ever_written_is_spaghetti_code_yes_you http://www.workingsoftware.com.au/page/Your_templating_engin... >This is where folks will start to get technical about why their code isn't spaghetti code. >Oh no! Not me because I use (Django|Rails|Haskell|Node.js|Symfony|CakePHP|Tornado|Plone) and the superior templating language (Django Template|ERB|Mustache|PHP|TAL|Smarty) doesn't allow business logic in templates and enforces a separation of concerns >-You, the reader, December 2011 >The problem is that in every single one of these circumstances, the templating engine has 2 primary responsibilities: >The fragmentification and inclusion of common interface assets (to avoid duplication and maintaining the same code in multiple files) - eg. headers, footers, sidebars and the like >The output of dynamic content >The output of dynamic content requires logic (if/else, loops being about the bare minimum). >The creators of templating languages have, to varying degress, availed themselves of a false dichotomy, namely that there exists "presentation" logic and "business" logic, the former of which belongs in templates and the latter of which has absolutely no place in templates and must be banished immediately. >I say false dichotomy because this is an arbitrary separation - a choice made by the person who created the templating engine and is completely subjective. Yet another reason smarty sucks https://www.sitepoint.com/community/t/yet-another-reason-smarty-sucks/6982 https://www.sitepoint.com/community/t/yet-another-reason-sma... >Which brings me right back to my chief criticism of smarty which to this day it’s adherents can’t answer – what the Hell is the point? [...] >I hated smarty from the day I tried it and I was always wondering why would anyone use it since you’re forced to learn some weird syntax that’s so similar to php - so why not use php from the start? https://news.ycombinator.com/item?id=4605887 https://news.ycombinator.com/item?id=4605887 >PHP is itself a template engine. Bolting a template engine on top of that makes no sense whatsoever. https://news.ycombinator.com/item?id=20736493 https://news.ycombinator.com/item?id=20736493 >+1 for Turing complete programming languages instead of half-assed config languages. https://news.ycombinator.com/item?id=20735231 https://news.ycombinator.com/item?id=20735231 >I was suspicious of YAML from day one, when they announced "Yet Another Markup Language (YAML) 1.0", because it obviously WASN'T a markup language. Who did they think they were fooling?
- sparkie 7y agoThe trick is to get them programming without them even realizing they're doing it. There's examples of this working effectively: millions of people can use excel to perform computations on groups of cells - the formulae they're entering include basic programming constructs like assignment, selection, loops, etc - yet it's not presented as a "programming system", which otherwise seems to put people off. I recall reading an anecdote about the TECO editor (or some other emacs predecessor). Where the editor was being used by secretaries and other non-programmers, but they'd have no problems configuring it with the documentation they had available - they were never told that they were actually programming when they were doing so. Perhaps it's a bit much to give the user a full-blown programming language for their configuration and expect them to have no problems, but it seems like limited programming concepts can be learned by just about anyone if presented in the right way.
- SanchoPanda 7y agoI agree. I have seen incredible things done in Excel in the most elegant ways, by people with zero programming, math or computer backgrounds. And as you said, presentation is key. Presented as "use these tools to set this up" things could go well. Presented as "write this in python" it may not go at all.