Daniel Billingsley said:
Roy, I've never found a single comment from Jon to be unworthy of a listen,
even when I've disagreed strongly. I, like many here, value his OPINIONS on
many topics as much as you seem to value some book.
And are letting you love for Jon get in the way of the real message.
My original post was towards the style - that is "a general standard that
all strive to follow". The keyword is strive! Its not about forcing or
policing - it is about developing strong code. It is not about stiffiling
one's creativity - it's about adopting a style that server the greater good.
1) Use the FOR loop when you need to execute a set of statements a specific
number of times.
2) Use the WHILE loop when you want to execute a set of statememts while
some expression evaluates to boolean TRUE
3) Use the simple loop with a break when 1) or 2) don't fit the problem at
hand
4) Keep all exit/break statements together
This is not just C# stuff - it good coding stuff. This works with ADA, C++,
C#, VB, PL/SQL, and so on.
If you are the only programmer in the company, then ignore all of the above,
sling your code, attack with vengence all who disagree - and do what feels
good at the time. If you are a lone wolf programmer, then you are not the
subject of this rant.
If you are one of a team of a dozen or so working on a project, and
especially if you are following the X-Programming model, you'll be glad
there is a style guideline in place. Everyone doing it their own way is bad
for all. Everyone doing it one way is good for the project. If you don't
like the above guidelines, adopt you own. If they are good guidelines,
those that you adopt, publish them for all, and we will all forever be in
your debt.
It is not that developing with these guidelines holds any grand promise -
rather that developing sans any is most certainly a bad thing. And to
eschew guidelines in general because one can always think of a case where
the guidelines "just don't feel right", is arrogant, silly, and just not a
nice thing to do!
My only problem with Jon is his rejection of the generalized style (any
style, but specifically one that has been generally accepted as good). Jon
presented one case that he where felt the guideline was inappropriate - so
he tossed the entire guideline set out the window - rather than offer his
suggestions as an exception to the style, which is allowed when dealt with
accordingly.
And I didn't pick up just any book - Code Complete is a book that any/every
serious programmer should have handy -- right beside the Knuth set, and
others like Box, Richter, Prosise, Petzhold, Brown, and so on. It should be
an embarrassment for any serious programmer to not have ever heard of the
book. And when it is mentioned, I find it amazing that so many would scoff
it aside - just because "it ain't no good 'cause I ain't heard of it". And
it is not that this book necessarily in the category of GREAT book - it'll
never make it to a movie, it will never replace the Bible, it's not a book
you'd take to the beach. Code Complete is just a book, one book of many on
the subject.
And you seem to be of the mind that "all rules are made to be broken". The
prisons of the land are full of those that adopted that saying as their
mantra. You make a giant, and unwarranted leap, when you suggest that my
position is any sort of fanatic adherence to "patterns". Give Code Complete
a quick read and get back with comments. (having read the book will
certainly enhance any serious programmer's CV)
I have offered my opinions, and listened to others - but as is all too often
the case in this newsgroup, it is quickly getting personal for some - and if
history has any impact on the future, it will degrade rapidly from here.
When the masses attack based on a discourse with one of their idols, then I
am reminded of a quote (one of hundreds of) from Swift's pen, something
about when you'll know that you are really on to something good (but as few
have ever heard of Code Complete, I suspect fewer have read Swift or Toole)
regards
roy fine