as working on an interesting project, i face a recurring problem which i still struggle on at programming.
The problem I work on is simply an image parsing (language independed). I know _a_ solution of this problem, i've done it before, but i still have the feeling about, how can i solve this better.
The structure of this problem is: - load the image (say bmp) - search the image for certain byte pattern - create a list of this pattern and search for nearby patterns - save the results as new list of structures
So the schoolbook solution would be doing all this step by step. This would also allow to cleanly separate each steps in a certain architecture which would allow some kind of modify-less reuse.
But i also have some solutions in mind, which merges some of these steps to reduce the memory consumption and reduce the iterations done on the data, but then they result in a structure oriented architecture which results in the need of review, rewrite when reusing it. The architecture would finally be a monolithic "x to y converter" architecture.
I know its the all time weighting which is to be decided by creating such an algorithm, but maybe you know some more variants which is not just black and white and takes profit from both views.
Thanks.