1
General discussions / Your opinion on the functionality of a template dynamic list
« on: September 10, 2011, 01:24:15 pm »Quote
O(n) is worst-case and O(1) is best case, compared to my own class which is O(1) worst-case and O(1) best case.
Still, you should check with a profiler, if this worst-case O(n) is really a bottleneck and deserves spending so much time on it.
Quote
Readability is not the exclusive criterion, nor should it really be expected in coding
I strongly disagree with you here. Readibilty is a very important criterion for maintainability and thus should be expected in coding. After all, others are supposed to read your code, too.
Quote
I am not sure how exactly my code is not doing what it says. You have a renderer that renders, an image queue that queues images and a imagefile that loads images. How exactly would you make it any more explicit than that?
It's not explicit - that's the problem.
It's implicit, that "Queue = ImageLoader" appends the image to the image queue. After all, it could also prepend or insert in the middle.
The same goes for overloading the ++ and -- operators. They don't have an intuitive meaning for lists and should thus not be overlaoded.
Is there any special reason, why you don't want an STL-like interface?