49
you are viewing a single comment's thread
view the rest of the comments
[-] Buttons@programming.dev 8 points 2 years ago

I've actually seen this type of code produced by a human-being who was trying to write good code. It was one of the students in my introduction to programming class in university, we had to write a function that squared a number or something, and he had written hundreds of lines of if-statements. Sometimes you just use what you know to complete an assignment I guess 🤷

[-] msage@programming.dev 5 points 2 years ago

Though I want to add this case for interview questions: "Write code that outputs every prime number smaller than 10."

And if the candidate doesn't do 'print "2,3,5,7";', I will deduct points.

[-] sisyphean@programming.dev 2 points 2 years ago

Wow… did he not know about the multiplication operator?

[-] Buttons@programming.dev 6 points 2 years ago* (last edited 2 years ago)

Apparently not. It was very strange. Although it was the first few days of class and he might not have realized * is multiplication, because when does a non-programmer ever use * for multiplication?

[-] bufordt@sh.itjust.works 1 points 1 year ago

I did something similar for a programming competition once because I couldn't remember the c64 basic function to return string length.

Once I got home I rewrote it properly because it bugged me so badly. LEN(string variable) was the command. Stupid!

this post was submitted on 13 Jun 2023
49 points (96.2% liked)

Programmer Humor

19817 readers
59 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 2 years ago
MODERATORS