Michael C said:
Ok, nothing does not equal "" but vb returns true.
Well, just use 'Is' if you want a reference comparison only.
Guess why 'String.IsNullOrEmpty' has been introduced: Basically to achieve
the same behavior in programming languages which do not provide intrinsic
support for it.
I wasn't sure what you were asking about as there were 2 sentences you
asked for more details of. With the compile errors an example is that VB
does not warn when you forget to return a value from a function.
I think that the compilers cannot be compared in this regard because C# does
not support implicit initialization of local variables and implicit return
values whereas VB supports both.
Either is just as readable once you get used to it, however there's just
more typing and reading in VB.
I really wonder if you read/scan your code sequentially,
character-by-character. Personally I am not doing that. When taking a
quick look at source code I do not even "read" 'Dim' -- it's just the shape
of the keyword that indicates that the line contains a variable declaration.
By taking this approach I am faster in VB than in C-style languages, which I
have used a lot.
But how often do you really create an event for an object? I consider
myself to use them a reasonable amount but it's still not that big a part
of my day.
I often handle events. Declarative syntax simplifies that because the code
used to wire up the event handler isn't spread over multiple methods in the
code.
And now with generics most of the extra code is no longer required in C#.
I am not able to see the relation to events...
I don't find I need xml all that often.
I don't need it that often too, but there are for sure some cases in which
XML is used extensively, mostly in Web applications and applications
spitting out Office Open XML or similar XML formats.
Can you give an example of this?
When comparing nullable variables, the result of the comparison is null in
VB if either of the operands is null, which is not the case for C#, where
the result is still a Boolean value.
As you say: IMO. I have to disagree.