Kerry Thompson wrote:
>
> In fact, Kernighan and Ritchie go through a half-dozen iterations  
> of the
> code in their book, gradually paring it down from a ~10-line  
> function to the
> one-liner I quoted. If anybody has trouble following the code, I'd  
> recommend
> you go to Kernighan and Ritchie's book, around page 105, and follow  
> their
> logic.

So K&R are still writing books? They were among my favourites when I  
learnt this kind of stuff in the 1970s.

> There used to be contests to see how complex a piece of code a C  
> coder could
> write in one statement. I can't imagine anything much sillier.  
> Contests to
> see who could write the clearest code would make much more sense.

Of course, that's sensible for the professional programming and  
maintaining of software. But for myself I've always enjoyed finding a  
shorter way to code a solution to a particular problem. It's not just  
about saving machine time and resources, which modern compilers  
rightly often save for you anyways. It's more of a personal  
satisfaction to search for the ultimate solution. Unproductive maybe,  
a waste of time. But as long as we are human, it's there.

I always write my private programs uncommented. To my experience the  
advantage of seeing as much code as possible on the screen at one  
time outweighs the benefit of any elucidation the comments would  
provide. But I'd like to see a program editor or even a simple text  
editor that's able to hide or display comment lines at a single  
keystroke. Any such in existence today? A fine exercise for some of  
you guys maybe.

LEF





To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to