Monday, January 29, 2018

FreeRails: How to untangle code?

There are three basically different approaches

  • Study the code, find the crucial parts that are connected but should not, find a solution to untangling them, then do the programming
  • Study the code and untangle code wherever you find it, until all but the crucial part remains, then tackle it
  • Study the code and rewrite the code (in a simpler form) in another set of sources which then could replace the original code at some point
The last method is very risky and may easily fail. The first one is less risky and overall probably taking the shortest amount of time. But somehow my head is not big enough to grasp the full complexity of FreeRails yet. So I go for the slow but relative safe way of taking the second option currently, slowly reading through the code base, frequently running the tests and running the game, optimizing locally, untangling the code one piece at a time. It's quite an effort, but it's also the only good way I know. It will take some time.

No comments:

Post a Comment