Re: Funny Comparison with Float
Rich Armstrong <[email protected]> Thu, 6 Mar 2008 09:38:53 -0600
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
Of course it may or may not be appropriate for the original poster's =
purpose,
but if someone were looking for a better way to represent a version than =
a float
or double, it's worth considering.
If you do need versions with more than two parts ("in a normal kind of =
way"),
System.Version provides some nice features, like comparison semantics =
and the
various ToString() overloads. We've used it to version all sorts of =
non-CLR
things; my only complaint has been that the class is sealed, forcing us =
to write
a wrapper class for one of our applications.
Just my 2=A2.
-----Original Message-----
From: Discussion of development on the .NET platform using any managed =
language
[mailto:[email protected]] On Behalf Of Jon Skeet
Sent: Thursday, March 6, 2008 9:22 AM
To: [email protected]
Subject: Re: [DOTNET-CLR] Funny Comparison with Float
Rich Armstrong wrote:
> Jon Skeet wrote:
>>> Assuming it's a version number in a normal kind of way, it should =
really
>>> be a decimal (or a string).
>
> ... or even a System.Version.
Well, that depends on what it's versioning. If you're versioning
something which has nothing to do with .NET, and only needs a major and
minor number, I'm not sure I'd use a version number with 4 parts where
the class describes itself in terms of versioning a CLR assembly.
I'm sure it would work, but it also has disadvantages such as ToString()
including the two unnecessary parts.
Jon
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE http://www.develop.com
View archives and manage your subscription(s) at =
http://discuss.develop.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This list is hosted by DevelopMentor=AE http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com