[bind10-dev] Operators
Jelte Jansen
jelte at isc.org
Tue Feb 21 11:15:34 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 02/21/2012 11:46 AM, Michal 'vorner' Vaner wrote:
> Hello
>
> On Tue, Feb 21, 2012 at 11:24:46AM +0100, Jelte Jansen wrote:
>> On a related note; should we also by default overload the
>> relevant operators if we have their corresponding methods? (i am
>> just writing one that has an equals() for instance)
>
> I don't know if we should, I feel a lot of pro-java tendencies in
> our styles. However, it is more convenient if the operators are
> there, provided they are sane (like == returning the exact opposite
> of != every time, a < b being the same as b > a, etc.). So, if it
> is clear from context how they should be compared, I tend to think
> it is good to have them, if it makes no real sense (like
> Name("example.com") == 2 could return true because it has exactly
> two labels), then definitely not.
>
yes, I meant just for well-defined things like TypeA::equals(TypeA),
TypeA.compare(TypeA). Most, if not all, other types should require
explicit conversion imo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk9DfNYACgkQ4nZCKsdOncV/SwCdFA+1gDnntAAcTXF6RK4rVNIm
U9QAnj+kZNg4X5N/kddE/GOeqge6Nnjv
=ZCvi
-----END PGP SIGNATURE-----
More information about the bind10-dev
mailing list