I like signed values but I think all the casts( required by the framework ) make my code less readable, so am using it less and less.
Generally integer overflows are not the problem they were 15 years ago, I cant remember the last time I had something pop 2 Billion. Simple solution is to always use signed values. If you think you will hit 2 Billion use an int64. Ben > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of George V. Reilly > Sent: Tuesday, 23 November 2004 1:27 PM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Library interface for unsigned types & > VB.NET > > Signed integers can get you into trouble too. See > http://blogs.msdn.com/michael_howard/archive/2004/10/27/248893.aspx > > -- > George V. Reilly [EMAIL PROTECTED] > http://george.reilly.org/ > Read my blog: http://weblogs.asp.net/george_v_reilly/ > > > > Ben Kloosterman wrote: > > >>On Behalf Of Ryan Heath > >>Sent: Tuesday, 23 November 2004 6:27 AM > >>To: [EMAIL PROTECTED] > >>Subject: Re: [ADVANCED-DOTNET] Library interface for unsigned types & > >>VB.NET > >> > >>Shawn A. Van Ness <[EMAIL PROTECTED]> wrote: > >>... > >> > >> > >>>I don't get it. On my system, both int and uint produce c == > >>> > >>> > >>0xffffffff. > >>... > >> > >> > >>>if (c < 0) { // oops, never true! > >>> > >>> > >>you do get it :D > >> > >>My example was too easy, but, like I said, IRL you'll often be bitten > >>if you not careful enough... > >> > >>In my early c++ life I was fond of the unsigned and const-ness > >>features. But IRL they usually generate more "problems" than > >>"benefits" ... > >> > >> > >Agreed . > > > >Primarily the framework uses signed so all array calls need casts. If > >the frame work used unsigned it would be great but it would be too > >traumatic to implement now even if VB does get unsigned support. > > > >If you have to have VB ... I would just write a C# wrapper for the class > >this exposes a new unsigned interface and use that for .NET . > > > >Ben > > > > > > > >>// Ryan > >> > >>=================================== > >>This list is hosted by DevelopMentor(r) http://www.develop.com > >>Some .NET courses you may be interested in: > >> > >>Essential .NET: building applications and components with C# > >>November 29 - December 3, in Los Angeles > >>http://www.develop.com/courses/edotnet > >> > >>View archives and manage your subscription(s) at > >>http://discuss.develop.com > >> > >> > > > >=================================== > >This list is hosted by DevelopMentor(r) http://www.develop.com > >Some .NET courses you may be interested in: > > > >Essential .NET: building applications and components with C# > >November 29 - December 3, in Los Angeles > >http://www.develop.com/courses/edotnet > > > >View archives and manage your subscription(s) at > http://discuss.develop.com > > > > > > > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > Some .NET courses you may be interested in: > > Essential .NET: building applications and components with C# > November 29 - December 3, in Los Angeles > http://www.develop.com/courses/edotnet > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: Essential .NET: building applications and components with C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com
