re: style and idiom, one of the areas that rarely gets attention is the
importance of being able to quickly read code for understanding while
not getting distracted by different styles. Too often I see smart dev's
wasting tremendous amounts of time arguing over why they hate how
`MyCoolMethod ( 0 );` or `if (NULL == ptr)` looks rather than figuring
out how it works.

This is important in today's reality as many of us develop in multiple
languages and integrate together code from multiple disparate sources.
The dynamic and type inferrencing capabilities of languages such as
groovy, scala, c#, etc make this even more relevant.

Consider the following C samples:

/* libyaml's parser.c */
YAML_DECLARE(int)
yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event)
{
    assert(parser);     /* Non-NULL parser object is expected. */
    assert(event);      /* Non-NULL event object is expected. */
    ...

/* libgit2's oid.c */
GIT_INLINE(char) *fmt_one(char *str, unsigned int val)
{
    ...

/* libxml2's xmllint.c */
static void
xmlHTMLPrintFileContext(xmlParserInputPtr input) {
    ...
       while ((n++ < 80) && (cur > base) && (*cur != '\n') && (*cur !=
'\r'))
        cur--;

These days there's value in keeping your mental lexer/parser loose so as
to snarf through as much "others" code without setting off your code
style hate.

Jon

-- 
Posted via http://www.ruby-forum.com/.