Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Can working with bad code erode your programming skills?

share|improve this question

7 Answers 7

up vote 28 down vote accepted

It depends.

It depends on whether you are allowed to correct bad code. If you are not allowed to correct, then it will definitely erode your programming skills. Surround yourself with excellence and you will automatically raise the bar for yourself.

It depends on your team and manager. It depends on whether they can recognize good/bad code, and how much they appreciate good code. Man is a social animal. We look for support in each other. If nobody appreciates good code, it can be quite frustrating. It is difficult to plod on without encouragement.

It depends on your team members and mentor. It depends on if they are trying to salvage the situation. If they are not, then the lead/mentor/team is not good enough for you to learn from.

share|improve this answer
+1: Wow. This post has aged remarkably well. Really outstanding points. –  Jim G. Jan 20 '12 at 15:43
I hope you're a mentor. –  Josh Campbell Apr 17 '13 at 5:09

I've found that working with bad code can actually help improve programming by sharpening the eye for better refactoring. It's being constantly challenged to figure out how to make something better. That can be a good thing.

share|improve this answer

Only if you are easily tempted by group-think/laziness. Of course, working on projects where other people screw up your good code with their bad code can certainly reflect poorly on you.

share|improve this answer

I'd say:

not if you can recognize it as bad code.

But if you can't, well...I think you can guess the rest. :)

Edit: To elaborate.

Once you recognize bad code, you'll most likely know why it's so bad, and what it should look like. By fixing it, you'll learn a lot. You'll also get a chance to see a lot of "DON'Ts", and since seeing them is painful, you'll most likely remember them too.

Not recognizing bad code, especially your own bad code, is a sign you're stagnating. And that's the worst thing I can imagine happening to me as a programmer.

share|improve this answer
I think Dr HL has a good point, you need to recognise that it's bad code, otherwise you'll just see it as "new" and adopt it ;) –  Anonymous Type Nov 18 '10 at 21:41
Unfortunately, I never recognize my bad code until several weeks after I write it. That doesn't happen much now after 3 years exp., but it does happen, and it sends me into deadly refactoring-loop where I feel the need to rewrite something over and over and over again until I feel it is right. And I am pretty perfectionist, so when I see a problem, it takes awhile to get out of that loop. –  vedosity Feb 14 '11 at 22:05
@franticfantom: Weeks? You're lucky it's not years! –  dr Hannibal Lecter Feb 15 '11 at 9:22

I dont really think so.

I've worked with a fair amout of bad PHP code, at worst I think it promotes just hacking the bad code even worse. If I see a block of nasty code I just try to do what I need to do in the quickest way possible and get out. Would I do this to good code or do this in my own programs? No.

It's not going to erode your programming skills so long as you recognize that it is bad code and don't follow suit.

share|improve this answer
agreed, after a certain point you just recognise it as such and go "oh more of that spaghetti ##$%" fix it, and move on. –  Anonymous Type Nov 18 '10 at 21:42

It should strengthen your programming ability if you refactor it, thereby practicing good coding.

share|improve this answer


I learnt to program from some very bad examples; It made me want to fix them, with less code. I realised it was easier and quicker to re-write -- if I could do it in less code, less bugs and easier to read.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.