Re: globals?
- From: "Michel Posseth [MCP]" <MSDN@xxxxxxxxxxx>
- Date: Sat, 27 Jan 2007 14:17:36 +0100
I am with you Herfried ,
You reflect my opinion in your previous post
I see VB.Net as a much richer .Net programming language ( as C# ) because
of the shortcuts in the framework that it provides
regards
Michel
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx> schreef in bericht
news:udcRsKhQHHA.3500@xxxxxxxxxxxxxxxxxxxxxxx
"Fabio" <znt.fabio@xxxxxxxxxxx> schrieb:
There are several reassons why someone might use the VB methods in favor
of the framework methods
1. the VB methods are sometimes shorter ( saves typing , and thus
coding speed )
But you loose much more in readability and in OOP point of view.
OOP is a tool, not a goal. Yes, you are loosing object-orientation, but I
believe that object-orientation is not always the best tool. Take the
'Math' class as an example.
\\\
x = Sin(a) * 2
///
seems more natural than
\\\
x = Math.Sin(a) * 2
///
In the latter case readability gets worse and the only way to make it
better is by importing the 'Math' class. In the case of the mathematical
functions it's absolutely irrelevant that the functions are members of a
certain class. Qualification by class name only blows up code and thus
reduces readability.
And as said by Tom, you make your code difficult to understand to non-vb
"players".
Does that really matter? There are so many things which are different in
various programming languages. You can also say that other programming
languages not providing the functionality VB provides make understinding
VB code hard to non-vb "players", which is certainly often the case in
practice. So that's only a POV.
2. The VB methods sometimes behave different as there .Net counterparts
3 The VB methods often have built in validation ( where you should write
a try catch block for the .Net counterpart )
I see that an an advantage in certain cases. Why write
\\\
If s IsNot Nothing AndAlso s.Length > 0 Then
...
End If
///
if I can simply write
\\\
If Len(s) > 0 Then
...
End If
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.
- Follow-Ups:
- Re: globals?
- From: Tom Leylan
- Re: globals?
- References:
- globals?
- From: Smokey Grindle
- Re: globals?
- From: Herfried K. Wagner [MVP]
- Re: globals?
- From: Tom Leylan
- Re: globals?
- From: Herfried K. Wagner [MVP]
- Re: globals?
- From: Tom Leylan
- Re: globals?
- From: Michel Posseth [MCP]
- Re: globals?
- From: Fabio
- Re: globals?
- From: Herfried K. Wagner [MVP]
- globals?
- Prev by Date: Re: globals?
- Next by Date: Re: globals?
- Previous by thread: Re: globals?
- Next by thread: Re: globals?
- Index(es):
Relevant Pages
|