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

32

u/[deleted] Mar 22 '22

I think we all do that when we revisit our past work. I am still waiting for the day I can look back and be like, damn, that is a fine piece of as…erm code right there.

16

u/OGPresidentDixon Mar 22 '22

I do this. I'll be looking at a beautiful chunk of code and my git lens extension will say "You, 3 years ago." 🥲

I'm pretty far along in my career tho and I used to have a lot more energy lol. Life caught up to me and I no longer can hack all night while continuously refactoring.

Also my variable & function names are like sentences now because I've used up most of the concise combinations of words that exist for what I'm building.

20

u/[deleted] Mar 22 '22

One of the hardest parts of programming is damn naming.

0

u/[deleted] Mar 22 '22

[deleted]

4

u/Sceptical-Echidna Mar 23 '22

I’ve usually heard it as there are two hard problems in CS: cache invalidation, naming things and off by 1 errors

0

u/[deleted] Mar 23 '22

[deleted]

1

u/WillbaldvonMerkatz Mar 23 '22

Do not forget about time formats.

5

u/wjrasmussen Mar 22 '22

We do. Most often it is, for me, when I tried to do "something clever" that bites me.

4

u/el_floppo Mar 22 '22

I think if you ever look back at your code and have that thought, then it's time to retire. End the career on a good note and go out on top!