Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with seniors' bad coding style/practices? [closed]

Tags:

I am new to work but the company I work in hires a lot of non-comp-science people who are smart enough to get the work done (complex) but lack the style and practices that should help other people read their code.

For example they adopt C++ but still use C-like 3 page functions which drives new folks nuts when they try to read that. Also we feel very risky changing it as it's never easy to be sure we are not breaking something.

Now, I am involved in the project with these guys and I can't change the entire code base myself or design so that code looks good, what can I do in this situation?

PS> we actually have 3 page functions & because we do not have a concept of design, all we can do is assume what they might have thought as there is no way to know why is it designed the way it is.

I am not complaining.I am asking for suggestion,already reading some books to solve the issues Pragmatic Programmer; Design portion from B.Stroustrup; Programming and principles by B.Stroustrup;

like image 988
Ramadheer Singh Avatar asked Oct 15 '09 21:10

Ramadheer Singh


2 Answers

The best and most important thing you can do is lead by example. Do things the right way and try to improve things slowly. You aren't going to fix anything overnight.

Make sure every piece of code that you are responsible for is better after you are done with it. Over time, the system will tangibly be better because of your efforts.

After you build a strong reputation with your co-workers, try go start some code reviews or lunch-training sessions to get everyone up to speed on better ways to do things.

In a nutshell: it will be difficult and frustrating, but it's possible. Good luck.

like image 171
Robert Greiner Avatar answered Oct 07 '22 21:10

Robert Greiner


Your best bet is to NOT to handle it at all. Here are potential problems if you try:

  1. You will be criticized for doing something you were not told to (makes performance reviews go real bad.)
  2. You will have less time to do your own work.
  3. You will not advance your career by cleaning working code- if it is not broke then do not touch it.
  4. Never make enemies with people who control your career- unintentionally implying they are obsolete morons does not help your cause (especially in a bad economy).

Focus on making your own code great. Battling poorly written code is part of the ill of being a Software Engineer. You are in the wrong profession if you will not stand for it.

A little off point but important- You may need to switch jobs or teams if possible once the economy picks up. Mixing with a truckload of bad coders who do not bother to update their knowledge and practices dulls your own programming skills and weakens your marketability.

like image 26
Phil Avatar answered Oct 07 '22 21:10

Phil