3 ms·
> What do you dislike about bugs being highlighted as you type many things "highlighted as you type" aren't "bugs". let greeting = "Hello " + user.name;
by lowercased 6y ago
> What do you dislike about bugs being highlighted as you type
many things "highlighted as you type" aren't "bugs".
let greeting = "Hello " + user.name;
Auto-fixing immediately flags this with "DAMN YOU USE A CONST!!!!" (multiple red squiggles that I have to hover and review).
but... I might be making a change to it a few minutes later... but I've got some damn visual shit flashing in my eyes that "USE A CONST"
concat strings? PREFER TEMPLATE!!!
OK, ESlint, have it your way, please auto-correct that...
`Hello ${ user.name}`;
WTF?
And... this is just one set of 'best practices' to learn - change per language/framework/team multiple times (sometimes in the same week) and it's... difficult.
Yes, I'm an old-fogey. I have close to 30 years of muscle memory of using string concat and double quotes. "auto-fixing as I type" brings a huge interruption of flow, and THESE ARE NOT BUGS. They are style choices someone else is imposing on me. It doesn't make the code less buggy. It doesn't make the client any happier. If someone else coming in to the code is genuinely confused, confounded or severely impeded by
let greeting = "Hello " + user.name;
to the point where they have trouble deciphering the work, perhaps they're not terribly good at their job?
Goodness help folks when new management comes in and demands a new 'better' style.
- anon_1_1_1 6y agolol r u anti spellcheck 2? bcuz idk why old fogeys thnk thtz so imprtant, is juts stylistic choice, u know xactly what i'm typng rite now, if u r genuinely CONFUZED, CONFOUNDED, OR SEVERELY IMPEDED by this, prhaps ur not terribly good at reading. i cant believe thoz guyz want to interrupt my flow by mking me fix my spleling whn thz ar not even bugs, i hv close to 30 yrz of muscl memory. I'm being facetious of course, but seriously, you are being very arrogant and rude with your suggesting that people who think stylistic standards are beneficial are bad at their jobs. Maybe they are also good at their jobs and genuinely have come to different conclusions than you and maybe despite your presumably high level of skill and experience, you're not great at developing a large team's productivity with your habits...
- Izkata 6y agoThe funniest part about that particular example is that it's highly likely you're using babel to support old browsers, and the compiled version just switches it back to string concatenation.
- lowercased 6y agoIn the example above, I believe that's the case. Again, an issue with switching between projects/styles, for me - one client/project insists on "const" in JS. Another client/project is supporting a product on IE9 for a client of theirs, but doesn't use any build tool for some of that JS, so we're not even supposed to use "let" or anything else "new" for some of that project. Mentally switching between those two worlds is like jumping between 2019 and 2009 every few days. Realistically, could we introduce a transpiler? Technically yes, but operationally? It's a Frankenstein project that has so many larger issues that's low on the list for people (sections of the functionality are being migrated over to react altogether, and throwing 'more tools' in to the mix on legacy stuff is not desired).
- Vinnl 6y agoSo the problem is having rules enabled that do not help prevent bugs. Actually running ESLint for the first time will ask you if you just want to check for bugs or also enforce some code style. The former is preselected, and would not shout at you for not using `const` or template strings. I'd always argue for using it that way, which is very reasonable to me. (A bit weird to have 30 years of muscle memory writing `let`, btw :) )