r/learnprogramming • • Mar 22 '22

Don't be that guy.

I just took over a project for a guy who left. Don't be this guy:

  • ZERO comments in your codebase.

  • One and two character variable names with no discernable pattern.

  • Comment characters used to comment out big chunks of code for no discernable reason.

  • No error checking.

  • Reliance on data files that you forgot to include or explain, going in to meaningless data frame names.

  • Making outrageous claims about how much your code improves things with zero baseline performance.

People like this think you're an idiot because you can't make their code work, and get to be all smug. We will track you down and find you. You will need references someday....oh my.

2.6k Upvotes

427 comments sorted by

View all comments

Show parent comments

5

u/tnnrk Mar 22 '22

I’ve never understood the 1 character variable names. Like why would you do this. Any file size savings you received from removing a couple bytes here and there are not worth the complete lack of readability.

1

u/BeardSprite Mar 23 '22

Laziness and convention, especially if you're talking about CS graduates. At university, these were incredibly common because everyone had to go through a large number of theoretical CS and maths courses, where this was the de facto standard and naming things verbosely is clearly considered a cardinal sin.

I've also seen it when someone with a strong math-y background picks up programming; many times they will start doing the same thing if all they have to do is write short scripts rather than huge applications that need to be maintained for years to come.

1

u/vi_sucks Mar 23 '22

Eh, i make exceptions here for variables that are standard math or commonly used in programming.

If you want to iterate through an array, for(int i = 0, etc) is fine.

Same if you are working with a graph/matrix of some kind and use x,y as coordinate pair.