Click here to Skip to main content
15,891,033 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Office politics and sh*tty code. Pin
baersteven21-Jun-16 9:14
baersteven21-Jun-16 9:14 
GeneralRe: Office politics and sh*tty code. Pin
Jeremy Falcon22-Jun-16 10:28
professionalJeremy Falcon22-Jun-16 10:28 
GeneralRe: Office politics and sh*tty code. Pin
Fernando Takeshi Sato23-Jun-16 14:00
professionalFernando Takeshi Sato23-Jun-16 14:00 
GeneralRe: Office politics and sh*tty code. Pin
Jeremy Falcon23-Jun-16 15:12
professionalJeremy Falcon23-Jun-16 15:12 
GeneralRe: Office politics and sh*tty code. Pin
Gary Wheeler27-Jun-16 2:17
Gary Wheeler27-Jun-16 2:17 
GeneralRe: Office politics and sh*tty code. Pin
Jeremy Falcon27-Jun-16 7:00
professionalJeremy Falcon27-Jun-16 7:00 
GeneralRe: Office politics and sh*tty code. Pin
Gary Wheeler27-Jun-16 7:07
Gary Wheeler27-Jun-16 7:07 
GeneralRe: Office politics and sh*tty code. Pin
mbb0112-Jul-16 22:15
mbb0112-Jul-16 22:15 
Yeah, I have been in a similar boat to you in the past about other people's code. Usually, a lot of code has been turned quickly out by programmers transient to the project and I'm the guy left to pick up the pieces. This used to be really frustrating until I was reminded that it is precisely because I'm the 'better' developer that I'm the one doing all the refactoring.

So, it is important for you to highlight the deficiencies in the code base but unfortunately it is there and everyone is stuck with it. You could argue for a complete re-write, but the is unlikely to happen just because you say the code is 'bad'. If it is working and/or being sold, your management won't give a fig about your problems; and, after all it is your problem so no complaining and get on with your job Wink | ;)

In this situation there is one thing I say fairly early on and it goes along the lines of: 'this code isn't where I want it to be. All the while I'm working on the code I'll seek ways to improve it incrementally until it is. Or until I'm reassigned'. On that basis you'll have to accept the process could take years and make sure your management know this is a normal part of your day to day activities of fixing faults and CRS.

Then I will look for opportunities for refactoring, on the justification of a fault to fix or a CR. Always ensure you've got a good testing regime in place to attempt refactoring (that doesn't necessarily mean automation) and you are able to mitigate the risks of the change. e.g. rollback, incremental changes.

It is important that your management build confidence in your ability to refactor code, so pick your refactoring targets carefully to begin with so you don't mess up. (You may not know what past history your firm has had along these lines).

Sometimes refactoring is simply not appropriate and a direct rewrite would serve you better. Again choose your target carefully, but in a rewrite it will allow you to develop and test in parallel and to establish a core code base to build out, from within.

You could champion a set of standards and best practices within your group. Rather than take on the mammoth task of refactoring yourself, perhaps a change in team culture would help. Don't focus on variable naming conventions and the like. That's irrelevant. Focus on things like project structure, where library methods live, code templates snippets etc. Consider your standards in three tiers - must adhere to (e.g. things that break the build or can cause serious problems such as memory leaks), should be applied where appropriate (e.g. usually best followed, but there may be good reasons for deviating from standard) and advisory (e.g. there are various different ways of implementing IDispose depending upon the circumstances).

Finally consider ways to present your arguments in objective terms, because the 'right' way to code is incredibly subjective. Here is a list of ways to highlight the problems in the code base:

1. Static code analysis.

2. High incidence of faults in a given area; make sure your replacement doesn't generate as many faults as before!

3. Performance problems in a given area.

4. Obsolete technology.

5. Complicated interactions with other systems and between sub-systems.

6. Complicated build and installation process. If your code doesn't build out the box, requires 'installing' before you can compile it etc Streamlining build->release->test should see a measurable benefit in the faults database and project lead times.

Hope this helps.
General@&#@^&@*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 10:44
Mark_Wallace20-Jun-16 10:44 
General@&#@^&@&*!& MICROSOFT!!! DAMMIT! PinPopular
Kevin Marois20-Jun-16 8:59
professionalKevin Marois20-Jun-16 8:59 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Cornelius Henning20-Jun-16 9:05
professionalCornelius Henning20-Jun-16 9:05 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Kevin Marois20-Jun-16 9:07
professionalKevin Marois20-Jun-16 9:07 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Cornelius Henning20-Jun-16 9:09
professionalCornelius Henning20-Jun-16 9:09 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
ZurdoDev20-Jun-16 9:32
professionalZurdoDev20-Jun-16 9:32 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Kenneth Haugland20-Jun-16 10:12
mvaKenneth Haugland20-Jun-16 10:12 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
ZurdoDev20-Jun-16 10:15
professionalZurdoDev20-Jun-16 10:15 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 10:24
Mark_Wallace20-Jun-16 10:24 
QuestionRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
ZurdoDev20-Jun-16 10:25
professionalZurdoDev20-Jun-16 10:25 
AnswerRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 10:27
Mark_Wallace20-Jun-16 10:27 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
ZurdoDev20-Jun-16 10:27
professionalZurdoDev20-Jun-16 10:27 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 10:47
Mark_Wallace20-Jun-16 10:47 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 11:08
Mark_Wallace20-Jun-16 11:08 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Cornelius Henning20-Jun-16 11:16
professionalCornelius Henning20-Jun-16 11:16 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
Mark_Wallace20-Jun-16 11:26
Mark_Wallace20-Jun-16 11:26 
GeneralRe: @&#@^&@&*!& MICROSOFT!!! DAMMIT! Pin
2374120-Jun-16 9:08
2374120-Jun-16 9:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.