2 ms·
even non-programmers can understand this Isn't that the Python fallacy? (Take away the curly braces, anyhow.) Programming is a lot more than syntax. How man
by chromatic 17y ago
even non-programmers can understand this
Isn't that the Python fallacy? (Take away the curly braces, anyhow.)
Programming is a lot more than syntax. How many non-programmers do you know who understand the semantics of mutable assignment without having it explained?
- jashkenas 17y agoI'm glad you brought up mutable assignment. The reason for allowing colons as an alternative to equals signs in CoffeeScript is two-fold, the lesser reason is to make regular assignment consistent with JSON assignment, eg, both of these are legal CoffeeScript: obj: {prop: val} obj.prop: val obj = {prop = val} obj.prop = val But the main reason is to avoid the equals sign as a symbol for assignment, because it has such a different meaning that you would expect in its use in math (unless immutable), where it implies the equivalence of the expressions on the left and right side for the entire duration of your proof. Using colons, like JSON does to great effect, looks more like tagging a value with a label, which is much closer to the meaning of what you're actually doing in JS.