r/javascript • u/craigtaub • Jun 17 '18
My most hated JavaScript features – Craig Taub – Medium
https://medium.com/@tabu_craig/my-worst-javascript-features-465378d5ad436
u/inabahare Jun 17 '18
I didn't really read more after the section about null. It just seemed so silly to me. Like this
Default arguments treat Null as valid, i.e. pass Null into
someFunc(someParam = 'default value')andsomeParamwill be Null.
Like what is this supposed to show? If you passed 1 as a parameter then someParam would be null.
And then this
For instance say you wanted to store if a person has hayfever, how would you store it on initialisation?
Which doesn't really seem like a good example since by the sound of it you would need a bool, and in the "Hence why so many languages (C/C++ and Java included) use it [null]" list you list languages which doesn't have implicit types, and for a bool the default value would be false rather than null in those languages.
4
2
u/Georiv Jun 17 '18
I read the entire article, but I found myself shrugging with almost every point. The only one I empathized with is the numbers.
19
u/notlmn Jun 17 '18
Why do people just hate at every OO part of JS?
null- How would someone represent emptinesstypeof- Yes, there are some standard issuesASI - Semicolons should've been mandatory from the beginning
Floating point integers - What other standard would you choose, considering JS is loosely typed?
ES6 class binding - Its just one thing to remember in event based architecture (mostly backwards compat)
Pass-by-ref and Immutability - Your users memory is limited (they don't have infinite amount of RAM)