Re: Implicit overloads, non static



Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote in
news:MPG.1ce47713d0c5316398c09b@xxxxxxxxxxxxxxxxxxxx:
> I don't believe there's any way to do this, and frankly I'm glad -

I have mixed feeling on it. In VB (ack!) it certainly caused a lot of
issues, but that was because VB never handled objects properly.

But the fact that VS already includes support for implicits, etc I think it
might be a good extension but havent fully thought out all the consequences
yet. At this point I just wanted to confirm that it does not exist, so I
can proceed with what I have.

> things like the above would make your code *very* unintuitive, IMO.
> Heck, even implicit conversions are bad enough in that respect, without
> further abuse...

Anything can make your code uninintuitive, especially when abused. In fact
if I want unintuitive code I can go to C++ (or just putz around with C#'s C
style for loop, a never ending source of careless bugs). :) But implicit
operators do not themselves make code unintuitive - the user does. Implicit
operators are a *very* important feature of C# IMO and have proven
incredibly useful in practice.

Operator overloads can make a mess in the wrong hands too. But Id much
rather have the scalpel that C# is, than a chain saw. C# is very nice in
that *most* of it is implemented in "itself" rather than compiler magic,
although a lot of that remains too.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
.



Relevant Pages

  • Re: Implicit overloads, non static
    ... >> Heck, even implicit conversions are bad enough in that respect, without ... I can't remember the last bug I ... very rarely useful on a user basis, IMO. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Delphi.NET vs C#: is Delphi.NET compelling?
    ... >> between Implicit and Explicit when doing operator overloading. ... > Totally different topic IMO. ... TObject.ToString is explicit boxing. ...
    (borland.public.delphi.non-technical)
  • Re: [PATCH] 2.6.18-rt7: PowerPC: fix breakage in threaded fasteoi type IRQ handlers
    ... in 8259 driver, mask_ackmethod actually sends EOI to PIC, not ACK's an IRQ ... So, IMO, there probably should only have been either ack() ... this is implicit by reading the vector. ... was before the interrupt occured. ...
    (Linux-Kernel)
  • Re: [PATCH] 2.6.18-rt7: PowerPC: fix breakage in threaded fasteoi type IRQ handlers
    ... handler is being changed and what is the rationale for adding an ack that was not necessary before? ... in 8259 driver, mask_ackmethod actually sends EOI to PIC, not ACK's an IRQ -- the actual ACK is implicit on x86 and is used to read the interrupt vector form 8259 on PPC. ... So, IMO, there probably should only have been either ackor eoi() method in the first place. ...
    (Linux-Kernel)

Loading