this post was submitted on 25 Nov 2025
340 points (99.4% liked)

Programmer Humor

27534 readers
134 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
 

I'll give an example. At my previous company there was a program where you basically select a start date, select an end date, select the system and press a button and it reaches out to a database and pulls all the data following that matches those parameters. The horrors of this were 1. The queries were hard coded.

  1. They were stored in a configuration file, in xml format.

  2. The queries were not 1 entry. It was 4, a start, the part between start date and end date, the part between end date and system and then the end part. All of these were then concatenated in the program intermixed with variables.

  3. This was then sent to the server as pure sql, no orm.

  4. Here's my favorite part. You obviously don't want anyone modifying the configuration file so they encrypted it. Now I know what you're thinking at some point you probably will need to modify or add to the configuration so you store an unencrypted version in a secure location. Nope! The program had the ability to encrypt and decrypt but there were no visible buttons to access those functions. The program was written in winforms. You had to open the program in visual studio, manually expand the size of the window(locked size in regular use) and that shows the buttons. Now run the program in debug. Press the decrypt button. DO NOT EXIT THE PROGRAM! Edit the file in a text editor. Save file. Press the encrypt button. Copy the encrypted file to any other location on your computer. Close the program. Manually email the encrypted file to anybody using the file.

(page 4) 50 comments
sorted by: hot top controversial new old
[–] dimeslime@lemmy.ca 8 points 4 days ago (4 children)

My current favorite is in ruby with the unless keyword:

tax = 0.00
unless not_taxed(billing)
  tax = billing.zipcode.blank? ? estimated_tax_from_ip(account) : billing.tax
  tax = (tax.nil? ? 0.00 : tax)
end

To me, anything payments related you want to be really super clear as to what you're doing because the consequences of getting it wrong are your income. Instead we have this abomination of a double negative, several turnaries, and no comments.

load more comments (4 replies)
[–] Bazell@lemmy.zip 2 points 3 days ago

Sounds like a motel horror story.

[–] medem@lemmy.wtf 8 points 4 days ago (1 children)

A (poorly written) Shell check if the process was able to write to the production database which in some, not all, cases threw the gem:

!!!!!!!! SQL ERROR !!!!!!!!!

load more comments (1 replies)
[–] MoonRaven@feddit.nl 6 points 4 days ago

A page that handled call requests. It was a table showing some information about the person, the case it's related to and some other fields. It fetched everything from any table it touched. So the call was fetching all the information about the person. The case it was related to. The person who was assigned to the case, and since the case was linked a couple of layers in, all of that data as well.

I created a simple view that only fetched the data it needed. It went from over A GIGABYTE of data to less than 25mb of data of transfer to the web ui.

[–] shnizmuffin@lemmy.inbutts.lol 7 points 4 days ago (1 children)
[–] vrek@programming.dev 11 points 4 days ago

The worst programmer I ever seen was myself six months ago...Hopefully will be true in another 6 months too

[–] altphoto@lemmy.today 5 points 4 days ago

All about PTC's God awful piece of shit PLM/PDM systems IntraLink and PDMlink. I cannot believe the amount of trash code that company uses. And they get paid millions to basically screw the customers over. The costumer's CAD gets intertwined in a huge heap of automated HTML garbage. This leads to a total disaster.

[–] potatoguy@lemmy.eco.br 6 points 4 days ago* (last edited 4 days ago) (1 children)

it wasn't funny in any way, but J~~SHIT~~BOSS "microservice" (it was a jboss service with one microservice inside, in a kubernetes pod, with only one core, tell me about redundancy). Service classes with over 2000 lines of code, it shouldn't even be called spaghetti code, more like lasagna code, the pasta came in layers, separation of concerns was a mere suggestion, code was not thread safe (and it needed to be), but there was only 40 Ejbs for each "stateless" service inside de EAR, so number go up, code goes better.

I refactored it, it's now in the glorious quarkus 3.27, on virtual threads and java 21, not hyperbole, but 5x more throughput and you don't need 7 phds in italian cousine.

Edit: I also saw, in Angular, the infamous:

if (variable === true || variable === 'true' || variable === "true") {

[–] vrek@programming.dev 6 points 4 days ago (1 children)

Why does it seem like Java is always the language with the worst code?

I mostly do local programs with c# or python so alot of your comment didn't make sense to me like quarks and ejbs but yeah it sounds horrible.

[–] potatoguy@lemmy.eco.br 10 points 4 days ago (4 children)

The most used language has the most of the worst code, quarkus is a new framework (and very good), ejbs are enterprise java beans (the worst thing ever made).

I think a lot of the code was written by a lot of people in a rush, very backend of the backend, but EXTREMELY needed. Java is hated (I hate it too), but the new things in it? It's amazing too (I only love the new stuff).

load more comments (4 replies)
load more comments
view more: ‹ prev next ›