by nwjsmith on 6/18/14, 4:55 PM with 9 comments
by phunge on 6/18/14, 7:45 PM
This is a criticism in JS, not in the article. But IMHO most modern dynamically-typed languages err way to far on the side of permitting (or ignoring) operations which should raise exceptions. "3" + 4 should be an error, not "34" (JavaScript) or 7 (Perl). ({}).foo should be an error, not undefined. etc. etc.
It has nothing to do with dynamic typing -- IMHO languages like Scheme and Python got things right in having a object & type models which have a small, well-defined set of operations with few rough edges. But somewhere along the way, "do what I mean" AKA "do the thing that I almost never need but may blow up in corner cases" became accepted as a good idea. And IMHO it's not.
EDIT: if anyone is interested in ideas around immutability, read up on functional programming -- specifically read Structure and Interpretation of Computer Programming, and play around with Scheme. It'll make you a better programmer regardless of language. Some of the basic ideas from the functional programming community definitely need to be preserved and disseminated.
by ape4 on 6/18/14, 8:51 PM
function rentAmountDollars() {
return 600;
}