That's a good example. In VB you have one symbol to remember, while in C#
you have two.
Normal people know what = means.
Then in C# it's just one more thing you have to learn that's not very
intuitive for most people: the difference between = and ==.
Sure it's not hard to learn, but it's just one more step in having to
geekify yourself. You have to think like a computer, instead of the other
way around.
In VB there is one easily recognizable (=) symbol and you just have to think
about whether you're giving a command to the computer or asking a question
of it. And of course normally you'd have an IF statement in there somewhere
when you're asking a question.
There is plenty of confusing syntax in C#. For instance those darn curly
braces. They are everywhere! The only thing they ever have in common is
opening and closing some kind of block of code. But which kind? If you see
a closing curly brace you've got to scroll back up to where the block
started to find out, which may or may not be easy depending on how long the
block is and how the programmer formatted the text. The only consistently
easy way is if you put a comment after the curly brace that specifies which
block of code is being closed. I see this frequently in C#.
VB is more self documenting. You know what block is closing because it
explicitly says END IF, or NEXT, or LOOP. No comment necessary, and VS.NET
formats it all very nicely and consistently for you in case you do want to
see the beginning of the code block.
And those darn semicolons! What's the point? There's a reason it's named
the "Enter" key!
Of course we're nitpicking now. I'm sure we could go back and forth about
such minor annoyances.
My main point is that you shouldn't have to learn to think like a computer
in order to get them to do useful things for you. One day we won't have to.
You'll simply tell your computer what you want it to do and it will do it.
Computers are getting more and more user friendly and "intelligen t" all the
time. Even C# is an example of this trend. VB.NET is simply a better
example of it.
--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"John Kraft" <jh*****@ilstu. edu> wrote in message
news:bh******** **@malachite.il stu.edu...
Steve C. Orr, MCSD wrote:
There's no reason to be intimidated by all the keywords in VB.NET.
Many of them are leftovers from VB6 and before. They still exist for
backward compatibility & such.
Many of them are now somewhat redundant and unnecessary - but it's nice
to have options.
You can learn those extra keywords if you want, but you don't need to
know most of them to be a good VB programmer.
You're right that C# has less keywords - but many more symbols that you
must memorize, and they can mean different things in different contexts.
Can you give some examples? I think VB is worse at this than C#. One
of the biggest problems I have in VB is determining whether a line of
code is assigning a value or doing a comparison... or more specifically,
how the compiler will treat such code.
I saw a line of code once that said something like:
var1 = (var2 = var3 + var4)
and I was confused for quite some time as to what would happen with the
code.
In C#, the = and == are quite different and a line of code like above
would be far more clear.
John