131 points · by newgame · 12y ago · 100 comments
It is also what it comes down to w.r.t. code-over-config.
To make a system sufficiently configurable, you end up having to re-invent a turing complete language inside it's configuration files, so it starts looking more like lisp.
This is due to the [1] Inner Platform effect.
The only interfaces I know of that's expressive enough to drive a turing complete language is either flowcharts, or actual code.
This is kind of why I feel that systems like gulp are just superior to grunt, because ultimately the config format can never be expressive enough to solve all the problems, and there's just so much less work to write-what-you-mean, the first time. properly.
This also relates my newly adopted philosophy w.r.t. software complexity. [2] Simple vs Easy.
[1] - http://en.wikipedia.org/wiki/Inner-platform_effect
[2] - http://daemon.co.za/2014/03/simple-and-easy-vocabulary-to-de...
You need dependency injection too, unless you're going to let people just smash the definitions of existing code.
A good demonstration of safe, powerful, and type-checked configurability is Xmonad.
Isn't source code basically a configuration file for the compiler/interpreter?
> because ultimately the config format can never be expressive enough to solve all the problems
And if so, I don't think this statement is quite true. Source code is expressive enough.
Configuration files give us flexibility but not expressiveness. Source code, as it exists today, gives us expressiveness but not flexibility[1].
This disparity should be a big red flag that we are doing something really wrong.
This disparity, in my opinion, is caused by the abstraction we use to communicate information between systems within source code: parameterized sub-routines.
A programming language that doesn't use parameterized sub-routines is basically a configuration file. This gives us both expressiveness and flexibility.
[1] Flexibility is within the context of config-vs-source code and ops post. Programming languages are very flexible when you know them.
Source code is input, not configuration. Every time you run the compiler, you give it different source code. The whole point of the compiler is to transform source code.
Configuration is "input" that is not expected to change very often, but that the application developer can not guarantee will never change. Configuration falls into a few categories:
1. Context-specific inputs that can not be predicted or discovered automatically by the application. (For example, the DNS zones the process is expected to host - named.conf)
2. Inputs that are not expected to change very often, but should be easy to change if necessary. (ssh client or server settings)
3. For applications with interactive user interfaces, customization and changes to the default interface.
For the vast majority of applications, a text file capable of expressing simple data structures is more than sufficient. Others advocate using only a database, but only to make configuration dynamic so explicit reloads aren't necessary, not to make it more like a programming language.
The source-vs-configuration question is usually only be an issue when dealing with large, complex applications with very general specifications.
Interpreted languages (JIT) re-interpret the same source code every time they are run (though they don't have to).
What about monkey patching (http://en.wikipedia.org/wiki/Monkey_patch)? An example usage is altering behavior (the source code) based on running the code in a testing environment -vs- production (as one example).
How about dependency injection? How about lambda expressions?
What about best known practices like favor composition over inheritance? If we hard code a solution using inheritance that is input but if we build out a solution using composition that is a configuration?
These are all tools available to programmers that provide ways of changing behavior at the source code level even though that behavior may not change very often.
This is starting to look like a real gray area to me: input -vs- configuration.
I guess we can try and distinguish between the types of input a system consumes (based on the static nature of the input) but I don't know how useful that is as an abstraction.
Every object has the exact same behavioral interface. The exact same behavioral interface means there is no specialization: every message looks the same. We can compose programs (behavior) by hooking up objects/messages as opposed to coding them. This is because we have 100% encapsulation[2]. We need to know nothing about the internal working of an object since it has no parameterized subroutines.
The abstraction for passing information between sub-systems are these messages (every object is a message) as opposed to parameterized subroutines.
[1] We could call it message-oriented programming (not to be confused with message-oriented software/frameworks).
[2] Even a single parameterized method leaks some of the internal workings of an object and leads to specialization of the objects interface. This also leads to tightly coupled software systems.
This sums it up perfectly, I've had clients say 'oh and it has to be 100% customisable' and I've been like 'it is, it's called HTML, CSS and js'
And please don't knee jerk some story about some Apple decision making. That doesn't matter. If the hypercard model had the value I think it does, someone else should have surfaced and gained momentum.
That didn't happen, and while I don't have the answer for why, I think it would shed some light on why "code as a user interface" for non coders has had only limited successes (Spreadsheets, SQL).
I've actually wondered why there hasn't been more exploration into visual / declarative programming since it has the appeal of being very easy to get started.
It's commercial and proprietary software but it has an open-source "cousin" called Pure Data.
Both applications were created by Miller Puckette and his creations inspired a lot of more or less similar systems.
One worth noting is vvvv. It doesn't have musical programming roots and uses some unique and really powerful concepts to make graphics programming easier. http://vvvv.org/documentation/of-spreads-and-slices
Also it's a very pragmatic system which is built and maintained by people who do really cool and sometimes complex projects. http://www.meso.net/vvvv
Subtext (http://subtext-lang.org/) - in particular check out the video on "schematic tables," which is very immediate and direct like Excel but better for general purpose.
Some of Bret Victor's work: Inventing on principle (http://vimeo.com/36579366) Media for the Unthinkable (http://worrydream.com/MediaForThinkingTheUnthinkable/) He has a lot of examples of similar interfaces for more domains than just what Excel is good at.
Another example, although much less so, is Unity's editor- property editing and level editing are very immediate and visual even for things like behavior.
Hundreds of thousands developers are still pissed at Microsoft in 2014 (according to Wikipedia): http://en.wikipedia.org/wiki/Visual_Basic
(I moved on to various other languages, but I still have VB in fond memories.)
Looks like Microsoft was correct in their assessment of shooting VB6. Nobody using it was willing to pay money.
Does it, really? I spent the last 2 years building systems that ran off of workflows (as in flowcharts), and I think now that they don't make the big hurdle (capability for abstract reasoning) any easier at all.
They are fine to document and communicate things, but as input they are just flawed (except for some very very specific niches).
The flaw is to assume there is only one mental model that Visual Programming Languages should operate under: say only workflows for example (a mistake all VPLs I've seen have done). This is like assuming that there should only be object-oriented programming when there are other methodologies we use as programmers to form mental models such as declarative programming, functional programming, structured programming, etc.
It doesn't make much sense to code out mathematical equations using flow charts.
A VPL which supports multiple mental models is able to best represent behavior based on specific business domains. The right tool for the right job.
[1] http://www.forbes.com/sites/timworstall/2013/02/13/microsoft...
Massive files especially is something Excel "should not be doing" for superficial technical reasons that are mostly unrelated to whether the UI is a good fit. "Enormously complex formulas" do call for better editors, but again don't damn the model.
[Disclaimer: I work on a hypercard-like declarative language.]
Even the JavaScript system we have now seems highly inspired by it.
It's the same discussion you see around why 3D interfaces aren't more popular.
The second we need to manipulate more real world objects (like in robotics for instance) in real time, the more visual kind of programming languages will gain more popularity as they will provide faster access to controlling the already optimized algorithms.
There are some references in this thread if you want to go deeper: http://www.ign.com/boards/threads/was-anybody-else-part-of-t...
This was one of the more popular programmers: http://patorjk.com/blog/programming/
However, the headline presumes there can be some universal standard of measuring what we can "usability" that's somehow separate from the practical "usefulness" of the tool itself. Tools that do fewer things can be made easier to use that tools that do many things. Turing-complete programming languages can be made to do anything the computer can do, which is a lot. And so there's going to be a hard limit on how "usable" they can be. Not to say we're even close to reaching that limit, but you'll never make a programming language that's as "usable" as a screwdriver, and that's okay.
http://www.yosefk.com/blog/i-cant-believe-im-praising-tcl.ht...
Shells partition away sophistication.
Everything is a string is a bit quirky, but it's just lisp-like enough to allow you to do some really nifty things.
I don't ever want to write anything seriously in it again though, and I can't see myself starting a new project with it.
Only used a few times later to script Websphere via Jacl.
However, nowadays I don't have any reason to touch it as well.
Could you elaborate on this? It sounds interesting, but I'm not quite grokking.
Programming doesn't have to be hard. As in speech, the more one says, the less one means.
I know shell isn't going to with this popularity contest, but a return to it is what's badly needed in CS today. Instead of attempting to recreate the shell in C# or Java's supplied libraries and subsequently becoming frustrated when interaction with the "outside world" is clumsily accomplished through a FFI pinhole, just use the shell as it was intended: as a lingua franca between utilities. Write what requires prolog in prolog, what requires c in c, what requires awk in awk, etc. Use flat file databases such as starbase or /rdb and avoid data prisons such as MSSQL, Oracle, MySQL, etc. Make all of these utilities return sane return values and spit out JSON formatted output. Finally, tie it all together with shell. If you need a UI, code it as a thin layer in Tk, python/pytk, ansi c/gtk, or, consider pdcurses, etc. Profile your program and find any weak links in the chain. Recode in a lower level language only when needed.
Weighing the tradeoffs of adding language features is a sign of a false dilemma; rather than a single bigger or smaller language, what is actually needed are more specific languages which speak to each other through a lingua-franca. Tcl accomplishes this communication through a string representation, Powershell through an object representation, etc. Again, rather than choosing one solution over another, use them all where they work best. This is where Unix got it right all those years ago; Unix isn't just a slightly more stable platform for running today's bloated and monolithic software, rather, it's an elegant system for connecting maintainably-small utilities. The shell glues said utilities together into programs. Such an approach combines the best of high and low level programming, reuse and specificity, tradition and novelty, etc.
But shh, don't tell anyone how easy it is, if everyone figures out just how easy and scalable shell scripts are it will ruin the magic we bring to over-engineered enterprise projects.
I would claim that natural language is the most usable and the most powerful user interface. We humans have been relating with it for quite a while and there's no sign of a let-up.
And most programming language either contain fragments of natural natural language or can be translated into such fragments. Yet, the author is right, programming languages are "least usable". Indeed, consider SQL was created specifically to be usable like a natural language but it now considered more unusable than even an average programming language. What gives? (I have my suspicions but I wonder what people think).
The computer isn't like another person, and we'd really prefer to have it do what we say rather than guess what we want and act accordingly. Indeed, we are not yet able to have a computer guess what we want to any respectable accuracy.
(Think of it this way. In some languages you can provide compiler hints that say, for example, "this variable will usually be an integer, so please optimize for that". A natural language consists basically 100% of compiler hints and 0% of instructions.)
From the point of a view of a programmer, yes.
But isn't this kind of the division point between a "good user interface" and a programming language.
Lots of user level system are intended so the computer guesses what you want and does that.
This is the sign of a flaw - we've stumbled upon the limit in many distinct areas, and ceased to use natural language in them.
If you want an architect to describe the builder how large a construction pit should be - you don't want a long description in natural language, you want a very specific diagram; i.e., natural language is not the most usable thing for this scenario. If you want to 'discuss' your computer which file to open, then clicking in a GUI is much more efficient than having the folder contents read to you and speaking the file name - since such technology exists, but only people with severe vision problems choose to use it. In niches where accuracy is important - say, "chat" between pilots and air traffic controllers - you migrate away from natural language by discouraging most phrases (e.g., words "to" and "for") and trying to replace them with domain-specific codenames and "formulas" for saying phrases with very exact meaning.
Natural language is a useful general-purpose UI; but for any specific niche we can have a better specialized UI than that - wether it's a controlled almost-natural language, a visual UI, or some specific notation like music scores.
The file system example:
"Computer, show me the document jake sent me the other day."
"Computer, I want to continue writing my thesis."
"Play the cute cat video again!!!"
Of course, it'll need agents with more deeper semantic understanding, advanced AI, NLP, computer vision, etc that is on the market today, but this is not a problem of natural language. See the work wit.ai is doing, we're pretty much there.
But that's a different argument - the original discussion was about natural language replacing the current specialized systems (such as programming languages), and my point is that it's no more likely than natural language replacing musical notation or Photoshop interface.
You could have an interface where you say "computer, draw a funny moustache on that cat" in the same way that you can tell that to an artist; but if you want to define exactly what kind of funny moustache you have in mind, then both Photoshop and paper&pencil would be far superior interfaces than natural language.
Same applies to markup languages. TimBL held HTML back from Turing-completeness for ages, then JavaScript came along.
That's an argument for programming languages in configuration, not against. It's just that we need good languages there, so that if you "have to program there" it's not a painstaking experience.
Designing a programming language is hard. Really, really hard. Or rather it's extremely easy to make completely unusable language, especially if it wasn't designed as a language from the start. You don't want to do this to your users and to yourself.
You either just don't include a programmable configuration, which is a fine tradeoff, or you include a "real" language from the start. For scripting languages it's easy, just use themselves. For compiled languages it's even easier: just use Lua or Scheme and be done with it.
But please, whatever you do, don't invent your own configuration (what's wrong with standard "key = value" format anyway?) format and if you do DON'T try to gradually extend it into a language. It will be hideous, unusable, insecure, unreadable, impossible to debug, buggy like hell and will haunt you forever in nightmares.
That being said, don't be afraid to experiment and try to build a language if you want. Just don't force it on others in production environment until you're sure it's not as described above :)
> ... whoops! Suddenly, you can program [in the
> configuration files], so now you will have
> to program there.
What's forcing a user to configure a system if they don't need to make changes? Why is it preferable to use something functionally restricted rather than a programming language to configure a system?what software doesn't do is often as important as what it does do.
Of course at some point, you're just calling your program your config file. But don't tell Emacs users that config files can't be turing-complete.
I'll also say it's a horrible idea to make your "config" files a programming language.
Overall though its hard to argue it doesn't do the job.
there are other turing complete DSL's too though. Puppet's isn't though...
But some people are probably comforted by java ui maybe because it is so structured.
Edit: remember ant and maven.