Early speed optimizations aren’t premature
pythonspeed.com
pythonspeed.com
But what about using a dict or a list or tuple? That kind of decision can make a performance difference down the road, and there are trade offs in ease of development.
Anyway, the whole thing feels a little contrived. Who would ever argue that you shouldn't use numpy from the get-go? Who is the author arguing against?
This is addressed in the third paragraph:
> The problem with this saying is that many people wrongly interpret it as “early optimization is the root of all evil.” In fact, writing fast software from the start can be hugely beneficial.
result = (arr - min_val) / (max_val - min_val)
That should often run faster and removes the allocation and for-loop, so it's easier to read.https://softwareengineering.stackexchange.com/questions/8008...