123 points

I worked with a developer who insisted on using the shortest names possible. God I hated debugging his code.

I’m talking variable names like AAxynj. Everything looking like matrix math.

permalink
report
reply
65 points
*

Ah, must’ve been a fortran developer. I swear they have this ability to make the shortest yet the least memorable variable names. E.g. was the variable called APFLWS or APFLWD? Impossible to remember without going back and forth to recheck the definition. Autocomplete won’t help you because both variables exist.

permalink
report
parent
reply
46 points

He did write some Fortran in his past! What made you think it was Fortran influence?

permalink
report
parent
reply
69 points

72 characters per line/card.

permalink
report
parent
reply
7 points
*

I’d say because fortran is often used for calculations such as numerical analysis where you have x, y and z for example.

I have written fortran code in the past and it was mainly for that.

permalink
report
parent
reply
5 points

Your first few programming languages usually influence you the most for the rest of your career.

permalink
report
parent
reply
21 points

And you can write more than six characters, but only the first six are recognized. So APFLWSAC and APFLWSAF are really the same variable.

And without namespaces, company policy reserves the first two characters for module prefix and Hungarian notation.

permalink
report
parent
reply
1 point

And the rest of you are COBOL programmers.

permalink
report
parent
reply
18 points

I vomit whenever I have to read one letter alias SQL. And then… I dealias it.

permalink
report
parent
reply
8 points

I don’t understand why people think that it’s acceptable.

As developers, we’ve had it drummed into us from day one that variable names are important and shouldn’t be one or two letters.

Yet developers deliberately alias an easy to read table name such as “customer” into “c” because that’s the first letter of the table. I’m sure that it’s more work to do that with auto completion meaning that you don’t even need to type out “customer”.

permalink
report
parent
reply
5 points

Especially when you also have company and county tables. It forces people to look up what the c is aliased to before beginning to comprehend what you’re doing.

permalink
report
parent
reply
7 points

At a previous job I had to work with an old database where all the tables and columns had 6-character names

permalink
report
parent
reply
1 point

Same. Old DB2 base from the 80’s that was migrated to Oracle in the 90’s then to Postgres in the 2010’s.

And the people there know all the column names by heart 😅

permalink
report
parent
reply
2 points
*

shortest names possible

This film from 1975 is still relevant today: https://www.youtube.com/watch?v=7hdJQkn8rtA

permalink
report
parent
reply
74 points

Nah, I name all my variables after my homies.

int dave = 0;

permalink
report
reply
34 points

does dave know he’s a zero?

permalink
report
parent
reply
53 points

In zero-based indexing, zero is #1.

permalink
report
parent
reply
8 points

Dave was number one!

permalink
report
parent
reply
13 points
*

His best friends index starts at 0

permalink
report
parent
reply
7 points

Ah, the XCOM approach. Now you look after those variables and get sad when you have to delete them.

permalink
report
parent
reply
55 points

installing operating system: 15 minutes, give or take.

give a name to the computer: 45 minutes

permalink
report
reply
16 points

I’ve got that shit on lockdown man.
I name all my devices “Fuck0ff” followed by a 3 letter descriptor of what it is. E.g. - my windows install is Fuck0ffDTW for Desktop Windows, my Garuda install is Fuck0ffDTG for Desktop Garuda(it’s a flavour of Arch, btw)

permalink
report
parent
reply
8 points
*

What if you would have 2 devices of same type with same OS or just with OS that starts with same letter? Will you use numbers, if yes, how much leading zeroes if any you will use? If you don’t use numbers, will you add a room name? But what if there are 2 devices with same OS in the same room?

permalink
report
parent
reply
6 points

Luckily I’m not responsible for naming my wife’s devices, otherwise the whole scheme would be up shit creak. As it stands I have a dual-boot desktop, a daily laptop, a surface pro4, and an old laptop running Ubuntu server for various self hosted stuff. I’ve managed to just use 3 letters, I assume as I amass more tech I’ll need to start adding numbers, if I have to label for rooms I’ll have more than a data hording problem.

permalink
report
parent
reply
51 points

You should really be naming all your variables by generating 64 character (minimum) random strings.

permalink
report
reply
37 points

Who needs private variables when you can generate cryptographically secure variable names? Much better security.

permalink
report
parent
reply
12 points

Make it 63 (31?) to align with what C99 can distinguish.

Also: I really like unicode in identifiers. So if at all possible don’t just have a random string of letters and numbers, make sure to include greek letters and all the funny emojis. (I just forgot which languages and compilers etc allow that.)

permalink
report
parent
reply
17 points

For extra fun, you can name your variables using solely Unicode invisible characters (e.g. non-breaking space) so they’re impossible to visually distinguish

permalink
report
parent
reply
0 points

Wingdings as well

permalink
report
parent
reply
5 points

Wingdings is a font and has no effect on the actual code. Only people who set their IDE font to wingdings will see wingdings

permalink
report
parent
reply
41 points
*

FullSentenceExplainingExactlyWhatItDoes(GiveThisVariable, SoItCanWork)

permalink
report
reply
52 points

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.5K

    Monthly active users

  • 978

    Posts

  • 38K

    Comments