List Info

Thread: Guid Constructor




Guid Constructor
user name
2006-12-14 14:41:02
Then I suppose the reason there isn't a default ctor is that
it may cause
confusion where some expect a useful, random GUID, and
others expect
standard ctor behaviour and a less useful zero initialised
GUID.

There are quite a number of these little questions that, on
close
inspection, illustrate some serious design effort has been
put into the BCL.

> -----Original Message-----
> From: Discussion of development on the .NET platform
using any managed
> language [mailtoOTNET-CL
RDISCUSS.DEVELOP.COM] On Behalf Of Peter
> Ritchie
> Sent: 14 December 2006 04:07 PM
> To: DOTNET-CLRDISCUSS.DEVELOP.COM
> Subject: Re: [DOTNET-CLR] Guid Constructor
>
> The philosophy that c'tors should zero-init is the main
reason (if not
> the
> only) there's a NewGuid factory method...
>
> On Thu, 14 Dec 2006 11:00:10 +0000, Stoyan Damov
> <stoyan.damovGMAIL.COM>
> wrote:
>
> >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 <bradychasesoftware.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 DevelopMentorR  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

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )