I read with interest Carl Franklin's recent (June/01) VBPJ article on .Net Strings.

There is something brought out in his article that I have been questioning
for some time. I wonder why there is an over abundant use of the New
keyword. For example, from Carl's test program (only relavent code from
listing 2 is shown):

Dim Interval As Microsoft.VisualBasic.DateInterval
Dim StartTime As Date
....

Interval = DateInterval.Second
....
StartTime = New Date().Now

In his explaination of StartTime Carl says assigning a value to variable
at the same time it is created is a great feature of .Net. OK, but how
is the Interval variable different from the StartTime variable?

The question I have is that one uses New, and the other does not, even
while there is no real distinction between them when they are dimensioned.

I feel their similatites will lead to confusion as to when one form is used,
compared to the other. Note that under normal circumstances the two
lines could look like:

Dim Interval As DateInterval
Dim StartTime As Date

Carl's specifies the scope to make a point in the article, but for most uses,
the above would be the normal declaration.

The real question I wanted to address, one that I have sent feedback to MS
on, is why the New keyword is needed for the creation of a new object? Unless
I am mistaken, every reference to a base class will create a new object.

In Carl's article we have a variable that is of the Date type, and we want to
assign a date to it. This is a lot like the other variable which is a DateInterval type
except we want to assign a DateInterval to it. Nowhere (looking at the code) does
it inform the programmer that one is an object and the other a member of a structure.
(IE: a constant)

I feel this will be a cause of confusion, and wonder why the New keyword
is actually needed for the object types. For example, if I create a Person class,
then define a variable of the Person type, and later assign a Person object to the
variable, what advantage does the New keyword offer?

'Acceptable now
'Dim Customer As Person = New Person 'or, more simply;
Dim Customer As New Person

Customer = NextCustomer


'Why not this?
Dim Customer As Person

Customer = NextCustomer

I see the New keyword popping up all over the place in VB.Net code, including
in parameters to functions. In Carl's article, the opportunity for confusion is
demonstrated, one variable used New and the other did not.

Do we really need the New keyword at all? The Set keyword was dropped because
all object assignments are now explicit object assignments, and not some default
property. Could we not drop the New keyword for similar reasons, that all references
to a named base class require a call to the base's New routine (constructor)?

Is there a case where "= Person" would be used, without having to first create a new
Person object?

LFS