r/shittyprogramming • • Dec 05 '14

Recursion 101

Post image
316 Upvotes

73 comments sorted by

View all comments

13

u/NotSteve_ Dec 05 '14

What was he even trying to do

27

u/justabaguette Dec 05 '14

The answer to the question pretty much sums it up, but essentially the assignment asked to extend a class that had red, green, and blue values associated with it. Obviously this method was supposed to just set those variables, but I guess the student got confused after the lecture about recursion and somehow thought this made sense. To add to the humor, it was a really simple assignment (pretty much writing a bunch of simple methods like this) and this question was asked 3 days after the due date.