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

33

u/tommy_chillfiger Mar 22 '22

I don't care if it would benefit me to do this. I won't do this. It's bullshit and so cynical I'd rather suffer the consequences than participate. I can always find another job but I need to maintain my integrity.

17

u/dcfan105 Mar 23 '22

Exactly. I'd hate doing this. It already bugs me that I can't just share the specific code I'm working on in my internship with whoever I want (I get why and I abide by it, but it is annoying). If I had to keep my process secretive it'd drive me crazy, partly because I'd not be able to ask for help, partly because I want other people to be able to use my code, and partly because my future self would be quite annoyed when I couldn't remember what the heck I was thinking when I wrote the code in the first place.

Literally one of the first things I learned about programming, because it was mentioned right at the beginning of the textbook, is that comments are as much for your future self ad they are for other people. If you don't bother with them, you may end up just rewriting stuff from scratch months later when you need to make a change, because you can't remember what the heck you were thinking when you wrote the program the first time.

Later, I learned that it's actually better to keep comments to a minimum and just make variable, class, and function names as reasonably descriptive as possible. But the point is that clear and easy to understand code is just better for other programmers, it's also better for you if you ever plan on making any sort of change to it.

5

u/exploding_cat_wizard Mar 23 '22

As a bonus, that will lead to you, in time, finding a place that doesn't do that, with a higher job satisfaction as a result, I'd imagine.

0

u/[deleted] Mar 23 '22

[deleted]

11

u/tommy_chillfiger Mar 23 '22

I'm a business analyst, but I do work in the code base a lot and am starting to code some in Python to automate parts of my job. Just a disclaimer. But even for tools only internal users will ever use I am trying to write clearly and include comments.

It's good practice and good form, even without getting into the fact that I think any added job security isn't worth the icky aspect of it.

Frankly I am pretty deeply bothered by all forms of intentional obfuscation of truth. I think understanding is a virtue on its own, and the impulse many have to intentionally mislead, frustrate, and confuse others is in my view one of the great tragedies of the world.

3

u/GoonButtnotFprgetten Mar 23 '22

I do not know the field. At all. That fact aside shouldn’t programmers kinda work together for bette product (creating value for all involved) and then it becomes a group environment.

2

u/[deleted] Mar 23 '22

THIS!