OT: on IDEs and code writing on steroids

Steven Schveighoffer schveiguy at yahoo.com
Thu May 21 06:18:52 PDT 2009


On Wed, 20 May 2009 23:40:54 -0400, Nick Sabalausky <a at a.a> wrote:

> "Christopher Wright" <dhasenan at gmail.com> wrote in message
> news:gv29vn$7a0$1 at digitalmars.com...
>> Nick Sabalausky wrote:
>>> "Christopher Wright" <dhasenan at gmail.com> wrote in message
>>> news:gv0p4e$uvv$1 at digitalmars.com...
>>>> Nick Sabalausky wrote:
>>>>> I can see certain potential benefits to the general way C# does
>>>>> generics, but until the old (and I do mean old) issue of "There's an
>>>>> IComparable, so why the hell won't MS give us an IArithmetic so we  
>>>>> can
>>>>> actually use arithmetic operators on generic code?" gets fixed (and  
>>>>> at
>>>>> this point I'm convinced they've never had any intent of ever fixing
>>>>> that), I don't care how valid the reasoning behind C#'s general
>>>>> approach to generics is, the actual state of C#'s generics still  
>>>>> falls
>>>>> squarely into the categories of "crap" and "almost useless".
>>>> IArithmetic is impossible in C# because operator overloads are static
>>>> methods, and interfaces cannot specify static methods.
>>>
>>> Then how does IComparable work?
>>
>> It uses a member function instead.
>
> And they can't do the same for arithmetic?

Keep in mind that the member method does not map to an operator.

So you still have to call it directly:

object.compareTo(object2);

-Steve



More information about the Digitalmars-d mailing list