Live data from Hacker News

Why I sometimes hate JavaScript

geekregator.com

1–10 of 66 posts

Re: Why I sometimes hate JavaScript

#2
Sure, this is annoying, but the reality is that this type of stuff is very easily avoided through the use of linters. IMO, you should never work on a dynamic scripted language like JavaScript without constantly running a linter in the background to pick up stuff like this.

Re: Why I sometimes hate JavaScript

#3
post #2

Sure, this is annoying, but the reality is that this type of stuff is very easily avoided through the use of linters. IMO, you should never work on a dynamic scripted language like JavaScript without constantly running a linter in the background to pick up stuff like this.

[deleted]

Re: Why I sometimes hate JavaScript

#4
post #2

Sure, this is annoying, but the reality is that this type of stuff is very easily avoided through the use of linters. IMO, you should never work on a dynamic scripted language like JavaScript without constantly running a linter in the background to pick up stuff like this.

Exactly my thoughts. Just ran the snippet through JSHINT and while it doesn't recognize the exact error it shows you the location where it happens.

http://jsfiddle.net/hnxjxyte/

Re: Why I sometimes hate JavaScript

#5
post #4
post #2

Sure, this is annoying, but the reality is that this type of stuff is very easily avoided through the use of linters. IMO, you should never work on a dynamic scripted language like JavaScript without constantly running a linter in the background to pick up stuff like this.

Exactly my thoughts. Just ran the snippet through JSHINT and while it doesn't recognize the exact error it shows you the location where it happens. http://jsfiddle.net/hnxjxyte/

Plus, with a text editor plugin like https://packagecontrol.io/packages/SublimeLinter-jshint it becomes a no-brainer.

Re: Why I sometimes hate JavaScript

#7
If you only hate Javascript sometimes, you are definitely new to the language. That said even in a proper language like Ruby this particular bug can happen, that's why communities around these languages strongly encourage proper discipline, enforced by tools.

This bug most definitely should've made your tests go red, your linter give a warning and your code metrics suite should have a thing or two to about the huge expressions and 10+ line function they are in.

Re: Why I sometimes hate JavaScript

#10
post #7

If you only hate Javascript sometimes, you are definitely new to the language. That said even in a proper language like Ruby this particular bug can happen, that's why communities around these languages strongly encourage proper discipline, enforced by tools. This bug most definitely should've made your tests go red, your linter give a warning and your code metrics suite should have a thing or two to about the huge e…

Thankfully the bug DID make my tests go red.
Post reply on HN