top | item 16948195

(no title)

Nvorzula | 7 years ago

Here's one that always has me stare at the screen, quietly, in disbelief.

1. Carefully read and grok a small-to-medium sized module. 2. Notice that although the style is not the "official" style of that language, that it is very consistent and legible. 3. Contribute a small change in that exact same style, such that no one would know that it was a different author if they did not look at the git blame. 4. Get a condescending comment from the first author asking that you, "read and follow the official BLANK style guide".

discuss

order

z3t4|7 years ago

I rather work with you then the other guy. If you add your changes using the new style guide, it will look weird and someone will complain. If you rewrite it all, someone will complain because it was a waste of time. Whatever you do, it will be wrong. The solution is to go ask the most senor and respected dev what to do, then redirect to him/her when others complain. =)

yxhuvud|7 years ago

I'd create an initial separate commit with only style changes and then have my new or changed code follow the code standard. The code converges very fast if everyone does that.

inertiatic|7 years ago

Well, this makes sense somewhat. Files will be edited incrementally to the point that nothing remains from the original. If you follow your strategy, the original style remains there until a large rewrite. If you make a point to always follow the official style, then at some point you'll automagically have a consistent codebase.

loeg|7 years ago

I disagree that incrementally converting style is helpful. It's best to be consistent in a given file or module. Convert wholesale if so desired.

mhotchen|7 years ago

I think it depends on your environment. I've been in situations where code styles have progressed and changed over the years, faster than the file does, so you end up with a hodgepodge of different styles.