So far things work fine with C#, but as far as I can see, VB is much
sharper ;-), VB lets me focus on the design, while C# gets me back to
focussing on the syntax details.
Welcome to the world of "real" programming. Now, by that I don't mean that
you can't write a "real" program using VB.Net. You certainly can. However,
VB has always babied the developer (and probably always will). It hides
things that Microsoft doesn't want apprentice developers to worry their
pretty little heads about. IMHO, it does more damage by this than good. And
that, like any other opinion, is worth what you paid for it.
Of course C# is case-sensitive. The character 'a' and the character 'A' have
2 entirely different numeric values. VB.Net hides this from you by handling
case at a lower level without you having to worry your pretty little head
about it. Now, I can appreciate the fact that the C# IDE isn't as easy to
use because of this. It might be nice if you had an option in VS.Net to turn
case-sensitivity off. But C developers have developed a methodology over the
years that uses case-sensitivity to discriminate between, for example,
private and public fields and properties. Other than case, the names are the
same. So, making the IDE for C# case-insensitive would be anathema to most
C/C++ developers, and some existing code would break if compiled with this
setting.
Methods and properties need the punctuation that you specified. Here is
another case where the compiler handles things behind the scene. In fact,
there is no such thing as a Sub. A Sub is a Function that returns null. If
the Sub takes no parameters, VB.Net will happily let you omit them (the
parentheses). C# will not. Why? Because C programmers are not used to and
don't like being babied. They like to be in control, know as much about what
their app is doing as possible. They like to take responsibility for their
code.
Those "missing functions" you mentioned can all be found in the
Microsoft.VisualBasic namespace. But before you go trying to use them,
remind yourself that they are mere wrappers for other functionality in the
CLR. They were put there for the convenience of VB programmers. VB
programmers are used to using these functions. Rather than take them away,
Microsoft simply changed their back end.
As to why the editor doesn't do a whole lot of work for you, well, again,
that's the style of the developers who use the code. It's important to
remember that C (not C#) developers and VB (not VB.Net) developers come from
entirely different backgrounds. C is the lowest-level programming language
above Assembler. For this reason, it is also the most powerful and
extensible language ever developed. And for this reason, it is also the most
concise and cryptic in terms of syntax. It was written with power in mind,
not readability. To use C, one must have a fairly intimate acquaintance with
how the computer works, how memory works, how the processor works, etc. VB
on the other hand, was written for a differrent purpose. It was written both
as an instructive language for beginners, and as a quick prototyping
language. IOW, one could throw together a quick prototype in VB, and write
the actual app in some flavor of C. Somewhere along the lines, this original
purpose was forgotten or overlooked, and VB became an intensely popular
language for writing fairly simple business applications. Microsoft has been
scrambling for years to make VB as powerful as the apps it was being written
for demanded of it.
VB.Net is pretty close to the ultimate goal of making VB.Net a "real world"
programming language. But now we have 2 sets of developers, used to coding
in different ways, and used to their existing syntax. We also have projects
written in earlier native machine code that must be migrated to .Net. So,
Microsoft made VB developers feel right at home with VB.Net, and C#
developers right at home with C#.
Your only real issue is that you're not used to it. I can't tell you how
many developers I know who made the switch and would never dream of going
back to VB.
Now, for those of you (like Steve Orr) who are quite happy with VB.Net, and
are good developers as well, let me clarify that I am NOT putting VB.Net
down in any sense of the word. As I mentioned before, it is nearly as
powerful, and arguably easier to develop with than C# (at least if you don't
come from a C background). I'm just trying to put things in perspective here
with regards to history, and how we got where we're at now.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
Leo Muller said:
I always thought that moving from VB.NET to C# would be very easy. Even
though so far it hasn't been hard, there are some annoying things, that may
have to do with my visual studio settings.
- When I type "system." the intellisense doesn't comlete this, only if I
write it with a capital S, rather annoying...
- is the type "string" or "String", both get excepted, but only "string"
gets marked in blue, while all examples use "String"
- Methods need () and properties need [], and all methods need (), can't
the editor add this automatically?
- There is a whole bunch of basic functions missing, such as "Replace",
"Ctype", etc. Are these anywhere else?
- Why doesn't the editor auto indent at the end of a line?
- Why oh why can't the editor add the end ";" by itself.
- Compile errors only show after compiling. After finding errors with
compilation, these errors are marked, but when fixed, the same mark stays,
until compiled again.
So far things work fine with C#, but as far as I can see, VB is much
sharper ;-), VB lets me focus on the design, while C# gets me back to
focussing on the syntax details.
Any ideas for improving my C# environment are welcome!
Leo