News for hackers. Stuff that matters.
Re:Javascript Constructors and Prototypes by mradmin on Thursday August 01, 2013 @04:32AM (#6139228)
It's hipster because it goes against the accepted standard way of writing Javascript. See https://news.ycombinator.com/item?id=1547647&utm_source=twit...
Re:Javascript Constructors and Prototypes by marrs on Thursday August 01, 2013 @06:18AM (#6139418)
My interpretation of "hipster" is being different because you think it's cool to be different. Being different because you think it's a better approach is called "making progress", either because you'll be proven right or proven wrong.

I've thought about the de-facto standard way a lot and I think that it does nothing to avoid bugs while potentially misleading a coder about the language. Therefore I think it's worse.

The only reason I follow the de-facto standard is because the time spent arguing about it with my peers is better spent getting work done.

Re:Javascript Constructors and Prototypes by andypants on Thursday August 01, 2013 @08:13AM (#6139697)
Nobody has any good reasons that apply to most people, both for and against semicolons. There really isn't a huge difference in either style except in rare cases.

> The only reason I follow the de-facto standard is because the time spent arguing about it with my peers is better spent getting work done.

Which is why that is an excellent reason. Standards are useful, so if there is one, stick to it. If there is no reason to go against the standard, then don't.

> I think that it does nothing to avoid bugs while potentially misleading a coder about the language. Therefore I think it's worse.

Not seeing any semicolons can also potentially mislead about the language. It is not worse, they are both misleading until you realise ASI exists.

Omitting semicolons also does nothing to avoid bugs, and introduces a different (additional?) set of edge cases where bugs may appear.

Re:Javascript Constructors and Prototypes by webXL on Thursday August 01, 2013 @09:47AM (#6140245)
Please let us know of one equivalent using semicolons for this semicolon-less bug:

  a = b + c
  (d + e).print()
Which is evaluated as

  a = b + c(d + e).print();
Taken straight out of http://mislav.uniqpath.com/2010/05/semicolons/

> Standards are useful, so if there is one, stick to it. If there is no reason to go against the standard, then don't.

Bingo. I think this is another reason to stick with the standard.