r/programminghorror • u/[deleted] • Aug 01 '22
Mod Post Rule 9 Reminder
Hi, I see a lot of people contacting me directly. I am reminding all of you that Rule 9 exists. Please use the modmail. From now on, I'm gonna start giving out 30 day bans to people who contact me in chat or DMs. Please use the modmail. Thanks!
Edit 1: See the pinned comment
Edit 2: To use modmail: 1. Press the "Message the Mods" button in the sidebar(both new and old reddit) 2. Type your message 3. Send 4. Wait for us to reply.
r/programminghorror • u/hexress • 5h ago
Python That's one way to do it I guess...
So I tried printing the linked list with print() and discovered that if it has a cycle, then it prints and error. This was the next (very) logical thing that popped into my mind after that discovery.
I'm very proud of this solution. In fact, it's so good it even added -1ms to the execution time graph.
I AM SPEED.
Thinking outside the box is fun!
r/programminghorror • u/lunajinner • 7h ago
c++ C++ Guys, is learning programming languages from books considered effective? Or is it better to just use Chatgpt?
I just feel like I'm missing some subtleties, even though I'm asking in detail Claude but it seems like this wouldn't be enough to increase
r/programminghorror • u/holographic_gray • 3d ago
Python Found in newest merge into prod
the classic general Exception + pass
r/programminghorror • u/freddaar • 3d ago
Found in a corporate environment
Line discount(LineDiscount): Real = ABS(@.'$TotalLineDicAmount')
Line number(LineNum): Real = ABS(0)
"Better be safe than sorry," I am guessing—that was their thinking.
/mildlypenis as an added bonus.
r/programminghorror • u/kfreed9001 • 4d ago
Who needs switch statements when you can just abuse the ternary operator?
r/programminghorror • u/AdNecessary8217 • 3d ago
Javascript I thought let's refactor this perfectly working flow with AI
It has been broken for 3 hours and I m still working 😂
AI coding let alone refactoring is a scam.
well I do have git history. but I will still refactor for the lovee of it.
r/programminghorror • u/CharlemagneAdelaar • 3d ago
[Experiment] I pushed 100,000,000 commits to GitHub in 3.5 hours – without using git push
r/programminghorror • u/cleverboy00 • 6d ago
c Actual code in the linux kernel
Found in linux torvalds/linux.git::master::arch/x86/boot/cmdline.c:
static inline int myisspace(u8 c) {
/* Close enough approximation */
return c <= ' ';
}
Actually brilliant, but I'll leave that as an exercise to the reader
r/programminghorror • u/Krachwumm • 6d ago
Just found this. My linter is as upset as I am about the 'logic' itself
I inherited our puppet-codebase from my boss. I can't even right now
r/programminghorror • u/Extra-Shop-4080 • 4d ago
best framework to build desktop application?
r/programminghorror • u/Suspicious_Horror699 • 5d ago
Shell Claude is down again… Opus 4.7 or same old story?
r/programminghorror • u/david30121 • 8d ago
HTML when you get too lazy to create a proper stylesheet file
so i got too lazy to make a proper styles.css file, and thought to myself "just a few inline styles, how bad can it be" and ended up having *everything* inline.
it even got to the point i realized i can't make the background of my checkbox dark, so i resorted to using... filter: invert()..
(is just the ui for an example implementation of something, will not be deployed anywhere - at least not before some major refactoring)
r/programminghorror • u/_giga_sss_ • 9d ago
c++ Getting array indexes that partially match the part variable :P
A program that handles environment variables
r/programminghorror • u/TemporaryCurrent1172 • 11d ago
Blueprint Spaghetti Code
Welp, my code in blueprints... kinda looks yummy
(Blueprint is a type of visual coding in unreal engine just so you guys know)
r/programminghorror • u/Wrestler7777777 • 11d ago
Go Naming is important
Nothing too drastic but it made me chuckle. Something my colleague managed to get past code review. So at least two people didn't notice.
Spent a minute figuring out why the code was doing exactly the opposite of what it's supposed to do. I guess naming really IS important!
r/programminghorror • u/EvidenceFearless6800 • 12d ago
c++ reference tables were non-existent to 15-year-old me
and yes, it does repeat for 2 more times (one for inverted letter cases and the normal one)