I think. Haven’t verified this, but the thought came to my head the other day.
I think. Haven’t verified this, but the thought came to my head the other day.
I would say that Javascript was not at all designed to be delivered the way that it is. The design characteristics of JS that allow minification, I think are just happy coincidence.
Consider that Javascript early on was marketed as a companion to Java (applets). Java, of course, used a bytecode representation to deliver programs on the Web from square one. If Javascript had been designed for efficient delivery of "compiled" programs, bytecode would have been the obvious choice.
I think my point is, languages are not generally designed to minify well, because minification is the technique of last resort for efficient delivery.
a-b - a - b
Even though I personally love hyphenated-identifiers in Lisp, I would not want them in any language that has infix operators, whether it cares about minification or not.I can see others (beginners) getting confused, but it’s something they will very quickly get over. For example I didn’t know JavaScript was case sensitive, but it was a very quick adjustment when I learnt this
(let ((foo-bar 29))
#i( foo\-bar - 3 * foo\-bar ))On the other hand, some advice from Chuck Moore (found in Thinking Forth) that I think about sometimes:
"There are diverging programming styles in the Forth community. One uses hyphenated words that express in English what the word is doing. You string these big long words together and you get something that is quite readable.
But I immediately suspect that the programmer didn’t think out the words carefully enough, that the hyphen should be broken and the words defined separately. That isn’t always possible, and it isn’t always advantageous. But I suspect a hyphenated word of mixing two concepts."
Example sentence:
"Examples of sado-masochism - such as Java-influenced languages - are rampant in the field of computing."
Quite readable.