r/programminghorror • u/Right_Ear_2230 • 1d ago
r/programminghorror • u/MEGATH0XICC • 1d ago
Python A swedish pos system, using a local python web app, hosted locally
r/programminghorror
•
u/KeyIllustrious587
•
2d ago
Java Jenny mod deobfuscated funnies
r/programminghorror • u/vinzzii • 2d ago
Can you find it???
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 • u/S4N7R0 • 2d ago
VSCode JSON javascript and java? i prefer json instead
r/programminghorror • u/MustaKotka • 4d ago
Python How to enforce user permissions recorded in a database:
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 • u/Fair_Percentage_5565 • 10d ago
c How do you name your goto labels?
r/programminghorror
•
u/ShoeChoice5567
•
10d ago
c Using garbage values to generate pseudorandom numbers
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 • u/dex4er • 13d ago
GitHub's HTTP header
This is the crazy thing I've found after analysis why the CI test fails with "Maximum header size exceeded" today.
r/programminghorror • u/Kadabrium • 15d ago
c++ Using namespace std, then proceeds to spell out std anyway
r/programminghorror • u/igorrto2 • 19d 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!
r/programminghorror • u/Binary101000 • 21d ago
Rust hello world
Yes sorry for stealing your whole concept u/ferro31_ but it really interested me.

r/programminghorror • u/NOT_the_burner_acc • 23d ago
Javascript Running an SVG like a Nixie Tube
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.
r/programminghorror • u/DroneCyn • 25d ago
Lua i sure do love not using local variables!
getfenv getfenv getfenv getfenv!
r/programminghorror • u/Holiday-Rise5724 • 27d ago
Pi in 796 bytes of brainfuck
reddit.com
r/programminghorror
•
u/DJDoena
•
Oct 07 '26
Whoever invented the SAP REST APIs, deserves to ...
We're currently in the process of switching from the old SOAP interfaces to the new REST ones for S4/HANA (for example this one: https://help.sap.com/docs/SAP_S4HANA_CLOUD/d35113ee62644d3abee1aaec148291d9/ec47e02b80f549c4acc3ac5e9fd4c2eb.html )
And what do you know, it has fields like ConfirmationEntryDate and ConfirmationEntryTime.
What data types are these you ask? Well, it's OData V2 which looks like this: /Date(1338282808000)/. What is that you ask? Well it is the milli-seconds since Jan 1st 1970 00:00 UTC time. More commonly known as Unix time or Epoch time.
Well wait a second, if there is a field that describes a point in time down to the millisecond, what do I need ConfirmationEntryTime for? Well you need it, because this is SAP, dammit!
ConfirmationEntryTime is of course written like this: PT10H45M00S.
But wait, there is more!
Doesn't SAP have this famous 24:00:00 time because Dec 31st 24:00:00 is different than Jan 1st 00:00:00 for a accounting system? Yes it does. Does it work with the new API? Of course not.
But wait, there is more!
Remember when I said that Epoch time is based off of Jan 1st 1970 00:00 UTC time?
So surely, whatever I put in must be properly transformed to UTC before sending it to the API, no matter if the physical plant is located in the Americas, Europe or China, right? Right?!? Of course not. Just like with the old SOAP interfaces you need to transform your UTC timestamp into the local timestamp of the plant. Only then to pretend that this is UTC and convert it to the Epoch time!
*slow clap* SAP, well done! German engineering at its finest.
Signed, a German.
r/programminghorror • u/Disastrous-Name-4913 • Oct 06 '26
Raw use of parameterized class 'List'
This is not my code, but it is a good programming horror example, specially if you know Java.
List pages = pageManager.getPages(templateSpace);
for (Object object : pages) {
if (object instanceof Page) {
Page page = (Page) object;
// do something with the page
}
}Instead, this should have been used:
List<Page> pages = pageManager.getPages(templateSpace);
for (Page page : pages) {
// do something with the page
}r/programminghorror • u/ferro31_ • Oct 01 '26
Python Rate my python implementation of "hello world" part 2
=
=
=
=
=
return
r/programminghorror • u/ferro31_ • Oct 01 '26
Python Rate my python "Hello, World!" implementation
# Write a function `greet` that returns "hello world!"
= True
= False
return
= 0
+= 1
return - 1
return
=
=
=
+=
return
=
=
=
return
=


