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

363

u/vondpickle Mar 22 '22

Me: don't be that guy!

Also me: oh, that's me.

243

u/el_floppo Mar 22 '22

Came here to say the same. I was refactoring some stuff the other day thinking "Who the fuck wrote this garbage?" before realizing it was me.

63

u/[deleted] Mar 22 '22

Home renovation is much the same way. Man the last person to do this was an IDIOT, which was also me, and still true.

12

u/[deleted] Mar 22 '22

"What moron drilled a hole for the icemaker line 1 in. from the bottom of the joist?"... Fuck me I did that when we moved in. I'll have to move it, put up some stupid steel plate and pay a structural engineer to sign off on it in 10 years when we want to sell the house.

7

u/[deleted] Mar 22 '22

Hah. All you need to do is drywall and paint over your mistake I’d assume. That’s what 90% of people would do.

That’s when you really yell at idiots. When you start removing drywall and finding the most egregious shit ever. Unless you’re willing to dip into the bankroll, never take down drywall in a basement.

6

u/[deleted] Mar 22 '22

This is on the basement covered up by some ceiling panels. Kind of a 50/50 shot if an inspector catches it.

3

u/nopethis Mar 23 '22

opened up a ceiling one time to find about 3/4 of the main support beam in the house sawed through for cords and other random crap. Not sure how they thought that was a good idea.

→ More replies (1)

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]

→ More replies (2)
→ More replies (1)

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!

9

u/CoderXocomil Mar 22 '22

I view this as a form of self-compliment. You have gotten better, so the old you doesn't look so good.

→ More replies (1)