this post was submitted on 11 Jan 2026
387 points (92.5% liked)

Programmer Humor

30266 readers
2300 users here now

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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] masterspace@lemmy.ca 18 points 1 month ago* (last edited 1 month ago) (11 children)

Outside of the for loop counters i and j, short variable names are awful. Coming back to old code written with abr var nams is like talking to someone in the military who just constantly throws out jargon and acronyms that they know you don't know.

But so are Java style ObserverFactoryManagerTemplateMachinistTemplater names.

There's a sweet middle ground of short, but actually descriptive name. Sometimes it's not possible but that's usually a code organization / language / framework smell.

Too short variable names is usually a sign that you need to use a proper ide, with auto complete, or that you need to use a proper build process that will minify your code after the fact.

Too long names are usually a sign that your module of code (function, class, namespace, etc) is too large, or that your language/framework naming conventions are too strict, or the language doesn't encapsulate scope properly.

[–] red_tomato@lemmy.world 9 points 1 month ago* (last edited 1 month ago) (9 children)

Outside of the for loop counters i and j, short variable names are awful.

I’ve started to prefer writing it out as ”index” or ”iteration” even in for loop counters. It’s easier to read, and not much harder to type.

[–] silasmariner@programming.dev 5 points 1 month ago (4 children)

idx is the ideal name for an index, change my mind

[–] sukhmel@programming.dev 8 points 1 month ago (1 children)

Yh, y cn sv a lt f spc wtht ths unncssr vwls

[–] silasmariner@programming.dev 3 points 1 month ago* (last edited 1 month ago) (2 children)

I is a vowel too but you sure can!

Edit: also I noticed you dropped one 'y' but not the others. Is this an accident or some subtlety to do with y's 'semi-vowel' status? To be discussed.

[–] luciferofastora@feddit.org 3 points 1 month ago

t's prbbl t kp wrds rcgnzbl. Hw ls wld knw wht h s sppsd t b?

[–] sukhmel@programming.dev 2 points 1 month ago

I had to leave most of first letters, and sometimes if all vowels are removed there's nothing left

But yeah, we need a committee and come up with a standard for that

load more comments (2 replies)
load more comments (6 replies)
load more comments (7 replies)