I am currently writing a simulation in python which is running in 2D. I want to extend it now to 3D and therefore I have to change the classes like the simulation grid.
My question is what is considered best practices?
I thought about the following options:
- Create extra classes for the 3D simulation
- PRO: Clean separation between 2 and 3 D
- CON: A lot of duplicate code
- Handle the 2d/3d difference internally in the class
- PRO: DRY
- CON: Could be confusing and possibly other issues
- Something else like extending the 2 D class?
- Or doing both?
Thanks for the feedback!