Live data from Hacker News

Proposed JavaScript Standard Style

github.com

81–90 of 116 posts

Re: Proposed JavaScript Standard Style

#82
post #74

No semicolons? REALLY? We've already spoke about this, people. Let's see what Brendan Eich has to say about this: > My two cents: be careful not to use ASI as if it gave JS significant newlines. [1] and > ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble. Calling it "standard JS" struck me as pretentiou…

Totally agree. It then leads to this stupidity: "Never start a line with (, [, or `." https://github.com/feross/standard/blob/master/RULES.md#semi...

Now I have 4 extra rules to remember and destructuring, amongst other things, will look like shit. And for what gain? If there was an actual gain to leaving out the semicolons, I'd be onboard but the only gain here is someone's aesthetic pleasure and someone else's aesthetic displeasure. Last time I checked, code was there to do things, not look pretty. Making the former more difficult to achieve the latter is not only stupid, it's impossible because now you're pandering to fashion which varies from person to person. Also, it's bikeshedding. As if Javascript didn't have real problems it needs solved.

Re: Proposed JavaScript Standard Style

#84
post #74

No semicolons? REALLY? We've already spoke about this, people. Let's see what Brendan Eich has to say about this: > My two cents: be careful not to use ASI as if it gave JS significant newlines. [1] and > ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble. Calling it "standard JS" struck me as pretentiou…

Crockford on Bootstrap's semicolon omission: “insanely stupid code”

https://news.ycombinator.com/item?id=3842713

Re: Proposed JavaScript Standard Style

#85
post #36

Earlier quoted context omitted.

I am well aware that we are in the minority when it comes to preferring tabs over spaces in JS, but, as useless as this decision is, I will fight over it the street. It's misplaced passion and I don't care.

I'll join that fight, unless you want you your tabs showing up as two spaces instead of four. Then we'll have to fight after we take down the spacers. On a slightly more serious note, the benefit of tabs is so clear: everyone can have whatever spacing they want and it doesn't affect anyone else. You just configure your IDE and it looks the way you want it to look. For whatever reason, indenting two spaces makes it ha…

It's very common to find mixed tabs and spaces where people use tabs. The first sign of this is inconsistent indentation. Maybe they're just sloppy? Oh, hm, here's some more code where it's wildly inconsistent. Time to play guess-the-tab-width until it settles down. Now should I add a comment at the top to tell Emacs about this setting next time I open the file? Probably not, sigh.

Semantic tabs would be good with consistent culture and tooling behind them.

Re: Proposed JavaScript Standard Style

#86
post #74

No semicolons? REALLY? We've already spoke about this, people. Let's see what Brendan Eich has to say about this: > My two cents: be careful not to use ASI as if it gave JS significant newlines. [1] and > ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble. Calling it "standard JS" struck me as pretentiou…

Crockford on Bootstrap's semicolon omission: “insanely stupid code” https://news.ycombinator.com/item?id=3842713

The answer from @fat is face-palm worthy:

> i have learned to use them, that's why there isn't one present.

Did you, really? Because that's how that bug came to be. Because of you stubbornly omitting them.

Why do these people want to avoid semicolons at all costs? Even inconsistencies? Even potential bugs? Why?? I just don't get it.

I need to leave this discussion, I'm getting nerd-rage.

Re: Proposed JavaScript Standard Style

#87
post #51

Earlier quoted context omitted.

I used to like tabs. Then you have a person or two with different tab widths, and some spaces get mixed in, and the beauty of the idea flies out of the window. I've been all spaces for a long time now.

Different tab widths are a non-issue. Sure, the maximum character per line only works for a set tab width, but I take that “problem” over the rigidity (and unsuitability) of spaces as indentation.

It becomes issue when mixed with spaces. Say, aligning function parameters on multiple rows. If the indentation of the second row of parameters is mainly with tabs, and then adjusted to place with spaces, it's suddenly a huge issue. And that will happen.

So spaces only for me, thanks.

Re: Proposed JavaScript Standard Style

#89

Earlier quoted context omitted.

I'll join that fight, unless you want you your tabs showing up as two spaces instead of four. Then we'll have to fight after we take down the spacers. On a slightly more serious note, the benefit of tabs is so clear: everyone can have whatever spacing they want and it doesn't affect anyone else. You just configure your IDE and it looks the way you want it to look. For whatever reason, indenting two spaces makes it ha…

I've always found the dislike of tabs to be quite strange. Developers love being explicit and semantic about things, and here we have a character that represents a semantic indent, and there's a huge swath of developers who prefer to go with the airy-fairy presentational space character instead. It even solves the 2-vs-4 debate with allowing each user to render it how they will. Heck, you could even render it as thre…

I'm on the fence about this syntax.

    var
        foo = 1,
        foo = 2;
The reason being that things will align whether you use a tabs with a width of 2 or 4.

I also use spaces for mid-line alignment and tabs exclusively for identation. I think this is called "smart tabs"?

Re: Proposed JavaScript Standard Style

#90
post #74

No semicolons? REALLY? We've already spoke about this, people. Let's see what Brendan Eich has to say about this: > My two cents: be careful not to use ASI as if it gave JS significant newlines. [1] and > ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble. Calling it "standard JS" struck me as pretentiou…

https://github.com/Flet/semistandard
Post reply on HN