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.
In reply to Re: Idioms considered harmful
by jmcnamara
in thread Idioms considered harmful
by rinceWind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |