4 ms·
> When I have a question about some functionality, I try to read the code before asking the original developers for help. If I were the author of such a piece,
by Tade0 5y ago
> When I have a question about some functionality, I try to read the code before asking the original developers for help.
If I were the author of such a piece, I would appreciate if you asked first.
First and foremost because it's faster that way. Second, should an implementation have bugs which still produce an ostensibly correct result, you won't catch them unless you know the intent behind that piece of code. Reading alone is not guaranteed to provide enough context.
This is part of the reason why legacy code is so hard to maintain - over a certain point it's hard to tell whether something was put there by accident, or is there a profound reason for it being that way.
Bottom line is: you can't assume that what you read is perfectly correct, so it's more valuable to understand the underlying intent rather than the inner workings of something.
- yjftsjthsd-h 5y ago> First and foremost because it's faster that way. That seems unlikely to scale, and all but guaranteed to age poorly. (The original developers will not always be available; eventually, they'll be busy or no longer with the company) > Reading alone is not guaranteed to provide enough context. That's what comments are for.
- Jensson 5y ago> First and foremost because it's faster that way No it is often not faster, most developers don't remember what they wrote or why they wrote it for code they wrote a while ago. They would have to read the code themselves and get up to speed again to understand it and then come up with a good explanation for you, and once you involve two persons trying to understand one problem it often takes more person time than before. And since you just found an issue related to that piece of code, chances are you actually got better context than the other developer, and getting him up to speed about the issue would take most of the time.