Inheriting applications at a new job

coding-stylelegacy code

When inheriting applications at a new job do you tend to stick to the original developers coding practices or do you start applying your own?

I work in a small shop with no guidelines and always wondered what the rule was here. Some applications are written very well but do not follow the standards I use (variable names etc…) and I do not want to "dirty" them up. I find my self taking a little extra time being consistent.

Others are written very poorly and it looks like the developer was changing his mind every keystroke…

ADDITIONAL THOUGHT

What about when I start my own projects? So now I have introduced a new coding standard to the mix:

  1. The good code – but not my style
  2. The bad code with bad practices and lack of standards
  3. My own standards

Best Answer

If there are standards evident in the code, you should stick to them. If there aren't, start introducing your own.