Until now, I had never really spent any time mulling over questions like "I wonder whether the implementation of a virtual function gets resolved at compile-time or at run-time?" or "I wonder if there is another human on this planet that gives a shit, much less wants to read a blog post about it?". But hey - today's a new day, and I decided to throw caution to the wind and run with it!
But seriously, that "part 12.5 out of some presumably multi-part C++ thing" up there is pretty friggin' sweet, if you ask me! (I know you didn't, so please STFU...) It explains the real, "under the hood" implementation of virtual functions in such a clear, concise, "plain-speak" manner that I left with a newly gained ability to picture it in my head, almost as a set of 3D puzzle pieces fits together. It is elegant simplicity at its finest. And you know those asshole interview questions about niche subtleties of polymorphism that nobody ever encounters in Real Life? Well, if it involves class foo overriding the virtual function of class bar, you'll never miss it again!
P.S. - I never knew that pretty much all functions in Java are virtual! Weird!?!?
No comments:
Post a Comment