Taking into consoderation intellisense and auto title case, you will have
....
Um. This has nothing to do with the VB.Net language, but with the version of
Microsoft Visual Studio.Net that you happen to be using. You might want to
take a look at VS.Net 2005 and update your impression.
In fact, the syntax for C# is much more compact than VB.Net. So, it might be
said that, comparing apples to apples, you type less with C#.
IsNumeric etc.
==========
You have many functions like IsNumeric, Mid etc. in VB.net which are
handy.
This also has nothing to do with the VB.Net language. These functions are in
an assembly which can be used with either language. The VS.Net IDE simply
references it automatically when creating a VB.Net project, so that people
like yourself can use what they are familiar with, without having to know
anything about it, or understand where it comes from.
Optional Parameters
=============
VB.net supports optional parameters, but C# does not support them.
Although
people might argue that you can use overloaded functions instead, these is
one catch to it. Say for example the function a hundred lines of code and
the
optional parameter is just going to be used for checking in an if
condition
(most optional parameters are used for that). In C# you have to do this by
overloading the function and in that process paste the hundred lines of
code
again. What a waste... ?
Apparently, you haven't written overloaded functions before (even though
VB.Net allows you to), or simply don't know how to do it. Consider the
following:
public static int IndexOfEnd(string source, string searchString, int
startIndex)
{
int i = source.IndexOf(searchString, startIndex);
if (i < 0) return i;
return i + searchString.Length;
}
public static int IndexOfEnd(string source, string searchString)
{
return IndexOfEnd(source, searchString, 0);
}
Note that none of the code in the first definition is duplicated in the
second. The second simply calls the first, and passes a (default) third
parameter to it.
In fact, optional parameters are an illusion. The parameters are there; they
are simply given default values when they are not explicitly declared in the
method call. The above could be defined with optional parameters in VB:
Public Function IndexOfEnd(ByVal source As String, _
ByVal searchString As String, Optional ByVal startIndex As Integer = 0)
Dim i As Integer = source.IndexOf(searchString, startIndex)
If i < 0 Then Return i
Return i + searchString.Length
End Function
The VB function actually *always* takes 3 parameters. The compiler supplies
the third if the developer leaves it out.
As to the reasoning behind the decision not to support optional parameters
in C#, see the following article:
http://blogs.msdn.com/csharpfaq/archive/2004/03/07/85556.aspx
There are some very sharp people who write in defense of VB.Net. It is a
fine .Net programming language. But this sort of argument only adds to the
widely-held impression held by many that VB is a bad language because it
fosters ignorance on the part of the developer, and leads to a large segment
of ignorant and unskilled VB developers.
Personally, I do believe that there are more VB hacks out there than C#
hacks. Until the current version of the .Net Framework and Visual
Studio.Net, this has been made possible by the lack of strictness in the
language, and Microsoft's accomodations to the VB programming community, to
make it easier for VB developers to transition to the .Net Framework. In
other words, it has been easier to write bad code in VB.Net than in C#, and
it's easier to write bad code than it is to write good code. Lazy people
tend to take the easiest path, test less, and worry about the consequences
later. This should not be taken as a sweeping generalization, or a criticism
of the language or the VB.Net community, but as a statistical theory, which
may be useful in the future development of the language.
However, in fact, there are many top-notch VB developers out there. They use
VB because they like the syntax, and either have no need for the extra
capabilities of C#, or use C# when they need to (which isn't often).
Personal preference and comfort is a perfectly valid reason for using any
language.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.