Hacker News new | ask | show | jobs
by raphaelj 3740 days ago
Don't forget about the templates too.

A generic collection is usually faster when implemented using templates instead of void*.

1 comments

Unless you use a DataDraw-like approach, I presume. I can't see templates doing similar amounts of data rearrangements.
Setting aside the cringe I experience whenever supposed principles of "OOP" are mentioned by the author, that page painfully reminds me of the that old joke about bolting four extra legs onto a dog... Furthermore, both a broader comparison (for more complex data and processing) and the technique I mentioned seems to be absent. However, I suppose it shows how to reclaim at least some benefits of better data arrangement even if the language isn't a good fit.
Did you speak of this "datadraw.sourceforge.net" ? It's the first time I heard of it. Have you used it ?
For a number of reasons, I'm not particularly fond of this specific implementation but I'm seriously considering porting its principles into something else (where they might work even better).