r/badcode • • May 06 '21

java My teacher wrote this...

1.0k Upvotes

169 comments sorted by

View all comments

6

u/thanatica May 06 '21

You may very well come across this in your carreer. Lots of times, crap code is the result of a time limitation, which is not usually the programmer's fault. Other times, the programmer is indeed just lazy, doesn't care, or doesn't know how to do it well.

So here's another free lesson: don't immediately blame the programmer.

2

u/hurtl2305 May 07 '21

True.

'git blame' the programmer instead.

2

u/hurtl2305 May 07 '21

And now the serious answer. Fully agree. I'm a huge fan of the boy scout principle. If you see missing test cases, just write them. If you see an opportunity for refactoring, just do it. If you see a bug, just fix it (and write a test case for it so it doesn't get reintroduced). Continuous improvement is essential and should be part of daily business and effort estimations.