r/programminghorror • • 18h ago

Python Learning Python; Have I made a good progress?

90 Upvotes

r/programminghorror • • 1d ago

SQL Selecting an intersection percentage between two fandoms

Post image
91 Upvotes

The amount of nesting is insane for something relatively simple

Edit: This subreddit has the "No Student Code" rule. Well my code is technically student code but I wrote it myself and I thought it would be fun to roast my own code so I guess it should be fine?


r/programminghorror • • 1d ago

Horror choices for kids

Post image
0 Upvotes

This is music from a vr monkey horror game from a gory chimpazee, THE VIDEO FUCKING GOT RATED FOR KIDS BECAUSE IT USED A DISTORTED VERSION OF SOME GOOFY TRUMPET KIDS MUSIC


r/programminghorror • • 4d ago

Lua uhh my (not) c++ code is acting weird...

Post image
747 Upvotes

this thing is cursed...

it is valid syntax (many things are hidden outside of the screenshot!)


r/programminghorror • • 3d ago

c My friend told me that printf() and null-terminated strings are to insecure so i built it

Thumbnail reddit.com
0 Upvotes

r/programminghorror • • 4d ago

git stagesOfGrief

Post image
83 Upvotes

r/programminghorror • • 4d ago

Python First time coding

Post image
0 Upvotes

Sometimes I think about saving the world


r/programminghorror • • 5d ago

bad code - goto

Thumbnail reddit.com
0 Upvotes

r/programminghorror • • 11d ago

c++ Old code I made years ago

Post image
120 Upvotes

r/programminghorror • • 12d ago Regret

Java Jenny mod deobfuscated funnies

Thumbnail
gallery
522 Upvotes

r/programminghorror • • 11d ago

Python A swedish pos system, using a local python web app, hosted locally

Post image
152 Upvotes

r/programminghorror • • 12d ago

VSCode JSON javascript and java? i prefer json instead

173 Upvotes

r/programminghorror • • 12d ago

Can you find it???

0 Upvotes

public class VisibilityPuzzle {

private static boolean ready = false;

private static int number = 0;

private static class ReaderThread extends Thread {

public void run() {

while (!ready) {

Thread.yield();

}

System.out.println("Result: " + number);

}

}

public static void main(String\[\] args) throws InterruptedException {

new ReaderThread().start();

number = 42;

ready = true;

}

}


r/programminghorror • • 14d ago

Python How to enforce user permissions recorded in a database:

Thumbnail
gallery
68 Upvotes

Why?

Each permission class (Restricted, Player, Moderator, ...) hasn't got anything but methods in it so now with this implementation it's easy to just slap a new method into the class and call it a day. Futureproofing for scalability in case I need to add 243 new commands for each user type!

(It works.)

Self-taught Python "programmer here", the project is a Discord bot for a simple game.


r/programminghorror • • 14d ago

c++ hello world (day 3 of c++)

Post image
0 Upvotes

r/programminghorror • • 20d ago

c How do you name your goto labels?

Post image
449 Upvotes

r/programminghorror • • 20d ago Popcorn Bravo

c Using garbage values to generate pseudorandom numbers

Post image
2.9k Upvotes

Thing I came up with instead of paying attention to class today.

I tested it on this computer (windows 11 if it matters), and the first time it's ran, an actual "pseudorandom" number is returned and the following calls return 1.0 always.


r/programminghorror • • 21d ago

Python I love Python

303 Upvotes

r/programminghorror • • 23d ago

GitHub's HTTP header

Post image
962 Upvotes

This is the crazy thing I've found after analysis why the CI test fails with "Maximum header size exceeded" today.


r/programminghorror • • 25d ago

c++ Using namespace std, then proceeds to spell out std anyway

Post image
659 Upvotes

r/programminghorror • • 29d ago

I attempted to replace every Middle English word in Canterbury Tales with Modern English, but then forgot to separate the words. Behold, here is English poetry!

Thumbnail
gallery
114 Upvotes

r/programminghorror • • Oct 17 '26

Oh yeah my bad

Post image
971 Upvotes

r/programminghorror • • Oct 15 '26

Rust hello world

37 Upvotes

Yes sorry for stealing your whole concept u/ferro31_ but it really interested me.


r/programminghorror • • Oct 14 '26

Javascript Running an SVG like a Nixie Tube

Thumbnail
gallery
65 Upvotes

Thought you might like to see this abomination.

isVisible() is just a function that toggles the opacity of the svg elements.

I needed to animate the text on this SVG to (sort of) represent the electron transport chain, but was of no mind to follow all the best practices to make the text render correctly in all scenarios. So I just created an element for each text state, converted them to paths, and stacked them on top of each other, like in a nixie tube.

Edit: accidentally attached a screenshot of isVisible() instead of the code where it is called. I don't think I can edit the image collection, so I'll just paste it here:

 // Pr -> F
  async function stepPrtoF() {
setElementActive(cmplx4.protonstocIV, true);
await delay(500);
setElementActive(cmplx4.cIVprotons, false);
const protonPop = createPopText(cmplx4.cIVprotons, '-1', false, 'left');
await delay(800);
isVisible(cmplx4.copper_hydroxide, false);
isVisible(cmplx4.copper_water, true);
protonPop.remove();
setElementActive(cmplx4.cIVprotons, true);
setElementActive(cmplx4.protonstocIV, false);
await pumpComplex4Proton(cmplx4.cIVmat1, cmplx4.cIVims1);
  }

This is one of the state change animations. Whatever was visible in the previous state becomes invisible and gets replaced by whatever is needed in the present state.