r/learnprogramming • u/just_jesse • 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.
253
Upvotes
View all comments
Show parent comment
28
u/happy2pester Jul 12 '13
I'm just peering over one of my old programs now, here's a list of some of my variables.
n,l,a,lset,etype,deus,Ruby,ruby,hper,wper,mper,fper,pper
It goes on and on and on. And it gets better. All of those are global variables, because I didn't know how to do it otherwise.
Also: Only 1 in three functions have any comments, and several resources that the program relied on have the location hardcoded in.