2 ms·
another example: functions should be virtual by default. No no no! C++ got this one right, and then C# did better ('virtual' to declare a virtual/overridable
by tbrownaw 16y ago
another example: functions should be virtual by default.
No no no!
C++ got this one right, and then C# did better ('virtual' to declare a virtual/overridable function in the base class, and 'override' to replace it in the subclass).
http://www.artima.com/intv/nonvirtual.html http://www.artima.com/intv/nonvirtual.html
Every time you say virtual in an API, you are creating a call back hook. As an OS or API framework designer, you've got to be real careful about that. You don't want users overriding and hooking at any arbitrary point in an API, because you cannot necessarily make those promises. And people may not fully understand the promises they are making when they make something virtual.