May 24, 2010
8:06 p.m.
IMHO 4 is the most readable and it is the fastest in Pharo/Squeak at the moment, so that should be preferred in core packages.
It should not be preferred or changes unless you can prove a real performance benefit. I still haven't seen a single realistic benchmark with real code (from Pharo, Seaside, Pier, ...) where you can measure a real difference between these 4 variants.
1 just looks bad, I can't imagine an OODB that doesn't map it's "null object" directly to nil, otherwise #= will be asymmetric: null = nil -> true nil = null -> false
That's not the problem. The problem is when you have proxy objects then all these inlined an shortcut variants fail miserably. Lukas -- Lukas Renggli www.lukas-renggli.ch