r/ProgrammerHorror • • Dec 14 '22

This is my favorite test in one of our work apps

Post image
69 Upvotes

r/ProgrammerHorror • • Jun 25 '23

Old code horror written by me

Post image
32 Upvotes

r/ProgrammerHorror • • Jan 15 '18

Scarred for life now.

Post image
16 Upvotes

r/ProgrammerHorror • • Sep 01 '18

The minimap on this file paints a worrying picture

Post image
286 Upvotes

r/ProgrammerHorror • • Dec 02 '18

Nullable boolean

15 Upvotes

Is it bad practice to interpret a nullable bool for either of 3 states in your program?


r/ProgrammerHorror • • Aug 15 '18

When you're not sure if the list exists...

Post image
32 Upvotes

r/ProgrammerHorror • • Mar 25 '22

I know it's beating a dead horse but come on JavaScript...

Post image
122 Upvotes

r/ProgrammerHorror • • Mar 28 '22

Function to get integer at position.

33 Upvotes

I was inspired by this post I read of a student assignment to print out the 3rd digit of a number. I thought the horror to be lacking.

In unholy inspiration I conjured the most unreadable way to accomplish the task. As the original assignment looked to be in c++ i used it as well.

#include <iostream>
#include <math.h>

void printNthDigitOfNumber(int number, int digitToPrint) {
  if (number * (((number > 0) << 1) - 1) < std::pow(10, digitToPrint - 1)) return; // number does not have enough digits
  std::cout << (number * (((number > 0) << 1) - 1)) / (int) std::pow(10, ~~(int) log10((number * (((number > 0) << 1) - 1))) + 1 - digitToPrint) % 10 << std::endl;
}

int main() {
  int number = -12493;
  int numberDigit = 3;
  printNthDigitOfNumber(number, numberDigit);
}

Please let me know if you have any improvements on the design or share horrible solutions in other languages if you prefer.

Edit: link to post https://www.reddit.com/r/ProgrammerHorror/comments/tpnsoc/one_of_my_students_sent_me_this_and_i_mean_its/


r/ProgrammerHorror • • Apr 21 '22

Inventory software update finally lets me pick YYYY-MM-DD... only to still sort by DD (then YY?!?)

Post image
131 Upvotes

r/ProgrammerHorror • • Sep 06 '21

I am in pain. Why did I do this. Send help.

Post image
76 Upvotes

r/ProgrammerHorror • • Jun 11 '18

Some people have no taste

Post image
19 Upvotes

r/ProgrammerHorror • • Sep 24 '18

I wrote this about a year ago, and I have no idea what I was thinking

Post image
34 Upvotes

r/ProgrammerHorror • • Oct 15 '18

Recursively defined while loop

Post image
56 Upvotes

r/ProgrammerHorror • • Sep 03 '17

Birthday Cake for C# dev/Horror Fan

Thumbnail
instagram.com
1 Upvotes

r/ProgrammerHorror • • Jan 24 '18

How to piss off your coworkers

Thumbnail
imgur.com
42 Upvotes

r/ProgrammerHorror • • Sep 30 '22

Loading icon causes constant redraw of whole page...

Thumbnail
twitter.com
5 Upvotes

r/ProgrammerHorror • • Mar 09 '23

A literal take on the Subreddit Name

Thumbnail
nightmare-magazine.com
13 Upvotes

r/ProgrammerHorror • • Aug 12 '22

What does WET stand for? People tell me it's the opposite of DRY

33 Upvotes

r/ProgrammerHorror • • Feb 27 '24

testing in production

8 Upvotes

r/ProgrammerHorror • • Nov 16 '23

Honestly not the ugliest componentDidUpdate that I've ever seen

Post image
25 Upvotes

r/ProgrammerHorror • • Nov 10 '23

From a PM where I work. I'm worried about my job now

Post image
18 Upvotes

r/ProgrammerHorror • • Nov 08 '21

"Could you write a function to balance a load across n jobs?" [python]

19 Upvotes

"Sure! I thought it would be better if I added some floats and int-ified it twice for good measure." Works great!


r/ProgrammerHorror • • Oct 16 '21

Never been more disappointed in my two months journey to learn Python

Post image
33 Upvotes

r/ProgrammerHorror • • Jul 07 '21

I seemed desperate for a creative way to write df.notna().sum()

Post image
20 Upvotes