'tie' considered harmful (via) Rich Skrenta on the disadvantages of abstractions like Perl’s tie, which lets you create hash data structures that aren’t actually hashes. Operator overloading (as seen in Python) suffers the same problems.
'tie' considered harmful (via) Rich Skrenta on the disadvantages of abstractions like Perl’s tie, which lets you create hash data structures that aren’t actually hashes. Operator overloading (as seen in Python) suffers the same problems.
I think the bigger (or more common) problems in Python are probably things like an expensive property, which looks like a cheap attribute access. Or something like xmlrpclib, which makes a very expensive network call look like a simple function call.
I think you can avoid most problems with good names and conventions to hint to the programmer what is going to happen. Call a variable "db" and probably people won't think access is quite so cheap. Call an object "server" and people won't think function calls on it are cheap either.
Ian Bicking - 31st May 2007 00:24 - #