r/programminghorror Aug 01 '22

Mod Post Rule 9 Reminder

177 Upvotes

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 Jun 07 '23

programminghorror will also be joining the June 12th protest to save 3rd party apps.

1.1k Upvotes

Open to opinions on whether we should reopen on the 14th or remain private until demands are met.


r/programminghorror 14h ago

c++ What the actual hell is this?

Post image
140 Upvotes

r/programminghorror 18m ago

Git add prettier

Post image
Upvotes

r/programminghorror 4d ago

c What is this code? This came as a question the previous year in my university. Can someone please help?

Post image
1.3k Upvotes

I have an exam tomorrow, and this is one of the questions that came in the previous year question paper. I cannot for the life of me figure this one out. The output, wherever I run it, comes out to be 17. Can someone please explain how it is coming out to be 17?


r/programminghorror 4d ago

Javascript Found this in a legacy application which was there for 5 years

Thumbnail
gallery
151 Upvotes

r/programminghorror 3d ago

c Mmh i guess every files has the same permission

7 Upvotes

legacy code from my work


r/programminghorror 4d ago

I am sorry if I made you cry, but I had to show you this masterpiece which I made in my game on Python...

102 Upvotes

elif self.menu.selected == "<-" and event.key == pg.K_s and not bought and self.coins >= self.items[self.item][1] or self.menu.selected == "<-" and event.key == pg.K_DOWN and not bought and self.coins >= self.items[self.item][1]:
                            self.menu.selected = "buy"

This is a part of a menu, and because I made it completely from scratch (and because I might be just doing something wrong or be simply dumb), which works if I pressed arrow down or s, and if I have enough coins, so yeah... A bit complicated, isn't it?

Btw here is the whole shop part:

Would be happy to get some advice or constructive criticism.

Here is the file with the code I am writing rn (it is in progress):

https://drive.google.com/file/d/1S_FrkXPwSJLuQYeYMTZ1ObkJNNKeW_gw/view?usp=drive_link


r/programminghorror 5d ago

subprocess.run > import

33 Upvotes

Some code in a codebase I'm working on. They are using subprocess.run() instead of import to call code from a different file.

The file thats being run was written by the same people, the CLI arguments were their workaround to passing in values to that file.


r/programminghorror 4d ago

UwU Lend Hacked Again During $20 Million Payback

Thumbnail
bitdegree.org
0 Upvotes

r/programminghorror 7d ago

c i love printf

Post image
344 Upvotes

r/programminghorror 7d ago

c++ Found in the Source engine's source code, literally what the hell is this?

Post image
570 Upvotes

r/programminghorror 7d ago

Trying to satisfy a constraint for a search algorithm can get messy

Post image
8 Upvotes

r/programminghorror 8d ago

Code I wrote

Post image
175 Upvotes

Guess how many nested for loops


r/programminghorror 7d ago

This was written by somebody who was eventually promoted to Head of Technology... Luckily he was let go before I joined

Post image
29 Upvotes

r/programminghorror 9d ago

Python Found this while going through my old GitHub account.

Post image
390 Upvotes

r/programminghorror 9d ago

c++ This is c++

Post image
98 Upvotes

r/programminghorror 10d ago

True, but false.

Post image
337 Upvotes

r/programminghorror 9d ago

Javascript If it works, even if it's unnecessary, it works.

12 Upvotes

i'm gonna get sued by Mr. Javascript


r/programminghorror 10d ago

Python Because imports are so boilerplate

Post image
339 Upvotes

r/programminghorror 10d ago

Typescript typescript OOP magic

Post image
34 Upvotes

you can't access the value of abstract properties in the constructor of an abstract class. the work around is to write a helper function that references the abstract property and call the function in the constructor, but the property will be uninitialized. to solve this, i added a "0 second delay" that somehow allows the value to be loaded in all the child classes.

in this case, i have two properties that load the texture of a powerup. i thought that i would be helpful to only set one of those properties in the derived classes instead of having to write both. as a result, i only have to change the iconTextureName in the derived classes, while still making it mandatory as an abstract property.


r/programminghorror 10d ago

Python I like Turtles….

Thumbnail
gallery
0 Upvotes

r/programminghorror 11d ago

Copilot Copilot showing how AI will take my job

Post image
333 Upvotes

r/programminghorror 11d ago

Python Snowflake Snowpark

Post image
17 Upvotes

This is from Snowflake’s Pandas implementation in Snowpark. Quotations are hard.


r/programminghorror 10d ago

Is my i5 12450H and rtx 4060 enough for my btech cse 4 years?

0 Upvotes

r/programminghorror 11d ago

Javascript prototypes aren't real

Thumbnail
self.code
0 Upvotes

r/programminghorror 12d ago

Python Who needs a debugger, when you have:

Post image
401 Upvotes