this post was submitted on 28 Mar 2024
615 points (98.1% liked)

Programmer Humor

32483 readers
302 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 7 months ago (4 children)

Reminds me of an early Uni project where we had to operate on data in an array of 5 elements, but because "I didn't teach it to everyone yet" we couldn't use loops. It was going to be a tedious amount of copy-paste.

I think I got around it by making a function called "not_loop" that applied a functor argument to each element of the array in serial. Professor forgot to ban that.

[–] [email protected] 5 points 7 months ago (3 children)

but because "I didn't teach it to everyone yet" we couldn't use loops.

That is aggravating. "I didn't teach the class the proper way to do this task, so you have to use the tedious way." What is the logic behind that other than wasting everyone's time?

[–] [email protected] 1 points 7 months ago (2 children)

Teaching someone the wrong way to do something frequently makes the right way make way more sense. Someone who just copy/pasted 99 near identical if statements understands on a fundamental level when, why, and where you use a for loop much more than someone who just read in the textbook "a for loop is used to iterate elements in a collection".

[–] [email protected] 1 points 7 months ago

And if I know the right way of doing it I already understand why it's better because I want to use it in this situation. Making the students who already understand the lesson do it the wrong way is just a waste of their time.

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)