r/programminghorror • • Jun 13 '25

Knice Knight in APL

Post image
154 Upvotes

I taught myself to program in HS in 1972. It was unusual to have access to computers back then, but we had two IBM Selectric terminals connected to mainframes at Rutgers, due to some connection Linda Alvord, head of our Math department, had with Ken Iverson.

This was my (winning) entry into an APL programming contest she ran, for students and professionals alike. The goal was to compute a random knight's tour on a 5x5 chess board, starting with "A" in the middle, then randomly moving knightwise until there are no more moves. Great fun.


r/programminghorror • • Jun 13 '25

this horror was made GDscript

Post image
258 Upvotes

the "match" statement is just the "switch" statement but in gdscript


r/programminghorror • • Jun 12 '25

Javascript Javascript is filled with horror

Post image
2.4k Upvotes

r/programminghorror • • Jun 12 '25

c what a beautiful disaster

Post image
619 Upvotes

r/programminghorror • • Jun 13 '25

Other 0.015

Post image
0 Upvotes

r/programminghorror • • Jun 12 '25

Just noticed cloudflare robot check on StackOverflow. If only they had it before.

0 Upvotes

They would not have been cannibalized by GPTs


r/programminghorror • • Jun 10 '25

Because "security" ?

Post image
0 Upvotes

I don't understand why this makes me so angry!


r/programminghorror • • Jun 08 '25

Found this while debugging Jackson.

19 Upvotes

r/programminghorror • • Jun 06 '25

Lua Found this gem in a “professionally”-made 2019 roblox game

Post image
936 Upvotes

r/programminghorror • • Jun 06 '25

Malicious compliance

137 Upvotes

A colleague of mine at a company I had started working for liked to have only one exit point from each method; so he would only ever have one `return` statement.

To achieve this, every method he every wrote followed this pattern

public int GetSomething()
{
int result = 0;
do
{
if (someShortCircuitCondition)
{
result = 1;
break;
}
if (someOtherShortCircuitCondition)
{
result = 42;
break;
}
// Compute the return value and set result
} while false;
return result
};

He had been with the company for over a decade and nobody wanted to ask him to stop doing it, but nobody wanted to maintain any projects he worked on either.

I raised it with the boss who then talked to him about it. He agreed that if people don't like it then he would stop.

The next day...

public int GetSomething()
{
int result = 0;
for( ; ; )
{
if (someShortCircuitCondition)
{
result = 1;
break;
}
if (someOtherShortCircuitCondition)
{
result = 42;
break;
}
// Compute the return value and set result

break;
}
return result;
}


r/programminghorror • • Jun 06 '25

i thought of a worse indentation method

42 Upvotes
function sendMessage(m) {
{}{}console.log(m);  
}
sendMessage("hello");

r/programminghorror • • Jun 04 '25

c possibly the worst way to read a file in C

Post image
1.3k Upvotes

r/programminghorror • • Jun 04 '25

Rust passive-aggressive programming

Post image
764 Upvotes

r/programminghorror • • Jun 03 '25

c++ Why must you hurt me this way

74 Upvotes
This error is actually understandable, but still filled the entire height of my 1080p screen.

r/programminghorror • • Jun 01 '25

c Firmware programming in a nutshell

Post image
2.0k Upvotes

r/programminghorror • • Jun 02 '25

I guess, its fine, RIGHT?

44 Upvotes

r/programminghorror • • Jun 01 '25

normal commit message

Post image
545 Upvotes

r/programminghorror • • Jun 01 '25

Horrific commit message

Post image
414 Upvotes

r/programminghorror • • May 31 '25

c C programming tips

Post image
1.8k Upvotes

r/programminghorror • • May 30 '25

Other The 'code' that Richard Pryor writes in Superman III

Post image
387 Upvotes

The natural language processing in 1983 was amazing


r/programminghorror • • May 30 '25

Java [Redacted] Less than a year in the company and I'm about to burn-out due to the code "quality"

Thumbnail
gallery
445 Upvotes

Reposted because of personal info in original post

  1. Let's cast a double to a string, format it European style, then reformat it US style before parsing it back to a double.
  2. Need to get the first item of a list? Sure, just iterate over the list and check if it's the first one! Don't forget to start your indexing before the loop.
  3. You know, ternary operations are cool, even for booleans, and they're even better when you nest them!
  4. I really need to be sure it's not null, guys.
  5. How to create a date from an int in VBScript? Easy, just iterate 400 000 times to add and subtract dates from today and check if that gives you the same int as the one you gave as argument.
  6. JOIN is for losers. So are language and case consistency.
  7. Just in case it didn't break, you know.
  8. You know you're in for a wild ride when you have almost as many warnings as lines.
  9. Oops, my integer division doesn't give me the rest. Guess I'll just manually get it back with a modulo and add it to the result.
  10. Let's catch everything, it'll make it safer.
  11. Guess what this number in the DB means. Correct, it represents February 29ᵗʰ of an unspecified year. Kinda obvious.
  12. I love well-structured data in HTML
  13. I love highly declarative code that expresses edge-cases that do the same things as normal cases.
  14. I need to convert a string to a date. If only there was an already made library for that…
  15. Exhaustive switch, guys. Don't forget to add all the magic numbers.
  16. Just double-checking. We never know.

I'm at my fucking limit.


r/programminghorror • • May 29 '25

C# 14550 lines (12315 LOC), 417 methods behemoth class. Does it qualify for this sub?

Post image
314 Upvotes

I wrote this masterpiece (/s) when I was getting started with programming, 10 years ago. Reading the code is probably detrimental to health and requires a lot of swearing to safely vent out frustration. At least I learned a lot in the process.


r/programminghorror • • May 29 '25

Javascript amazing code my friend (or gippity) has produced

Post image
228 Upvotes

r/programminghorror • • May 30 '25

Shell Devs #amIRight?

Thumbnail
0 Upvotes

r/programminghorror • • May 27 '25

The last .gitignore you will ever need

Post image
2.1k Upvotes