Recently I was calculating the points on a circle to draw, and then later drawing those points. It occurred to me that I was running one loop to create the points, and then the same sized loop to draw them. I thought that if I merged the two operations together into one loop, then I could eliminate one loop entirely.
My problem with this is that I was taught to separate parts, like logic first and then drawing, but in cases like this is seems to make sense to do both together to save execution time, which I imagine could matter in large programs.
Would SDL operations for game loops benefit from merging the logic and drawing loops in cases where they required the same loop count, or is it better to keep the sections separate? I simply want to know so that I develop good programming habits, but at the same time don’t bog down SDL and get a low frame rate.