Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Limit to #region nesting?
Message
De
13/09/2011 09:54:35
 
 
À
13/09/2011 09:24:09
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01523118
Message ID:
01523415
Vues:
34
>>>what was then called structured programming
>Actually, the structured programming ideas were pretty good.
>They were primarily aimed at COBOL so many of the ideas no longer apply.
>One of the key ideas was that unless code is reused, putting it in modules just for the sake of modularity makes the code less readable and adds no value.
>
>That's still true.
>
>XBase and languages like it made SP largely irrelevant tho,
>One of the basic tenets of SP was the elmiination of the GOTO and there IS no GOTO in XBase.
>I'm not sure about Basic tho. Did some variants keep the GOTO alive?
>
>One of the SP tenets that I see violated all the time is the notion that a module should have one entry point and one exit point.
>The elmiination of GOTO took care of the entry point, but when I see XBase and .NET code with returns sprinkled throughout the module I still shudder.
>I know that it's sometimes more efficient to have several, but it still makes sense to me that there should be only one exit point and that's how I code.

Don't forget that C# has a goto statement - either to a label or to a case statement.
goto label is useful for exiting from deeply nested loops. And the docs give an interesting example of using 'goto case' :
http://msdn.microsoft.com/en-us/library/13940fs2(v=VS.100).aspx
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform