Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in...
by Oreb on Friday June 21, 2019 @12:38PM
(#20244084)
As a (mostly) outsider, I’ve never understood why JavaScript is so popular in web dev circles. There are so many awesome compile-to-JS languages these days (ClojureScript, PureScript, Elm, ReasonML, Scala.js, etc). What makes people want to use JavaScript instead?
[ Parent
| on HN ]
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in...
by RussianCow on Friday June 21, 2019 @12:46PM
(#20244161)
Any time you use anything non-native, you add layers of indirection and potentially lots of impedance mismatch between languages/runtimes. For instance, I know all of the ones you mentioned would be non-starters at my current job because it means we would have to wrap all of our JS libraries/APIs in the language of choice, which is a non-trivial amount of work. Plus, debugging becomes more challenging as you're basically having to do it at two levels simultaneously.
Even with all of JavaScript's deficiencies, it's still far easier to just deal with them than to switch languages entirely.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in...
by wutbrodo on Friday June 21, 2019 @12:46PM
(#20244163)
It's permissiveness means you can hit the ground running more easily writing shitty but functional code, and web dev has long been the gateway for new entrants to engineering. People start programming, learn shitty habits from a shitty language ,and then the religious affinity for programming languages that many have starts to kick in.
This obviously doesn't explain every Javascript fan, but the tendency is strong enough to shift the dynamics of the community.
I can't say I relate to the religious fervor with which people defend programming languages. C++ is probably my favorite language to work in, but I absolutely understand where the hatred for it comes from. I readily admit that it's grotesque in many ways and my preference is likely for lack of sustained exposure to certain other modern languages.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in...
by Splognosticus on Saturday June 22, 2019 @04:14AM
(#20248569)
Probably just because it's there--you can start writing JavaScript without installing anything, same as you used to be able to do with BASIC on 8-bit micros. Then when you consider how much Visual Basic or VBA code there must be in the world and why that is you can start to see how the JavaScript ecosystem is how it is.