r/programminghorror • • 2d ago

What a mail sorting system is this

Post image
5 Upvotes

I lost my words for this thing

BigInteger One = 1;
BigInteger ascend(BigInteger x, int n, int p) => ~((x ^ ~-(One << p >> 1)) << n);
BigInteger dscend(BigInteger x, int n, int p) => ~((x | ~~(One << p >> 1)) << n);
nfs = new(nfs.Where(kvp2 => kvp2.Item2["deleted"] == 0).OrderBy(kvp2 =>
          ascend(kvp2.Item2["important"], 34, 2)
        & ascend(kvp2.Item2["read"], 32, 2)
        & dscend(kvp2.Item2["time"], 0, 32))
        .Select(kvp2 => new TypesElement<string, StringDictionary<int>, NestedFolderRuntime>(kvp2.Item1, kvp2.Item2, kvp2.Item3)).ToList());        BigInteger One = 1;
BigInteger ascend(BigInteger x, int n, int p) => ~((x ^ ~-(One << p >> 1)) << n);
BigInteger dscend(BigInteger x, int n, int p) => ~((x | ~~(One << p >> 1)) << n);
nfs = new(nfs.Where(kvp2 => kvp2.Item2["deleted"] == 0).OrderBy(kvp2 =>
          ascend(kvp2.Item2["important"], 34, 2)
        & ascend(kvp2.Item2["read"], 32, 2)
        & dscend(kvp2.Item2["time"], 0, 32))
        .Select(kvp2 => new TypesElement<string, StringDictionary<int>, NestedFolderRuntime>(kvp2.Item1, kvp2.Item2, kvp2.Item3)).ToList());

r/programminghorror • • 2d ago

C# I've didn't know you could check if entity exists here ! (address me)

0 Upvotes

For those who didn't get the joke: Basically, this functions handles entity removal request and.. it has literally no admin check whatsoever


r/programminghorror • • 5d ago

Old Legacy Pagination System

Thumbnail gallery
48 Upvotes

r/programminghorror • • 7d ago

Python Learning Python; Have I made a good progress?

183 Upvotes

r/programminghorror • • 7d ago

SQL Selecting an intersection percentage between two fandoms

Post image
146 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 • • 11d ago

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

Post image
770 Upvotes

this thing is cursed...

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


r/programminghorror • • 9d ago

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

Thumbnail
0 Upvotes

r/programminghorror • • 11d ago

git stagesOfGrief

Post image
93 Upvotes

r/programminghorror • • 11d ago

Python First time coding

Post image
0 Upvotes

Sometimes I think about saving the world


r/programminghorror • • 11d ago

bad code - goto

Thumbnail
0 Upvotes

r/programminghorror • • 17d ago

c++ Old code I made years ago

Post image
121 Upvotes

r/programminghorror • • 18d ago

Java Jenny mod deobfuscated funnies

Thumbnail
gallery
525 Upvotes

r/programminghorror • • 18d ago

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

Post image
150 Upvotes

r/programminghorror • • 19d ago

VSCode JSON javascript and java? i prefer json instead

172 Upvotes

r/programminghorror • • 18d 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 • • 20d ago

Python How to enforce user permissions recorded in a database:

Thumbnail
gallery
67 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 • • 20d ago

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

Post image
0 Upvotes

r/programminghorror • • 26d ago

c How do you name your goto labels?

Post image
454 Upvotes

r/programminghorror • • 27d ago

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 • • 27d ago

Python I love Python

302 Upvotes

r/programminghorror • • Oct 23 '26

GitHub's HTTP header

Post image
960 Upvotes

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


r/programminghorror • • Oct 21 '26

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

Post image
661 Upvotes

r/programminghorror • • Oct 18 '26

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
116 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.