Room 208

Elaborate Burn

@spinor, on type behavior in JavaScript:

Prototype-based OO is pretty interesting. That said, orthogonally, type coercion is still a bad idea.

Type coercion is okay in some limited cases. Being able to write "You have " + n + " cows" for an integer n without having to explicitly convert it to a string first saves on obvious boilerplate. My primary issue with JavaScript’s coercion behavior is that it violates the principle of least surprise from here to next Sunday. (See my earlier post on “Wat”.)