bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.78k stars 1.32k forks source link

Your thoughts about semicolons? #137

Closed species7213uv closed 5 years ago

species7213uv commented 5 years ago

I am just wondering how you personally feel about leaving semicolons. Obviously you do omit them in your project. I am just curious if you thought about it and actually question it, or just following along the "trend".

I personally don't think leaving them is a good idea. Arguments can be found in articles like these: https://hackernoon.com/an-open-letter-to-javascript-leaders-regarding-no-semicolons-82cec422d67d

But since you are one of the vue core team members, and have a lot of influence (especially by providing this vue-enterprise-boilerplate template as a clear recommendation) I am simply wondering if you have a good point for leaving them out - or eventually change your mind when thinking more throughly about it?

chrisvfritz commented 5 years ago

I have indeed thought about it. 🙂 To be specific, this project doesn't enforce no semicolons, but rather semicolons when and only when they do something. Since all the cases that make them necessary are warned about by the linter, I don't find it useful to add them in cases where they just add syntactic noise.

Does that make sense?

species7213uv commented 5 years ago

First of all thank you for your answer. I really appreciate that you take time to answer even those questions! :) I am pleased to be confirmed that you have thought about it and to hear your reasons.

I am personally still not convinced to leave them out (mainly because I do a lot of java and it is just easier to read the code with semicolons in javascript as well).

It is good that the linting rules will help preventing the potentional risks - I wasn't aware they would catch all of them.

To me it feels a little bit like .. buying coke without sugar and then put sugar manually to make it taste better. Why not stick to the original and try to solve a problem the other way around which wouldn't really exist. But I agree this is also very opinionated. As long as the real danger of this is covered (unless they unknowingly disable lint or use an editor which doesn't support those features) it's all good I think. Closing. And again, my applause for the great work and support! 👍