Re: globals?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Hi Tom

Does anybody (not converting a VB6 app) uppercase strings by using UCase()
rather than String.ToUpper()? Again I ask is that so experienced
developers in every other DotNet language is confused?

I'm not advocating that everybody do what I say I'm simply offering an
opposing viewpoint. I would however tell anybody doing it in a project
that I controlled to please stop and when I've removed the reference to
the VisualBasic namespace, the code had better still compile.



Personally i only use Modules when i want to replace built in methods for
custom methods ( for instance the better IIF function ) so i believe a
module still has a verry handy functionality in VB .

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 )
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 )


when I've removed the reference to the VisualBasic namespace, the code had
better still compile.

Well about this i would say read my comments on this article and you see my
personal opinion

http://www.codeproject.com/useritems/novbruntimeref.asp?df=100&forumid=327076&exp=0

Note that he has withdrawn his comments to me ( wich was verry rude ) as i
did not give up on him to convince him from my point of view , i hope it has
the same effect on you .

In short VB is a RAD because of the shortcuts in the framework that the vb
namespace provides no need for RAD ? and want strict framework code ?
move to C# would then be my advice .

By the way i can code in both but i prefer VB as i started with VB on the
C64 on 13th years of age , but i am certainly not a C# basher VB and C#
are just 2 tools that might be prefered in different situations

regards

Michel Posseth



"Tom Leylan" <tleylan@xxxxxxxxxx> schreef in bericht
news:OWUUDIcQHHA.1908@xxxxxxxxxxxxxxxxxxxxxxx
Hi Herfried: Let me begin by stating that I believe we disagree on
certain programming fundamentals and so opinions (yours and mine both)
should be weighed by the degree of "VB-ishness" we prefer. I don't think
I'm wrong in stating you like it and I've only actually liked VB since
VB.Net hit the scene.

The question for me usually comes down to "how does every other .Net
language manage to get along with out modules?" I'm staring at the VB
run-time library right now so perhaps you can explain (as you see it) the
reason that .ControlChars is a class and .Conversion is a module? I see
for instance a module contains ErrorToString(ByVal ErrorNumber As Integer)
As String

What is the upside to this not being a method of an Error object? What
does anybody gain by having a public function that you pass integers to?
It is a wrapper (isn't it?) for the Err.Number property. So why would
ErrorToString be used when the Err object contains the number, the
description and more?

Let's look at DateAdd( Interval, Number DateValue). One must actually
pass the date value to use along with the interval and such and it returns
a DateTime. If you have a DateTime variable anyway wouldn't .AddDays(),
.AddMonths(), .Add() and the other methods .IsLeapYear(), etc. be handy as
well? Is there a benefit to an extra set of arbitrarily named functions?

Let's see what would the code look like in C# dt.AddDays(7) what would it
look like in Python.Net, or Delphi.Net or any other .Net language? I
think dt.AddDays(7) will do it in every case. The benefit is clearly "it
doesn't matter what language you write in you can read the code." I can't
say for certain but I doubt there is an IncrementPeriod function in
Delphi.Net which takes some number of parameters but I am assured there is
DateTime.AddDays.

Does anybody (not converting a VB6 app) uppercase strings by using UCase()
rather than String.ToUpper()? Again I ask is that so experienced
developers in every other DotNet language is confused?

I'm not advocating that everybody do what I say I'm simply offering an
opposing viewpoint. I would however tell anybody doing it in a project
that I controlled to please stop and when I've removed the reference to
the VisualBasic namespace, the code had better still compile.

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx> wrote in message
news:exjn1qbQHHA.1000@xxxxxxxxxxxxxxxxxxxxxxx
"Tom Leylan" <tleylan@xxxxxxxxxx> schrieb:
I will suggest it is "easy" but I'm doubtful that it is the "standard" or
(if it is at this point) that it will remain so.

http://msdn2.microsoft.com/en-us/library/7825002w(VS.80).aspx

I'd like to caution the OP against modules. As the number of public
functions increases you'll tend to want to organize them in some way,
classes do this for you in a natural way.

Even modules organize functions. This only doesn't necessarily implicate
that they can only be used with qualification (module name). The Visual
Basic Runtime Library is a perfect sample.

Perhaps as an exercise you could list (here) the names of 3 or 4
functions which you might consider putting into a module. What are
their names and (if isn't obvious) what do they do?

Functionality similar to the functionality in the Visual Basic Runtime
Library. Extended mathematical functions, for example which are used
extensively in the context of the project.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>




.



Relevant Pages

  • Re: FOR070.DAT files appearing
    ... > Maybe you mis-understood what I was advocating. ... You know like Pascal, C, Ada and pretty much every language ... Declare before use. ...
    (comp.os.vms)
  • Re: Declining Popularity of Java?
    ... where I do not have to care. ... I'm advocating the notion of others engaging me in a discussion about ... I'm here as a student of the language, all aspects of the language, and I've gleaned a wealth of information from posters like you and others. ...
    (comp.lang.java)
  • Re: Downloading webpages
    ... That is a usual claim made by people advocating the use of 'certain ... But I am not advocating the use of any language and if I would, ... The most frequent problem wrt 'readablity' in source code is the ...
    (comp.os.linux.development.apps)
  • Re: Copying Aggregate Data Types in C
    ... that fight having been lost or rendered irrelevant a long ... There's no point in advocating /any/ changes to C if you ask me... ... makes it into the language. ...
    (comp.lang.c)