I have a feeling that this will depend on whether you program C# or VB, but...
I'm sure most C# programmers have noticed that C#'s for syntax is a bit more involved that that of VB. If a new, more VBish loop structure was introduced, which of the following would you prefer, and why? I'd appreciate other suggestions, too, but understand that the basic idea is to compliment VB's simple "For blah = blah To blah" syntax.
And just in case anyone really wants to know why I'm asking, I am working on a command interpreter, and for immediate execution, small and simple goes a long way.
I'm sure most C# programmers have noticed that C#'s for syntax is a bit more involved that that of VB. If a new, more VBish loop structure was introduced, which of the following would you prefer, and why? I'd appreciate other suggestions, too, but understand that the basic idea is to compliment VB's simple "For blah = blah To blah" syntax.
Code:
loop(controlVariable, start, lastValueIterated){}
[COLOR=DarkGreen]//Compare[/COLOR]
loop(i, 5, 10) {}
for(int i = 5; [COLOR=Red][B]i <= 10[/B][/COLOR]; i++) {}
[COLOR=Blue]5, 6, 7, 8, 9, 10[/COLOR]
Code:
loop(controlVariable, start, terminatingValue){}
[COLOR=DarkGreen]//Compare[/COLOR]
loop(i, 5, 10) {}
for(int i = 5; [COLOR=Red][B]i < 10[/B][/COLOR]; i++) {}
[COLOR=Blue]5, 6, 7, 8, 9[/COLOR]
Code:
loop(controlVariable, start, iterationCount){}
[COLOR=DarkGreen]//Compare[/COLOR]
loop(i, 5, 10) {}
for(int i = 5; [COLOR=Red][B]i < 5 + 10[/B][/COLOR]; i++) {}
[COLOR=Blue]5, 6, 7, 8, 9, 10, 11, 12, 13, 14[/COLOR]
And just in case anyone really wants to know why I'm asking, I am working on a command interpreter, and for immediate execution, small and simple goes a long way.