September 22, 2003
"Riccardo De Agostini" <riccardo.de.agostini@email.it> wrote in news:bkm6lt$30gp$1@digitaldaemon.com:

> "Farmer" <itsFarmer.@freenet.de> ha scritto nel messaggio news:Xns93FD4B286B3FitsFarmer@63.105.9.61...
>> Consider that Java references act like pointers:
>>
>> if (object == null)            //D meaning: if (object === null)
>> if (object.equals(objectB))    //D meaning: if (object == objectB)
> 
> I actually should be more careful when talking about languages I don't know.
>:-)
> Anyway, this looks more like a C++'ism forced into Java than a "real" language feature to me.

Did I hear you say "I actually should be more careful when talking about languages I don't know." just one sentence before?



> 
>> C# is actually quite special.
>> [...]
>> But that means that C# programmers are also used to write:
>> if (object != null)
> 
> ...but then does C# have pointers at all?
> 

Yes, C pointers are supported. Except when running in Java style "sand-box" mode ;-)


>> I don't know how Delphi references work, but I guess like C# references.
> 
> I admit that Delphi references do work like Java references in this context, i.e. pointers are compared by the "=" operator. But Delphi has no operator overloading, so there can be no ambiguity.

I heard from someone (Ilya?) in this NG that the latest versions of Delphi
have operator overloading.


> Visual Basic, which has no pointers, has a "Is" operator to compare
> references and, being there no operator overloading either, it obviously
> compares pointers (yeah, where did you think the "is" operator idea came
> from? My own little brain? No way ;-) ) This one, to me at least, looks
> like the most elegant solution with regard to readability, and VB
> implements it even if there would be no risk of ambiguity.
> Yes, I know that _real_ programmers don't use VB... ;-)

Must agree, at least with the last sentence :-D

Farmer.


> 
> Ric
> 
> --- Real programmers use COPY CON: <program_name>.EXE
> 
> 

September 23, 2003
"Farmer" <itsFarmer.@freenet.de> ha scritto nel messaggio news:Xns93FFB31D37CFitsFarmer@63.105.9.61...
> "Riccardo De Agostini" <riccardo.de.agostini@email.it> wrote in news:bkm6lt$30gp$1@digitaldaemon.com:
>
> Did I hear you say "I actually should be more careful when talking about languages I don't know." just one sentence before?

Yes, as long as you have a text-to-speech app running. :-)

All right, I don't know Java. I feel, nonetheless, that comparing two object references for equality via the == operator, at least in a language like D which offers the possibility of overloading it, should mean comparing the objects and not their pointers. All the discussion started from the meaning of == and === in D, so I gave my 2 cents. Maybe I tried adding a third cent but my pocket was empty... I apologize for that. I still am strongly convinced that, as long as "a < b" invokes the "eq" method, "a == b" should, too. D went the right way IMO by separating "==" and "===". Since "===" is visually similar to "==" to the point of becoming confusing, I proposed using "is" instead of "==="; not because VB has it, just because it seems logical and readable to me. It could come from VB, Javascript, Logo, AutoLISP, or from Latin grammar and I could not care less.

If I sounded rude, that was out of my intention. Sometimes my English goes out of control. :)

> Yes, C pointers are supported. Except when running in Java style "sand-box" mode ;-)

So, as far as I understand, the "==" remains the only "universal" C# way to check for object pointer equality, doesn't it?

> > Yes, I know that _real_ programmers don't use VB... ;-)
>
> Must agree, at least with the last sentence :-D

There's a reason for that. Even more than one. I could tell you at least one
story which will make you wonder if VB was actually written by real compiler
authors...
(Mr. Gates, how about firing whoever implemented the VB preprocessor and
hiring Walter instead?)

Ric


1 2 3 4 5
Next ›   Last »