You write as though pedantry were a bad thing. This is a point of
view that I've always struggled to understand.
Merriam-Webster's Dictionary is widely cited by
Usanians. Since Mr. Heathfield seems to take "pedant"
as approbatory, perhaps this is another instance
of divergence between the dialects of Modern English.
* * * * * * * * * * * * * * * *
From Merriam Webster 10th Collegiate Dictionary;
Copied without permission:
pedant n, (1588) [MF, fr. It pedante]
1 obs : a male schoolteacher
2a : one who makes a show of knowledge
2b : one who is unimaginative or who unduly emphasizes
minutiae in the presentation or use of knowledge
2c : a formalist or precisionist in teaching
pedantic /pi-'dan-tik/ adj, adv: -ally, (ca. 1600)
1 : of, relating to, or being a pedant
2 : narrowly, stodgily, and often ostentatiously learned
3 : unimaginative, pedestrian
pedantry n, pl: -ries, (1612)
1 : pedantic presentation or application of knowledge
or learning
2 : an instance of pedantry
"Dogmatic" is another word sometimes used to describe a class
of postings:
dogma n, pl -s or -ata (1638)
[L dogmat-, dogma, fr. Gk dokein to seem]
1a : something held as an established opinion;
esp : a definite authoritative tenet
1b : a code of such tenets <pedagogical>
1c : a point of view or tenet put forth as authoritative
without adequate grounds
2 : a doctrine or body of doctrines concerning faith or
morals formally stated and authoritatively proclaimed
by a church
dogmatic also -al adj, adv -ally, n -alness (ca. 1681)
1 : characterized by or given to the use of dogmatism <a critic>
2 : of or relating to dogma (syn : see dictatorial)
* * * * * * * * * * * * * * * *
Let's work with two specific examples. I say: avoid initializers;
and avoid goto's. But I do use "unneccessary" initializers sometimes
(esp. in short functions), and there are several situations where
goto is the best option.
Recently, someone posted a program and asked for comment.
I'd pointed out earlier that initializion may be asking for
trouble, and was grateful to OP who demonstrated this so clearly:
his code initialized the same variable in *three* different places,
only one of which had any effect; I explained how this would
never have happened if OP had simply followed my dictum to
*avoid initializers*. Mr. Heathfield made no attempt to address
or acknowledge that the initializer led to trouble, instead
repeating dogmatically that initializers were not to be avoided.
On the other hand, Mr. Heathfield has written, on more than one
occasion, that there is *never* a good reason to use goto.
I myself use goto's less than some of the linux/gnu coders --
parse_param() in posix/wordexp.c has 39 goto's and five labels --
but I've presented examples of goto's which Mr. Heathfield
has never attempted to refute: he'll omit mention of goto's
for a few weeks, then pontificate again that there is *never*
a good reason to use goto.
Goto examples I've presented previously include the trivial:
for (numpile = 1; numpile <= plast; numpile++)
for (numrem = 1; numrem <= psize[plast]; numrem++)
if (WINNER)
goto move;
/* no winning move ... make a simple default move */
numpile = numrem = 1;
move:
printf("My move: %d piles and %d beans per pile.\n",
numpile, numrem);
and the more interesting goto discussed at
http://james.fabpedigree.com/gotoalt.htm
Only one programmer has ever taken the time to demonstrate
a goto-less version of the code at this webpage: his version
eliminates the goto and label by using three forever-loops,
and adding four if's, two else's, two breaks, four state-change
fragments, a duplicated initialization, and a return from
inner loop. Mr. Heathfield is welcome to submit his
own goto-free version.
Richard Heathfield: Pedantic or Dogmatic? You decide.