Comment on Common Species Of CodeComments−benvds12yA CS 101 student apparently writes the most readable code.−UK-AL12yHas time to think.−marcosdumay12yIt's slower than the mathematician's, and does not handle all error cases. No wonder it looks cleaner.−dsego12yExcept it is not correct.−Apocryphon12yI like how both the student and the Startup hacker mess up bounds-checking, except the student doesn't realize it in the initial case, and the hacker misses it as the codebase gets progressively larger and he or she gets more tired.−cheapsteak12yI don't get it, what's incorrect about the code?−dsego12yTry calling the function with 0 or a negative number.−smtbsrn12yignorance is bliss
Comments
A CS 101 student apparently writes the most readable code.
Has time to think.
It's slower than the mathematician's, and does not handle all error cases. No wonder it looks cleaner.
Except it is not correct.
I like how both the student and the Startup hacker mess up bounds-checking, except the student doesn't realize it in the initial case, and the hacker misses it as the codebase gets progressively larger and he or she gets more tired.
I don't get it, what's incorrect about the code?
Try calling the function with 0 or a negative number.
ignorance is bliss