Re: How do I exit a for loop in C#

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Roy Fine (rlfine_at_twt.obfuscate.net)
Date: 04/07/04


Date: Wed, 7 Apr 2004 18:36:25 -0400


"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1ade03aeb28ffc2498a603@msnews.microsoft.com...
> Roy Fine <rlfine@twt.obfuscate.net> wrote:
> > > Why are you trying to stifle reasonable discussion of whether for
loops
> > > with breaks in should always be avoided?
> >
> > 1) I am not trying to stifle
>
> Really? What other purpose does a comment such as:
>
> "if you have specific reasons for otherwise, they are specific - keep
> them to yourself"
>

You cut and past at will -- here is the entire quote -

>>keep them to yourself and don't try to inject them as a norm
>>or standard or as a general excuse for not adhering
>>to a style, esp when said style is
>>universally adopted, and well respected.

AND DONT TRY TO INJECT THEM AS NORM OR STANDARD OR AS ....

You want to adopt your way because you have found a circumstance that make
sense. That's fine, but you must accept that it is then an exception, and
then you need to adopt exception handling - i.e. comments the code to
mitigate the complexities.

If you want your style to be generally adopted, then publish them and let
them stand the test of peer review. But keep in mind that your styles are
against currently accepted styles, so the burden will be substantially
higher; you have to first show that the existing standard is bad, and then
show that yours is clearly better. That is a VERY tough process.

You want to exchange jabs based on specifics, and as you noticed, I
steadfastly refuse - to make a proof for a generalized statement based on
specific examples, there would have literally thousands of examples - and
that is not the way a proof is done here.

I would gladly review any code and help you rework it to become more
supportable, based as a style guide - you dictate the style guide, and I'll
follow the rules. It seems that you either knew nothing of McConnell's work
or a priori dislike for it. If thats the case, I can accept that.

regards
roy fine

> serve then? As soon as you start telling people to keep their opinions
> to themselves during a discussion, you're stifling debate to my mind.
>
> > 2) the discussion has not risen to the level of reasonable
>
> That's because you've refused to engage with the meat of the
> discussion, preferring to just recite the mantra of "do it because Code
> Complete tells you to".
>
> > 3) for loops with breaks in should be avoided - you want to make them
> > standard
>
> And still you present no actual *reasons* - or indeed a more readable
> while loop than my for loop.
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



Relevant Pages

  • Re: 4-20mA Analouge input
    ... Im sure there is a standard im meant to be following but im not sure ... between field sensors and process control ... electronics in the control house. ... loop voltage also 'powers' the field sensor device. ...
    (sci.electronics.design)
  • Re: Jump to multiple loop termination line
    ... The standard also "agrees" with this preference in that the practice is obsolescent in the standard. ... That place is inside the outer loop, ... (And the one compiler writer that I referred to before didn't realize it was an extension). ... I have also seen compilers that don't detect the error, but give various "strange" results from it. ...
    (comp.lang.fortran)
  • Re: 4-20mA Analouge input
    ... Im sure there is a standard im meant to be following but im not sure ... from a 24vdc power supply. ... loop voltage also 'powers' the field sensor device. ...
    (sci.electronics.design)
  • Re: Another String reversal question
    ... Note that long before the STL, it was standard practice in C to use half ... open intervals -- the standard loop over an array, for example, was: ... Applying this logic to reverse "iterators" (where iterator is used to ... the standard reverse loop was: ...
    (comp.lang.cpp)
  • Re: Hierarchical States Machines
    ... > Is there any deepter reason why you did not use: ... > end loop; ... A style guide or a RM I am not aware of? ... a while-loop, walking a list or other data structure. ...
    (comp.lang.ada)