D
David Steuber
Gerry Quinn said:I don't find that. Succinct, perhaps, but I see no special merit in
terseness. Surely the ease of recognition of common patterns and idioms
is far more important?
If the code fits into a common idiom or pattern, it would probably be
easiest to just have a name for it. The "anamorphic if" pattern would
be a simple case where the pattern can be expressed more easily by a
name than with code structure.
Of course, every language has common idioms. In C, I would expect to
see:
i++;
rather than:
i = i + 1;
And I would expect to see if(;{...} for infinite loops rather than
while(1){...}.
I speak as one who has of late taken to scoping off any part of a
function that has variables local to that part, with a pair of curly
brackets that have a line each. (Dividing functions into 'mini-
functions' that can be refactored as necessary, if you like.)
Maybe I've just got a bigger screen. (Or maybe it's because using a
mouse it's easier to scroll?
This is something I see a lot of in Lisp. Throw in the refactoring,
and vertical space is conserved.
Fortunately, this Lisp advantage has been incorporated into all
languages since Fortran, by way of the underscore '_' character. The
new 'camelCase' technology has also helped with giving comprehensible
names to symbols. (Of course it only works when case is significant...)
I've never liked the underscore '_' character because I have to hold
down the SHIFT key to type it. This is not so with the hyphen '-'
character. In C, I tend to use 'camelCase' to avoid the underscore.
I would prefer camel-case. C doesn't let me do the latter because of
the way the tokenizer works.
I'm also no longer convinced that case sensitivity is a good thing for
program tokens.