|
|
|
|
|
by bitoneill
3061 days ago
|
|
I used to be a c++ dev so a 15 sec compile time doesn't seem that bad. But what if you're compiler told you what was wrong faster than your console.log() could help you find it. I think is a trade off a lot of people want to make. |
|
The case you describe very rarely happens to me with JavaScript; having fewer primitives to work with greatly reduces these kinds of issues... Sure it opens up the possibility that you'll do something stupid like trying to add an object with a string; but that's a pretty silly thing to do. If you name your variables properly then that never happens.
With C/C++, there are many primitives so you might get errors when you try to assign an int64 to an int8 (for example)... With JS, however, because there are fewer primitives so the odds of that happening are much much smaller.
Because there are so few primitives in JS, it's easy to remember how they all interact with each other. The only exception is the boolean truth table for '==' (which is a mess); that's why it's usually recommended to use '===' instead.