6 ms·
Am I the only one that dislikes linting? Btw, you don't have to respond with the talking points I've heard all my life on why it's supposedly great, I've obvio
by kristopolous 6y ago
Am I the only one that dislikes linting?
Btw, you don't have to respond with the talking points I've heard all my life on why it's supposedly great, I've obviously heard them and think they're bogus.
I just find it strange that I'm the only one.
- Vinnl 6y agoWhat do you dislike about bugs being highlighted as you type, rather than first having to run your code?
- kristopolous 6y agoThis is just me btw, don't take offense: Because some things are better expressed in different rules. That's why some syntax is optional in the first place, that's the reason it was made that way. The flexibility is a very intentional feature. It wasn't an accident. Maybe you want multiple spaces to vertically align code in a complex set of logic. Maybe you want to express things on multiple lines to break them up. Maybe you have deep nesting so you want to go from 4 spaces to 2. Maybe you want no braces in a single line if statement except in certain cases. This could go for pages. Poof! All gone. You can't do any of it anymore. Not following optional syntax like having a space after a comma or a space before a parenthesis is not a software bug. It's a waste of time. The compiler doesn't care and I don't either. Instead it becomes a literal Blocking Issue most of the time. So instead of working on the actual blocking issues of the code base, you spend time doing "you did this here because of some context I don't understand and I'm not allowing it" You can't commit your code without conforming to it. Also because linters are dumb. They "spot" things that are perfectly fine as supposed bugs (because they don't actually know types or logic, they're just dumb syntax checkers) and you have to work around them to satiate them with the possibility of introducing new bugs to prevent some tripwire system from false positives. Compiler writers and language designers are the only people I've found who agree with me. It's fine for protecting against profound levels of incompetence but I don't do that and you probably don't either.
- Vinnl 6y agoSo are you saying sometimes you want to initialise a variable without ever doing anything with it afterwards? That that's not the result of a typo down in your code in the vast majority of cases? I mean, I'll be the first to agree that blocking your development in the heat of it over some stylistic issue like quote styles is counter-productive, but if those rules are turned off and the rest help you catch actual bugs (and it's hard to argue that it does not), then that's surely a plus? (Also, why wouldn't linters know types?)
- kristopolous 6y agoIt hasn't been my experience. I have had to deal with linters probably about 15,000 or so hours of my work life (luckily that's only about a third). It's been probably between 99.4% and 99.8% just acrobatic dog tricks to satisfy the linter. It's not like I'm some grumpy malcontent that hasn't given it a go. If you want to use it go ahead, I just thought I'd be standing in a larger crowd
- jakear 6y agoNot sure what these “dog tricks” you speak of are. Have the linters you’ve worked with had ”—fix” options such that you don’t need to do anything besides save the file? Aside, it’s funny that you dismiss linters as being for “type A folks who must have everything in its right place”, but your concerns seem to be that you want things in their right place and the linters won’t let you. The folks who use linters have decided worrying about it isn’t worth it and just let the linter do its thing, which is less “Type A” than how you describe yourself.
- kristopolous 6y agoThat wasn't me. It's a nice visual but I think it's mostly for fun. I'd say it's mostly hammers on porcelain. A coder carefully creates something (porcelain) and then the hammer comes around and insists it has to be a perfectly shaped commodity thing. Same reason and emotion I guess behind both.
- 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.
- DivisionSol 6y agoNo talking points, but since everyone finds the value in it and you don’t, maybe you’re wrong and should give it a try?
- kristopolous 6y agoI have for over a decade, dozens of times in about a dozen languages over thousands of hours. That's what formed my opinion.
- philsnow 6y ago> Am I the only one that dislikes linting? You're right, I much prefer de-linting, but to each their own. (it's probably just an artifact of ancient unix history that these tools are called "linters" instead of "delinters", because they preferred vry shrt nms bck thn)
- strbean 6y agoIF you're the only one, maybe the talking points are correct... Care to explain why you dislike it?
- kristopolous 6y agoSee here https://news.ycombinator.com/item?id=23566213 https://news.ycombinator.com/item?id=23566213
- musingsole 6y agoI'll stand with you. I understand the arguments for linting, but the only positive from my perspective is that it scratches enough itches of the Type As out there that they'll climb off my back and get back to being useful...well get back to "organizing" whatever else it is they think is too unruly.
- danpalmer 6y agoI think many people install the default linter for their ecosystem, get satisfaction from a bunch of essentially busy work getting some green check marks or removing warnings, and believe their code is better. That’s not really that beneficial, and I can understand why you may dislike this sort of thing. I think the real benefits come when... - you can enforce a very consistent style, more than a typical linter - you start adding custom linters for things that matter in your codebase The second point here I’ve used to help move Python 2 to Python 3, move from one library to another by showing linter warnings for importing the old one, enforce new call patterns that might be tricky to enforce in code (like always calling function A before B). It’s less about “linting” and more about flexible static analysis and warnings, and while there will always be other ways to implement those it’s another tool that can be useful to have in your team’s toolbox.
- pensatoio 6y agoLinting is a lot more relevant and less of a time-sink when you combine it with formatting. Basically, all you’re left with is bugs that need to be fixed, and you completely axe all style arguments.
- lowercased 6y agoYou're not the only one. As a freelance/contractor, my environments change, often daily/weekly. I routinely switch between Java, PHP, Vue, React and some other tools. Doesn't matter WHAT I do, I end up having some stupid red squiggles telling me I can't use "double-quotes" or that I can't use 'single-quotes', depending on context. Multiple languages and 'community standards' conflict with each other, and I'm always constantly having to double check things and 'clean up' stuff. And... conforming to all of these various 'standards' has not increased the speed of development, nor the robustness, nor the client satisfaction. It does mean that some people who place a high value on standards and listing and visual style are placated. Increase of automated testing and documentation have more value - long term and short term. And I understand it's not an 'either/or', but visual style and 'linting' standards are low-hanging fruit that are immediately visible, so tend to get more attention (and ongoing). And then in group discussions, I end up being the person who is apparently "AGAINST CODE STANDARDS". I'm not terribly against them, but in the projects I end up being involved in, it's lower value. I've got project one which insisted - the point of blocking PRs - that "Yoda style" for null checks was mandatory. Guess what? Another project I'm on, Yoda-style is prohibited, because "it's confusing". Every keystroke I'm having to wonder/worry about what context am I in, and always battling stupid red squiggles. If you spend 40+ hrs/week using one and one one tech platform where you can have one standard to follow and adhere to - great. I switch platforms, teams and projects regularly, and it's soured me on the huge importance some people place on linting.
- musingsole 6y ago> It does mean that some people who place a high value on standards and listing and visual style are placated. This times a million. It doesn't help that the advocates of linting are so dogmatic about the whole idea (as demonstrated so colorfully in this thread and this sub-thread in particular). I mean, I understand why. Linting is an all or nothing type of thing. But I'm still going to remember the lint-advocate as a developer too concerned with the wrong things.
- lowercased 6y agoI joined a project - small startup - code in production for... 4 months at this point. 0 tests of any sort. First week, I do a small feature, add a test, and it was blocked, because I used a single letter variable name in a data setup method in a test file. "Single letter variables aren't professional". Developing and pushing code with no tests for 6+ months apparently is just fine though. I was tempted to use a four-letter variable name... They then got automated-linting fever.
- VectorLock 6y agoI'm strongly against over-bearing autoformatters. In my experience a little hand crafting tweaks to formatting go a long way to increasing understandability. It feels like a lot of people are having issues with bikeshedding and they're using enforced autoformatters to impose their will and stifle debate they may not like. Not arguing about style is nice, but having to resort to this brutalist architecture style of code formatting doesn't seem great to me. "Its just holding people, who CARES what the building looks like!" Also thing like line-length limits. I'm with Linus on this one, enforce line-length limits causes a lot of problems, like breaking context in greps. And an autoformatter that breaks at a certain number of characters is never going to be able to understand the context to break it intelligently. Are people using editors that don't display long lines wrapping properly? Do people think everybody uses the same resolution, the same window size, the same columns per terminal, etc?
- rojobuffalo 6y agoi completely agree with you. i think the people who advocate for auto-formatters must not be very skilled at using their text-editors and/or don't put enough attention on readability/understandability. i'm happy with linters and command line tools to auto-format when you explicitly call for it, like `eslint --fix`; i'm just not on board with the formatter running on git hooks or in whatever automated workflow. almost every rule has an exception where understandability could be improved by violating the rule, ex. line length. code format is huge for understandability/readability, which makes it worth paying attention to while you're writing. in my experience the loudest advocates for code formatters are the ones who write really complicated code; which makes sense that they just hammer on code until it works without being able to reduce and simplify their logic and naming.
- rojobuffalo 6y ago*idk about that last part; it's a dumb anecdote. the auto-formatting i'm salty about is prettier. ones that are manually invoked and either 0 config or highly configurable (like eslint) seem sensible. use an auto-formatting hook in your text-editor if you want; i just don't like the absolutism of it being hard-baked into everyone's workflow and a tool with limited non-zero config.
- reledi 6y agoI used to be bullish on linting around 2014-2017. Now I avoid them as much as possible. Bad linters are expensive. They add complexity to workflows and pipelines, slow down iteration speed, and create a nitpicky culture where most discussions miss the point. Multiply this by a whole engineering team, yikes. Yet there are some good (parts of) linters, such as catching actual issues rather than preferences. If we bet on linters, they should increase our value multifold to be worth it.
- throwaway1209 6y agoYou're not the only one. It's just that people who like to impose their will (or style) on others are a lot louder about it, unsurprisingly. They use the excuse of the linter sometimes highlighting potential bugs to impose their preferred formatting style wholesale over everyone. And it's purely an exercise of power of one person over others -- the computer doesn't care about your style. And it's not enough, some people will ask you to move sections of code around and start arguing about naming once they have no inconsistent white spaces to complain about -- that's how you know it's not the linter or formatter that they want, they want to control people.
- gregors 6y agoRight there with you. Overrated.