Yeah, if there was some kind of
>
Option JustLikeCSharp On
I actually started a thread on this a long time ago when I realized
the following difference between C# and VB.Net
//////////////
public int MyIntProperty {
get {
}
}
//////////////
Will throw the "not all code path's return a value" exception, while
it's VB equivalent:
//////////////
Public ReadOnly Property MyIntegerProperty() As Integer
Get
End Get
End Property
//////////////
Will not give any notification of a problem, it will happily return 0
(or the default value for other Value types) at runtime, often to your
program's doom. It can also be a pain to debug and fix - especially if
the missing return is in a deeply nested if or other nasty structure.
But after 100 times of correcting other developers (the worst I saw is when
we turned it "on" at the project level, this one developer's code generated
over 200 errors)......
you get worn down.
lol - I bet
I code 95% in csharp now, only maintenance in vb.net....and those kind of
situations just don't happen.
I still love to program in Visual Basic (especially for Office
interop) but I do lean towards C# for quit a few projects. If nothing
else I at least like staying sharp (pun intended) when it comes to VB.
It's just a shame that VB will allow (usually new) developers the
option to be a poor programmer. The brutal (again in a good way) error
checking of C# often makes maintenance much easier, especially when
you're looking at someone else's code.
Thanks,
Seth Rowe