4 ms·
PHP worse from what I've seen. JS I would say better. Most of what people complain about are wonky implicit conversions -- easily avoided. The retro-fitting of
by norswap 9y ago
PHP worse from what I've seen. JS I would say better. Most of what people complain about are wonky implicit conversions -- easily avoided. The retro-fitting of classes onto the prototype is not super elegant (the "Javascript: The Good Parts" approach is better), but can be readily understand with a good explanation and a schematic (1).
C++ is probably an offender but for other reasons. My experience is limited, but from I've seen it's mostly vast But when you look at each feature they're not incredibly unintuitive. A huge problem in C++ is that there many ways to do everything (the old way and the new way and the new better way, all which have slightly different semantics).
Common Lisp is also vast but seems really solid on its foundations.
Scheme, Smalltalk and Go, definitely better. Lua. Java as well excepted maybe the really fine points of generics (captures) -- but in practice understanding that is almost never needed. C, unless you count undefined behavior as against least surprise, then it fails. Python I'm really not practiced enough to tell.
All in all, we're probably not using the same criteria for least surprise. I'm not even considering libraries, just baked in language features, and being able to predict what they do. In that sense, Ruby is really much worse than Java. It's really bizarre (see my blog posts in the other comments). And the problem is made worse by the fact that all that weird behavior is not documented anywhere.
(1) e.g. https://drive.google.com/file/d/0B0O9lcl5dMLQbDFkYk1kX28xM1U/view?usp=sharing https://drive.google.com/file/d/0B0O9lcl5dMLQbDFkYk1kX28xM1U...