I would say that it more likely to be because each of the
current
constructors initialise the Guid to a specific known value
and it would
perhaps be odd to have another constructor that initialises
a new Guid
instance to an arbitrary random value. That default
constructor would
seem like the odd one out, by not fitting the pattern.
So I expect that made them choose to have a static method to
create a
random Guid value, and save the constructors for creating
Guids with
known values.
Just my 2p worth
Ian
-----Original Message-----
From: Discussion of development on the .NET platform using
any managed
language [mailto OTNET-CL
R DISCUSS.DEVELOP.COM] On Behalf Of Brady
Kelly
Sent: 14 December 2006 11:07
To: DOTNET-CLR DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-CLR] Guid Constructor
I'm not complaining about having to use NewGuid, just
curious. You do
have
a point with the zero-initialised GUID though.
> -----Original Message-----
> From: Discussion of development on the .NET platform
using any managed
> language [mailto OTNET-CL
R DISCUSS.DEVELOP.COM] On Behalf Of Stoyan
> Damov
> Sent: 14 December 2006 01:00 PM
> To: DOTNET-CLR DISCUSS.DEVELOP.COM
> Subject: Re: [DOTNET-CLR] Guid Constructor
>
> Actually, I'm sure if you ask a lot of people, many of
them will think
> that a default ctor should create a zero-initialized
guid
> Guid.NewGuid is easy for reading and certainly not that
much of a
> typing.
>
> On 12/14/06, Brady Kelly <brady chasesoftware.co.za> wrote:
> > Why do I have to use the Guid.NewGuid static
method to create a new,
> random
> > Guid? A default, parameterless constructor seems
an ideal means to
do
> this.
> >
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> http://discuss.develop.com
> >
>
>
> --
>
> Cheers,
> Stoyan
>
> ===================================
> This list is hosted by DevelopMentorR http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|