3 ms·
> I'm sure they love being told they're wrong because they're young and vain. I wouldn't say that, but it is a decision based on vanity and it does tend to com
by wayneftw 8y ago
> I'm sure they love being told they're wrong because they're young and vain.
I wouldn't say that, but it is a decision based on vanity and it does tend to come from younger/junior coders in my experience. Making one bad decision based on vanity doesn't make you vain though IMO. It's not personal vanity either, it's "code vanity" so maybe a better word would be: hasty or risky...
Anyway, the effort that it takes to setup and use Prettier (which we use) or before that, "eslint --fix", is the least amount of effort of all the options.
You're expending more effort to memorize edge-case rules than my teams are if you're not using Prettier and if you are using Prettier but without semis, then you risk running into a bug like the one that broke Twitter Bootstrap due to lack of semis.
It's just a bad decision.
> I think people who really care about semicolons in JS are people who just don't write a lot of JS...
> I'm aware styleguides recommend semis but I'm more referring to people who have strong opinions about what is a minor semantic.
It's not just some guides, it's the majority of the most popular style guides and the biggest JS-using companies that write and use those guides, which recommend semis.
It's also not a minor semantic. The language requires them and if you make the error of omitting them, the runtime will try and correct your error. Depending on this runtime behavior is the kind of hasty and shallow decision that costs real money. That's why the most popular style guides recommend them and that's why the de fact standard is to use them. Googles style guide requires them company wide. The people who wrote these guides really cared about semicolons, that's why they put it in the rules.
- ng12 8y ago> I wouldn't say that, but it is a decision based on vanity and it does tend to come from younger/junior coders in my experience You're not wrong, but using it as an argument has a counter: people like semis because they're the old-guard curmudgeons afraid of change :) > then you risk running into a bug like the one that broke Twitter Bootstrap due to lack of semis. The bug was due to a JS minifier removing a needed semi, which they did to save space. I still don't know of an example of somebody actually shipping code that broke due to a missing semi in source. > It's also not a minor semantic. The language requires them and if you make the error of omitting them That's not true at all. ASI is intentionally a part of the language spec, hence why there's not a single runtime that allows you to turn it off. > The people who wrote these guides really cared about semicolons, that's why they put it in the rules. The people who wrote those guides were writing them for hundreds of developers with varying levels of experience and a wide variance in tech stacks. I probably would have put it in the spec too, but that doesn't mean I don't set `semi: false` in every React project I start.
- wayneftw 8y ago> You're not wrong, but using it as an argument has a counter... I'm not using it as an argument. I'm using it as a descriptor for people who make arguments against semis. > ASI is intentionally a part of the language spec... Yes, but it's clearly there as a corrective measure for people who mistakenly omit them. So, the spirit of the language spec and all signs point to: use them. > I probably would have put it in the spec too, but that doesn't mean I don't set `semi: false` in every React project I start. To write a spec rule and then immediately ignore it makes no sense to me. But anyway...why do you not want semis? If you have a tool that automatically inserts them, like prettier or eslint, then the only reason you're making that decision is because you don't like the way they look. That's pretty shallow reasoning IMO.
- deleted 8y ago[deleted]
- ng12 8y ago> I'm using it as a descriptor for people who make arguments against semis. Doesn't change the point: "back in my day, we used semicolons everywhere..." > Yes, but it's clearly there as a corrective measure for people who mistakenly omit them. So, the spirit of the language spec and all signs point to: use them. I think you're projecting quite a bit here. If you're interested, here's a ticket from TC39 proposing directly discussing possible issues with ASI: https://github.com/tc39/ecma262/pull/1062/files https://github.com/tc39/ecma262/pull/1062/files Point being they're not advocating for using semicolons, but making it clear what the possible edge cases are. > But anyway...why do you not want semis? Because I don't want the noise. Yeah, theoretically they might save you some time debugging once in a few million LoC but including them everywhere adds a whole lot of pointless characters.