4 ms·
dereferencing the vptr in the Linux device tables tends to happen once per (say) function. the WTF project would have '->vptr' and worse '->super->vptr->method
by TickleSteve 10y ago
dereferencing the vptr in the Linux device tables tends to happen once per (say) function.
the WTF project would have '->vptr' and worse '->super->vptr->method(), maybe 20 or 30 times per function.
every call in the codebase or data reference would be via a '->vptr'.
That really makes a difference.... its unreadable. literally.
- jjnoakes 10y agoSo based on one project's misuse of a technique (OO in C) you dismissed it as "bad" idea, "stay away from this", it's "attempting to be clever", and the rest? I think that's why I'm not following you. You've dismissed OO in C in its entirety, and advised others to do the same, based on your experience in one project which misused/overused the feature.
- TickleSteve 10y agono. The level to which it is used in Linux is effectively idiomatic. The project I'm referring to used the technique properly. Its just a bad technique.
- jjnoakes 10y agoYou've said it is a bad technique no matter how it is used, and you have said it is an ok technique if used at some levels (like the Kernel) but not others (like the WTF project). So you can see how I'm confused about what your opinion really is, I hope.