r/learnprogramming • • Jul 12 '13

What are some bad coding habits you would recommend a beginner avoid getting into?

Whether they're stylistic habits or program design habits. I'm learning java and want to be sure to write my code as efficiently as possible to avoid lengthy code and poor design choices.

247 Upvotes

215 comments sorted by

View all comments

Show parent comment

7

u/HadManySons Jul 12 '13

I remember hearing "comment as if a serial killer was going to come behind you and review your code"

5

u/throwJose Jul 12 '13

what?

10

u/HadManySons Jul 12 '13

Comment your code as if some psychotic person was coming behind you to learn your code solely from your comments. If you weren't horribly axe murdered in the night, then your comments were descriptive enough

1

u/lookingatyourcock Jul 13 '13

So what you are saying is I should go out and axe murder everyone whose code is not descriptive enough?

1

u/HadManySons Jul 13 '13

You're not the Dexter of bad comments.