3 ms·
> It doesn't necessarly means that all OOP languages created equal. Exactly - unless you're trying very hard, you're unlikely to beat C++ polymorphism with you
by TeMPOraL 4y ago
> It doesn't necessarly means that all OOP languages created equal.
Exactly - unless you're trying very hard, you're unlikely to beat C++ polymorphism with your OOP code in a different language. Which makes Casey's argument that much stronger. C++ with its relatively unsophisticated OOP and minimal overhead on everything, is as fast as you're going to get, so it's good for showing just how slow that still is if you follow the Uncle Bob et al. Clean Code tradition.
- hayley-patton 4y ago> C++ with its relatively unsophisticated OOP and minimal overhead on everything, is as fast as you're going to get No it isn't. If your C++ compiler isn't devirtualising at all (implied by the article) it'll get stomped on by anything doing inline caching [0] which will generate the switch-case code. The JVM does that for example. [0] https://bibliography.selflanguage.org/_static/pics.pdf https://bibliography.selflanguage.org/_static/pics.pdf