in reply to Idioms considered harmful
In The C Programming Language there is a discussion on how to write a strcpy() function. After several iterations the code is reduced to the following:
The comment that follows this is enlightening:while (*s++ = *t++) ;
Although this may seem cryptic at first sight, the notational convenience is considerable, and the idiom should be mastered, because you will see it frequently in C programs.
Idioms in natural language and programming languages are just well known concise ways of saying something. Just because something is concise doesn't make it an idiom. For something to become idiomatic it must be useful enough to pass into common usage. As such it is unlikely that an idiom could be considered harmful.
I'd agree however, that Golf is best avoided in production code.
--
John.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Idioms considered harmful
by Anonymous Monk on Oct 16, 2002 at 11:02 UTC | |
by jmcnamara (Monsignor) on Oct 16, 2002 at 13:04 UTC |