5 ms·
I'm skeptical. How do you know what's intended behavior and what isn't if you don't know why the code is structured the way it is? Understanding what it does is
by wonderzombie 13y ago
I'm skeptical. How do you know what's intended behavior and what isn't if you don't know why the code is structured the way it is? Understanding what it does is necessary but not sufficient. You risk introducing more bugs if you don't understand why the code does what it does.
"well chosen function and variable names tell you the intention, if it's modular enough then it will all make sense when you read it."
The two hardest things in computer science are concurrency and naming things. Oh, and off-by-one errors.
- PeterisP 13y agoIf the code doesn't match what's intended, it's most likely because the original implementator misunderstood it, or didn't think of a particular edge case - and thus the comments won't reflect that as well. You look at code to determine what exactly the system does, but in order to determine what exactly the system should do, you need to look at the users needs or the business process, the code+comments can't tell you that.