3 ms·
What's right with it? It's an awful language: Not being able to import/include library code is bat-shit insane. You can't reliably check the type of things l
by peterashford 13y ago
What's right with it? It's an awful language:
Not being able to import/include library code is bat-shit insane. You can't reliably check the type of things like arrays.
The 'this' value is 'wrong' in callbacks (by wrong, I mean, not what programmers actually need in that instance).
Javascript dates values are 1-based except for months which are zero based - be consistent!
Math.parseInt will produce correct results for 05, 06, 07, wrong results for 08, 09 - don't ASSUME a radix! (unless that radix is base 10).
It goes on regardless in the face of a large number of errors meaning that the location of an error can be much harder to find than is necessary - I believe that fail fast is infinitely superior to 'just muddle through and do something random with that invalid state'
You can't rely on getting decent stack traces out of it on error which makes debugging harder than it should be.
It's easy to accidently add globals.
I'd add lack of types: obviously that's a preference but when 30% of your tests just end up checking what a compiler could have done for you for free, then I say that;s a fault with the language.
That said, I really like array and object literals. It's not all bad. Just... about 86%