3 ms·
The discussion is missing the most important point, IMHO: readability and maintainability of the larger system in the long term. I used to love objects and mul
by jwr 8y ago
The discussion is missing the most important point, IMHO: readability and maintainability of the larger system in the long term.
I used to love objects and multimethods (or single-dispatch multimethods for those more limited languages). But then I ended up debugging a large code base which used them extensively. It is a nightmare: by reading the code, there is no way to find out what all the dispatch options are, and without interactively debugging it there is no way to see which code will get called (inheritance messes things up greatly).
I think performance is secondary to these problems, so these days I prefer switch statements (or pattern matching), for their simplicity and reliability.