I’m having problems to recall the name of doing something with quadratic complexity when it can be solved linearly.
For example, using a get-by-index function to iterate over a linked list instead of just using a next-element is the typical case of this antipattern.
I think it was the “something painter”, as a metaphor of a guy that is painting a road, but doesn’t carry with him the paint bucket and has to come back to the starting point every time he needs to refill the brush.
Cheers.
You’re probably thinking of Schlemiel the Painter’s Algorithm.
There’s a classic joke on the topic that Joel Spolsky included in his Back to Basics article some years ago:
P.S. Don’t confuse this with the Painter’s Algorithm, which is an actual method for composing images.