:
: : >
: > Or how about this:
: >
: >
: > If var1 = 1 Then
: > For Index = 0 to 10
: > If var2 = Index Then
: > DoThis
: > Else
: > Select Case var3
: > Case "A"
: > DoThisToo
: > Case "B"
: > DoThisInstead
: > End Select
: > End If
: > Next
: > End If
: >
: > compared to:
: >
: > if(var1 == 1){
: > for(Index = 0; Index < 11; Index++){
: > if(var2 == Index){
: > DoThis();
: > }else{
: > switch(var3){
: > case "A":
: > DoThisToo();
: > break;
: > case "B":
: > DoThisInstead();
: > break;
: > }
: > }
: > }
: > }
: >
: >
:
: Depends on how you write it, and personal preference/familiarity. I'm not
: sure about VB.Net 2005 ... but in 2003 you couldn't do the following with
: VB w/o inner loops:
:
: for (int i = 0, j = 1, k = 2; i < 10; i++, ++j, k++) {
: ...
: }
:
:
Sure, that may not look pretty...but there have been times, when it's
: a lot easier / cleaner to do it like this, than use 4 or 5 more lines
: (included indentation) to make the inner loops...
:
: Anywho, I'm not bashing VB.Net. Just saying that there really are fine
: points in C# as well as VB and I would recommend going with learning the
: framework while learning both languages. Once you learn one, the other is
: pretty darn easy to understand
:
: Mythran
I don't dispute any of that in the least. I prefer VB.net simply because I
come from a VB6 background, no other reason. I can work with C# and even
Java if it were to come down to it (and to be honest, your example is
foreign enough to me that I wouldn't have thought to use it - I would have
nested the loops just like I would in VB; give me enough exposure to the
language in the future and that might change).
For me, the difficulty in converting to VB.net was in learning the
framework - I was already reasonably well versed in the OOP way of doing
things and once I got a handle on the framework, I was off and running. I
saw, and I still see, no reason to be forced to abandon my current language
skills in order to advance in my career. MS was smart to accommodate the VB
programmers when it rolled out .net - I'm convinced the effort would have
been a failure if they hadn't. At the very least, it would have been much
less successful - I don't think there would have been enough Java converts
to C# by themselves to make .net viable in the long run (but then, what do I
know?).
None of the CLR languages are 'better' than the others in any absolute way
and I agree it is a good idea to have at least a basic understanding of more
than just one particular language. If I ever find myself in a C# shop, I
will embrace their efforts gladly and jump right in. I'll be somewhat at a
disadvantage at first, but that won't last as I'm a pretty quick study. I
just get annoyed when language bigots spout off about VB when they clearly
don't have a clue as to what they are talking about.
Ralf