I have been programming mainly in Python in the past years and mostly on my own projects. I have developed some of my own small stilistic conventions like leaving 4 numbers of empty lines between classes and 1-2 lines between methods, etc.
Currently I moved to a company with 8 developers developing mainly in Ruby and Rails. There is some general lack of popular best practices in anything related to code; bad code designs, high coupling, no abstractions, old style coding, no central documentation, mixing of low level stuff in views in an MVC framework etc.
In an effort to make re-usable code, I committed a small 20-line library like below (I changed some things but tried to keep the main points as closely as I could).
module CarNaming def build_car_name_table() # .. stuff here .. end CAR_NAMES = build_car_name_table() # ------------------------------- API -------------------------------- def car_model_to_name(car_model) # .. stuff here .. end end
A few days later I got an email from one of the main lead developers CC:ing the other lead developer and the architect. The email read something like below:
Regarding your latest code on file y, I would suggest to make .. (some technical stuff)..
Also, should I need to remind you to run rubocop against the code before commiting?- it's a mess.
Kind regards, z
I tried to see this with an open eye so I went the other day asking for some clarification. He did explain to me the technical changes and why they were needed. I accepted them as humbly as I could and only raised the lack of documentation that could have prevented this (something he didn't comment on).
However, when it came to the coding style he mentioned some things. The main point was that they try to follow the Rubocop (a code static analyzer) conventions.
The automated warnings were something like this:
Warning: extra blank line at line x Warning: extra blank line at line y Warning: extra blank line at line z Warning: parenthesis not necessary when calling a method ..
That's all fine - we agreed to fix this on the spot. What annoyed me was when he was removing the line with the dashes he exclaimed ".. and this is a mess" (for a second time).
I tried not to take anything personally but I can't deny that I found the "mess" comments rather annoying. Mostly since to me, having white-spaces and some headers to me adds readability than the other way around. But how can you argue about this with someone? Especially if you are the new guy and the other person is in a higher rank than you? Is it even worth talking about?