Code style should be automated same as running tests when someone creates PR.
Code style should be automated same as running tests when someone creates PR.
As, IMHO it depends (as so often). Code review is commonly the place that puts the current style under test (hence automated otherwise you don't have the results during review) and under review.
E.g. Code review finds out if a code-style is missing, incomplete or even outright wrong.
If that approach is taken, passing tests and code-style must be in there, otherwise it is not useful to argue about violations. From my understanding I would therefore see those results be available during review.
It may also be that there is code-style for automated test-code, and that code part of the review. Without taken this into context of the code-review, I miss a bit the boundary of your comment.
Could you elaborate a bit where you draw the line and why? E.g. I can imagine there is a benefit to keep a distinct context for code-reviews so that they are still practically feasible and those parts that need further adoption are put into a different phase, like steps before (preparation of the current increment) or after (preparation of next increments) the code-review itself.
Discussing or fixing code style is huge waste of time and styling can be automated. Yes it will be broken in some edge cases but for me that is acceptable because my goal is to deliver the feature and not to make "perfectly aligned code". Aligning code by hand is waste of time, thinking about aligning code is waste of time. Formatting should be in configuration and you format whole file at once and never do stuff by hand.
Passing tests is also easy to automate when creating PR, CI should run tests and tell that to person creating PR - hey tests failed, fix it and then after they pass you can open PR, not a fellow developer because that is waste of time for everyone.
I did not write "tests should not be there" only "are all tests passing?" is not part of code review for me, it is something that is there before code review even begins.
So checking if there are proper tests and if tests make sense is part of code review.
Nevertheless, things can be different, e.g. if CI passes, it merges already, no need to have a request for merge, which are often a blocker to keep a steady development flow. Naturally, this benefits from tests that are already run during development, if not driving the development.
And I didn't read you're against testing nor aligning white space and comments at all, more the localization. Actually the points you raise are looking important to me, because if alignment comes in late, this can cause a lot of erosion, which can hinder any review if not even provoke merge conflicts which are stopping the process quite early and require re-iteration.
Your approach should also work towards non-release blocking code reviews, a property I personally like, as I've seen teams struggle with code reviews, becoming more and more of a burden, even after practicing it has found its way. But that is only a subjective comment of mine, every project is different, which makes it an interesting topic for me.
What's surprising to me in the article is the pyramid style. In all business school and psychology texts, the top of the pyramid is the most important one. Here it's the least important.
Same with joining new team, one might have preferences but you leave them at the door and format code with whatever already is there.
There is tooling where you can also have formatting configuration per repo so if you use IDE it would take that config and format it for you in "project style".
> If they have dress code or code style it is for them to set it up.
I also chose this company because they don't. A dress code, what power-hungry lunacy is that?
The benefit of automated linting is that the codebase becomes more coherent and easier to read.
The down side is that you can’t add your personal flare to your contributions… but in my opinion that’s not too important
And again, being against personal flair only makes sense if you are a manager trying to treat programmers interchangeably, but as a programmer, your interests are increasing personal flavour in code so you are less replaceable.
It took me 6 months to fully decode all his personal mnemonics, abbreviations, style decisions and bizarre architecture plans.
There were several times during that time when I considered trying to find him to tell him what I thought about him to his face.
You are going to be replaced at some point, unless you think this company is going to fold before you retire.
If he actually documented his abbreviations, mnemonics, style and architecture, you would have most likely appreciated it instead of cursing it, I think.
So replaceable in fact that the company wouldn't have had to hire me at great expense and could have got a normal developer in to take over and continue.
Maybe I'm just extremely jaded since my job is fixing messes left by people with more style than sense but I see striving for uniqueness to be a flaw in an engineer.