Re: globals?
- From: "Tom Leylan" <tleylan@xxxxxxxxxx>
- Date: Sat, 27 Jan 2007 12:05:33 -0500
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx> wrote in message
news:udcRsKhQHHA.3500@xxxxxxxxxxxxxxxxxxxxxxx
OOP is a tool, not a goal.
Actually VB is a tool not a religion. :-)
Re: your Sin() example:
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.
It is completely relevant if you use an alternative math library. It is
important for many to understand that not all software is like the software
that we personally produce. Nobody I know qualifies Sin() with Math they
import Math at the top. And again the reason is because one can import a
scientific math library in it's place and gain whatever benefit that might
have without changing the code below.
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.
Yes in the business world it matters very much. Confusion cost money.
Programmers are hired on a budget there isn't some infinite amount of money
available and it is common for the "VB-guy" to be asked to write non-VB code
and the C# guy to fill in when the VB-guy is sick or quits.
Please note my careful wording of the example in my post it isn't C# vs VB
it is the VB function library versus "every other dotnet language."
Striving to be different for no apparent benefit is the problem. Where a
funny hat if that is the VB-er's goal.
\\\
If s IsNot Nothing AndAlso s.Length > 0 Then
...
End If
///
if I can simply write
\\\
If Len(s) > 0 Then
...
End If
///
But that's the point isn't it. Import the Visual Basic namespace and do it
your way who said you couldn't? I only say you can't if you work for me.
If it becomes a major headache we can create our own class and implement
Len() as a function along with the 100 or so other things we find repetitive
and annoying. It is what we would do if we encountered something we needed
that wasn't currently in the framework or the VB namespace. That library
can be used by both the VB development team and the C-Sharp team.
.
- Follow-Ups:
- Re: globals?
- From: Herfried K. Wagner [MVP]
- 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: Encoding problems
- Next by Date: Re: Encoding problems
- Previous by thread: Re: globals?
- Next by thread: Re: globals?
- Index(es):
Relevant Pages
|