Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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


List of 36 messages in thread
TopicAuthorDate
simple serial programs examples            01/01/70 00:00      
   Hello, World            01/01/70 00:00      
      Well, yes but            01/01/70 00:00      
         very basic            01/01/70 00:00      
            My point            01/01/70 00:00      
               basic            01/01/70 00:00      
                  but...            01/01/70 00:00      
         Dear oh dear            01/01/70 00:00      
            Impossible!            01/01/70 00:00      
               Avoiding mistakes            01/01/70 00:00      
                  'C' - the sloppy programmers choice            01/01/70 00:00      
                     bloatware in Pascal, too!            01/01/70 00:00      
                        Go on then....            01/01/70 00:00      
                     Horrible C            01/01/70 00:00      
                        Horrible programmer            01/01/70 00:00      
                           If that's you...            01/01/70 00:00      
                     Author, not the language            01/01/70 00:00      
                        Caveat            01/01/70 00:00      
                        language wars            01/01/70 00:00      
                           Bloat or bugs            01/01/70 00:00      
                        singer, not the song            01/01/70 00:00      
                           verbosit/clarity            01/01/70 00:00      
                              Poor, deluded hackers...            01/01/70 00:00      
                              Commented! :-)            01/01/70 00:00      
                                 re commented            01/01/70 00:00      
                                    Comments good and evil            01/01/70 00:00      
                                    comments            01/01/70 00:00      
                                    A quote from some wise people            01/01/70 00:00      
                                       Good but...            01/01/70 00:00      
                                          why...            01/01/70 00:00      
                                             Very true            01/01/70 00:00      
                                                been there, done that            01/01/70 00:00      
                                    Correct comments :-)            01/01/70 00:00      
                                       fishing in Minnesota            01/01/70 00:00      
                                 Author, not the language            01/01/70 00:00      
                                    bounds checks, error testing, comments            01/01/70 00:00      

Back to Subject List