Re: [PHP4BETA] A strict equality operator
| From: | Zeev Suraski | Date: | Sun, 25 Jul 1999 21:27:55 +0000 |
| Subject: | Re: [PHP4BETA] A strict equality operator | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-2725@lists.php.net to get a copy of this message | ||
On Sun, 25 Jul 1999, Stig Bakken wrote:
> On Sun, 25 Jul 1999, Ariel wrote:
>
> > On Sun, 25 Jul 1999, Jeffrey Galbraith wrote:
> >
> > > I've seen to many problems with the triple equality operator in the past.
> > > How about := (colon equal)? This makes it more explicit and easier to
> > > interpret. For instance, looking at another developer's code, sometime you
> > > have to wonder if they meant to add === as opposed to ==. The := makes it
> > > easier to decipher.
> >
> > := means assignment is a large number of languages, plus in mathamtics, so
> > it's not a good choice.
> >
> > I agree that === is unwildly, since == and === in many cases will work the
> > same, so it would not be an easy bug to spot. It should be something very
> > different. $= is my suggestion.
>
> If we can't use "===", my suggestion is that it is made less cryptic, for
> example "eq". Cryptic ones like "!=" etc. are ok because other languages
> have paved way for them, but I don't think I have ever seen "$=".
>
> Short version: "===" or "eq"
I vote for === (surprise surprise, it was my idea:), if only to avoid
using the Perlish 'eq' (and it doesn't even have the same meaning, which
makes things even more obscure).
Zeev
--
-----------------------------------------------------
Zeev Suraski <zeev@zend.com> http://www.zend.com/
For a PGP public key, finger bourbon@netvision.net.il