Re: Implicit overloads, non static
- From: "Chad Z. Hower aka Kudzu" <cpub@xxxxxxxxx>
- Date: Sat, 7 May 2005 01:04:09 +0300
Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote in
news:MPG.1ce5f6ef1d5d5b1698c0ac@xxxxxxxxxxxxxxxxxxxx:
> Well, you've disputed whether it's a matter of implementation rather
> than principle. The fact that you'd *like* to do something which to me
I didnt necessarily want to do it - the code I posted was just to show
"What" it would do. Im using the copy constructor behaviour and am just
fine with that.
> I guess we can only talk about our own experiences, however different
> they may be. The discrepancy does seem very odd though - I wonder what
> the cause is.
It's easy - 1 to 5, 0, to 4, goofing up of the condition mostly.
> Sure, that's clearer - but I wasn't disputing that. You said you prefer
> your developers to use while loops, and I was saying that I find them
> harder to read than for loops. Maybe we're talking at cross-purposes
> though.
Aah - sorry I should have clarified that. I prefer they use while loops
*when* its not a simple for i = 1 to 5 condition. Certainly not for that
condition. :)
> Only if you'd really find life hard without them. I don't find life
> hard in Java where I don't have them, therefore they're not that
> important to me.
I find a lot of things hard in Java. Ack what they call properties... They
are methods! There's no property about it - its a blooddy pattern I could
do in VB... reminds me of OOP in SAS.
> And for almost every use, I'd go along with that. Other than the types
> defined in the language spec, I think it's pretty much always a bad
> idea to have implicit conversion. Being able to provide *explicit*
> conversion operators is not quite so bad, although it should still be
> used with a lot of care.
Here is where we will strongly disagree then for sure.
> No, I think we're disagreeing more fundamentally. Your examples have
> shown that you think it's not always a bad idea to violate the
> principle that if I do:
>
><variable> = <expression>;
>
> I should be able to look at <expression> and completely know the value
> of the variable. That's not a matter of what's important or not, it's a
> case of what violates entirely reasonable assumptions that pretty much
> every developer makes subconciously all the time.
But you *do* know the value. Becuase its a new value type.
BCD x = 4;
decimal i = x;
i equals 4.
It *is* a new value type - and thus its value is 4. There are many other
non value type uses for implicits too.
> Right. I'm not sure I'd call that a copy constructor myself, but that's
> not terribly important. (I usually wouldn't use the phrase "copy
> constructor" outside C++, and then only when the parameter to the
> constructor was of the same type as the object being constructed.)
Yes - true. Its not a copy constructor, its similar behavioru. I introduced
the term when I was describing some behaviour, and its gone out of context
since then.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
.
- Follow-Ups:
- Re: Implicit overloads, non static
- From: Jon Skeet [C# MVP]
- Re: Implicit overloads, non static
- References:
- Implicit overloads, non static
- From: Chad Z. Hower aka Kudzu
- Re: Implicit overloads, non static
- From: Jon Skeet [C# MVP]
- Re: Implicit overloads, non static
- From: Chad Z. Hower aka Kudzu
- Re: Implicit overloads, non static
- From: Jon Skeet [C# MVP]
- Re: Implicit overloads, non static
- From: Chad Z. Hower aka Kudzu
- Re: Implicit overloads, non static
- From: Jon Skeet [C# MVP]
- Re: Implicit overloads, non static
- From: Chad Z. Hower aka Kudzu
- Re: Implicit overloads, non static
- From: Jon Skeet [C# MVP]
- Implicit overloads, non static
- Prev by Date: Re: preventing animation when minimizing a window
- Next by Date: Re: Implicit overloads, non static
- Previous by thread: Re: Implicit overloads, non static
- Next by thread: Re: Implicit overloads, non static
- Index(es):
Relevant Pages
|