??? 01/18/05 21:17 Read: times |
#85242 - Good but... Responding to: ???'s previous message |
Bartosz Wucke said:
/usr/src/Linux/Documentation/CodingStyle
if the function is so complex that you need to separately comment parts of it, you should probably go back to chapter 5 for a while. [Functions should be short and sweet, and do just one thing (...) and do it well.] From most of the code I've seen in Linux and similar open-source programs, it looks like this rule is being ignored. :) You should look at some of the routines in Sendmail. Ouch! I'm also not sure if I agree that you shouldn't explain how your code works. Simple, straight-forward, easy-to-understand code is often inefficient. The same function can often be accomplished in tight, hard-to-understand code that is much more efficient. This happens a lot in Linux; it almost seems like a contest who can formulate the most efficient code. But readability is lost. It's not that the code is bad, it's just not readable in the interest of efficiency. If the code isn't readable, the "how" of how it work should be explained in comments. In my opinion, of course. Regards, Craig Steiner |