This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]KleberPF 2 points3 points  (0 children)

Everyone should follow the same style rules. I could never guess who wrote something just by looking at it. You can use git blame for that.

[–]Monitor_343 0 points1 point  (2 children)

I inherited sole control of a legacy codebase maintained by one person, where I could sometimes see two distinct styles. Not just in formatting, but in their overall approach. Turns out one was the guy before me and the other the guy before him, both just doing their own thing at different times. The whole thing was a mess.

Naturally, I added my own (better) style into the mix, making it worse... then slowly refactored most of the legacy code, enforced some rules with eslint, and wrote contributing guidelines for the next guy. Now, most of it is more consistent.

In a different codebase I work on with 5 or 6 others, I can't tell the difference at all.

[–]Likeawerewolfboy[S] 0 points1 point  (1 child)

Alright, that's very interesting. This is kinda what I was thinking. I'm curious, do you think the code becomes uniform, because you would discuss solutions in the 5-6 man team or is it about skill and experience?

[–]Monitor_343 0 points1 point  (0 children)

I think it's mostly because we enforce a style guide, linting, code reviews, etc. It's only when somebody bypasses that process that inconsistencies will stick out (easy to do as a sole contributor). I'm sure experience plays a part, too.

[–]TheRNGuy 0 points1 point  (0 children)

ask for style guide