5 ms·
The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it i
by Majestic121 2mo ago
The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs.
It is what it is, everyone gets the same, shut up and work on what matters.
I'm surprised you consider it a lot of energy spent, I tend not to spend any on this, it just runs automatically on my code and I drop out of pretty much every discussions about linting as it's good enough with automated tools.
I also used to work in places where there was no such tools, and there I had to actually spend time discussing and thinking about linting.
- maratc 2mo agoIn my previous place, discussions on coding style were forbidden in PRs. It worked just fine. Edit: one could also use single or double quotes in strings, and it didn't anger the grammar nazi bots as there were none.
- dewey 2mo agoWhich gets rid of the discussion, but not the problem coding style rules are supposed to fix: Code looks the same, regardless of who wrote it. That's the whole point of code style guidelines like that as there's no functional reason for them. That's why I like Go, every piece of code looks the same, there's one default enforced linter and this discussion (or discussion if discussion should be allowed or prohibited) doesn't even cross anyones mind.
- phoghed 2mo agoWaiting patiently for the other person to produce a post hoc rationalization about why everybody’s code looking different is in fact a good thing
- insanitybit 2mo agoCan you not read code if it uses single vs double quotes?
- fatata123 2mo ago[dead]
- dewey 2mo agoYou are not making the strongest point by using a relatively subjective rule like that. It includes indentation, how to structure functions and the parameters and many more that in sum make it very easy to jump between projects (Internal company projects, dependencies, other open source projects) without ever getting used to a new style. This makes reading and contributing very easy. Compare that with other languages where you need to load a different set of prettier rules, code formatting tools and follow contribution guidelines on how things should look like depending on the opinion of the maintainers.
- insanitybit 2mo agoI've never found this to be the case having jumped companies a fair bit. I can switch programming languages easily enough, surely I can handle formatting.
- 9dev 2mo agoI can - in fact, I have to, a lot more than I'd like - when someone makes changes with different code style settings in their IDE or tooling, and that affects unrelated parts of the code, and suddenly the PR contains tons of code that just looks subtly different but still does the same thing. If sieving the spam from ham in code reviews is your thing, go have fun. I personally prefer code that is automatically and unconditionally kept in the exact same shape, preserving only the intended changes to stop the team from wasting time on formatting or reviewing.
- insanitybit 2mo agoThat seems like a problem caused by an autoformatted, not solved by one. Obviously having reviewable commits is a reasonable expectation but that doesn't seem like a justification at all.
- yread 2mo agoThat's exactly what a good cogwheel in the machine would say
- maratc 2mo agoMy argument is more to the tune of "everybody’s code looking slightly different is not a problem in practice as long as I can read and understand it." However since you've asked so nicely here you go: everybody’s code looking different is because all humans are different. It's what makes us human. I am very serious about my craftsmanship, and I bring my "humanity" to it: sometimes I include a cultural reference (as in the example above), or an internal joke in the name of a (very long) variable, or vent my frustration in a comment. My first ten years of writing Python were uneventful; nobody commented about my style and I never commented about others'. With the advent of grammar nazi bots, everyone is supposed to now please them by writing completely bland code, which in my opinion degrades me from a craftsman to a code-monkey. This is dehumanising, in a certain sense.
- refactor_master 2mo agoBut your choice of funny variable names is not a craft, and you’re not a craftsman if you think it matters. What matters is extensibility, maintainability and value delivered. I care how the food tastes, not that the chef has a really cool Japanese knife and is really fast at cutting onions.
- phoghed 2mo agoI need a kitchen linter to highlight dishes red that my kids leave around rather than putting in the sink or dishwasher
- maratc 2mo agoI think you miss the point, but using your foodie reference: would you rather go to a couple of Michelin restaurants -- where each piece brings a reflection of the chef, the geographic area, and what quality ingredients were available on that day -- or would you rather only eat at McDonald's for an experience that is extremely consistent across days, seasons, and continents? Now imagine a chef who has a nice little restaurant but is now being sent a couple of "quality assurance" guys from McDonald's who tell him that his choice of potato variety for chips does not exactly conform to the "standards" defined at the mothership.
- jghn 2mo ago> That's why I like Go, every piece of code looks the same, there's one default enforced linter and this discussion (or discussion if discussion should be allowed or prohibited) doesn't even cross anyones mind I remember people saying this exact same thing about Python ~20 years ago.
- coldtea 2mo ago>Which gets rid of the discussion, but not the problem coding style rules are supposed to fix: Code looks the same, regardless of who wrote it. Which might be more overrated OCD than anything worth it. If you like that, you can add a formatter at the end of the chain or even just when reviewing.
- CrompyBlompers 2mo agoThere's a ton of variation in golang code, as gofmt is not opinionated enough. As evidenced by the existence of golines[0] or gofumpt[1]. 0: https://github.com/golangci/golines/ https://github.com/golangci/golines/ 1: https://github.com/mvdan/gofumpt https://github.com/mvdan/gofumpt
- sennalen 2mo agoIs that really a problem that needs solving though? The easiest way to not spend time bikeshedding is to just not bikeshed. Don't make guidelines. Don't run tools to check them. Don't comment on them in PRs. None of it matters.
- kstrauser 2mo agoHistorically, yes. At some point, one person who likes to work with narrow terminal windows gets fed up with long lines and starts reformatting stuff as they go. Another person with a widescreen editor hates looking at code clustered around the left edge of the screen gets fed up and starts reformatting stuff as they go. It's just a mess. You end up with PRs where it's hard to see the 3 things that changed because it contains 200 lines of "my IDE would prefer to format things this way instead". I have never seen this not happen, barring using autoformatters. I think Go and Rust have had great success avoiding all these dumb arguments by having built-in opinionated formatters from nearly the beginning.
- zelphirkalt 2mo agoAren't you supporting the GP's point though? If you auto-format all the things, they will likely not be right for people either, neither for the narrow terminal window, not for the widescreen full size window enjoyer. And there was energy spent on making it so, without it being a clear winner. Instead we could just be respectful and leave such things as they are, and not have to discuss this at all.
- kstrauser 2mo agoNo. Auto-formatters have a way of getting people out of the mindset of arguing about it and just accepting that's the way it is. It's not that different from, say, using a compiled language instead of assembler. You and I might have differing ideas about how to write the best assembly code. If we standardize on C, it's likely neither of us will love the compiler's output, but short of outright bugs we'd move past that and go back to writing code.
- kristjansson 2mo agoThe value isn't just in the lack of discussion, but in amplifying the signal to noise ratio of diffs. with ruff or gofmt or whatever, it’s pretty much guaranteed that a change of code is an intentional part of the proposed change. with multiple authors with variable code styles touching the same project, there is a much higher chance of a diff containing lines that preserve semantics but change the code.
- CuriouslyC 2mo agoUsing a consistent string delimiter has value: if you search for ['foo'] you will find all instances of the string foo. With inconsistent delimiters, you better have a single canonical 'foo' in your project or you're going to run into problems.
- maratc 2mo agoSee if you know where this leads before clicking on it: https://xkcd.com/208/ https://xkcd.com/208/
- CuriouslyC 2mo agoSo your argument is that your freedom to use whatever string delimiter you want (remember that ''', """, ` and even weird unicode glyphs are valid in many languages) is worth forcing other engineers on the team to know all valid string delimiters and remember to use the right regex to account for all possible weirdo choices?
- maratc 2mo agoMy argument is that searching for \bfoo\b will produce all the results you want. Python was designed from the start so that 'foo' and "foo" are equal. It also worked like that for 30 years or so. This has not been an issue in these 30 years. But then someone came with an opinion that one of them is better than the other.
- CuriouslyC 2mo ago\bfoo\b will produce noisy results. People have been pushing linting rules that force a single consistent choice of string delimiters since at least 2010 when Python went from a cute academic language to a real industry workhorse.
- maratc 2mo ago> \bfoo\b will produce noisy results. Add a look-behind for '[' and a look-ahead for ']' and you'll be fine.
- bigmadshoe 2mo agoI would hate to work on that codebase. We learn to parse code more quickly over years of looking at code written with the same conventions and style. There’s a reason why Google are so serious about following their style guides.
- insanitybit 2mo agoI've never had discussions about code formatting in PRs, this seems like a made up problem or something that predates my career.
- pdpi 2mo agoIt's not by accident that tabs vs spaces is one of the stereotypical great debates in programming.
- insanitybit 2mo agoI've never seen this debate take place outside of internet forums, almost always as a joke. It's been about 15 years since I even remember it coming up much as a joke, frankly.
- phoghed 2mo agoYes, because the battles have been fought and spaces won
- insanitybit 2mo agoOkay, so if the battles are won why do I have to care? What is the point of having so many strict, enforced style rules if your exemplar has already been long dealt with?
- phoghed 2mo agoOne war was won bro, there are many more. Pretend they don’t exist as much as you’d like, tell everyone their lived experience is wrong, that the tools arose from delusion and not any real world need, and that they benefit no one. I’ll keep using them though, and never suffer from someone writing typescript with 4 spaces, leading commas, and no semicolons again.
- insanitybit 2mo ago
- Stitch4223 2mo agoEven better: if someone feels like the syntax must be different, they can pick it up at a centralized repository with more people that specialize in syntax. Afterwards it will affect production code everywhere on the planet. :)
- bwhmather 2mo agoThis is the way, and why I wrote https://pypi.org/project/ssort/ https://pypi.org/project/ssort/. Unfortunately you need to follow it up with shameless self-promotion or it doesn't work.
- storus 2mo agoDunno, now the workflow is like agent makes code changes, ruff complains, agent fixes complaints at the cost of code bloat, agent makes a PR, another agent reviews the PR, agent makes changes, PR is approved and merged. Nobody reads PRs anymore with the agentic development velocity.
- zx8080 2mo ago> Nobody reads PRs anymore with the agentic development velocity. Tokens are burnt, that's the most important part. And with more of the generated shitty code there will be more tokens spent in the future.
- coldtea 2mo ago>The point of the "grammar nazi" bots is to focus on the actual problems: if a bot is deciding about linting, you don't have to waste brain power to discuss it in PRs. And yet, as per the example, the bot force worse linting decisions, and even pushes towards more bugs (e.g. future readers missing the comment intention since it now applies to all 3).
- mrbombastic 2mo agothe claim we are arguing here is not that “linters never make mistakes” it is that “linters are generally beneficial and avoid mostly useless debates we previously spent an inordinate amount of time on” Most linters have an escape hatch for exactly this which is usually a one line disable comment
- qmmmur 2mo agoAnd yet, a new argument surfaces about whether or not the linking should take place. Some people just like to argue :)
- patrick451 2mo agoThere is no point discussing these minutia, ever. Just ban discussing them in PRs and then you don't need an opinionated bot rife with false positives to "fix" them.