this post was submitted on 19 Jul 2023
280 points (95.8% liked)

Programmer Humor

19512 readers
474 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

saw a 2nd year CS guy run a maze solver (for final exam) with 300 nested if-statements. worked about 50% of the time. so he added another 5000 nested ifs and got it up to 90%. good enough!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] potoo22@programming.dev 48 points 1 year ago* (last edited 1 year ago) (1 children)

In my first CS class, the professor announced an extra credit project due at the end of the semester. It was to create a formatted terminal calendar given a year from user input. I finished it after learning about condition but before I learned about classes... or functions... or loops... or searching the internet... partially. I searched how leap years worked, but didn't bother to search for code (Stack Overflow didn't exist yet)

Anyway, long ass program with each month hard-coded with 7 possible calendars for each month depending on the first day of the week. Lots of copy and paste. Professor was speechless, but accepted it.

[โ€“] ICastFist@programming.dev 10 points 1 year ago

"It's not stupid if it works"