Write What You Mean

Lars H, 2008-08-08: In comparison to many other languages, Tcl has a tendency to require that you Write What You Mean, as opposed to just giving an indication of what operation is wanted. I like this, because it means Tcl won't suddenly decide upon doing something other than I what I intended, just because there happended to another operation which looked sensible in that particular case.

For example, the core language has append and lappend as distinct commands, because they do different things — append as substrings, or append as list elements. In other languages, especially OOed languages, there might rather be a single "append" operation, and it depends on the thing to which one is appending what operation is actually performed. In other words, I can't write what I mean, but rather have to give an indication of what I mean, which the language then has to interpret.

NEM All meaning depends on interpretation, so you always have to know the semantics of the language you are using. Your argument seems to be against polymorphism and other forms of sophisticated language semantics. Generally, such mechanisms are seen as a good thing; leading to better modularity and programming to interfaces rather than specific implementations (e.g., I don't care what container I get passed, so long as it supports insert and remove operations, and behaves like a set). Of course, such mechanisms are not always well designed or well applied, but your argument seems to be stronger: that they are never a good idea? Are you also against abstract data types?