Where to Seperate Files in Package?

One somewhat technical argument one can make on this topic is that it makes sense to put independent (e.g. Array code and String code) or one-sidedly independent parts (e.g. basic Array functionality and linear algebra code) into separate files. This simplifies the development process for two (related) reasons:

  • Cleaner git history since you only have to look at the changed files to see which parts could possibly have been broken by a change.
  • Easier development and testing: if you think your linear algebra code stinks but the basic array code is fine, you can simply delete the linear algebra file but keep the array file. Similarly, if you mirror your file structure for the tests and you are working on the linear algebra code, you can temporarily not include() the array tests to speed up the testing.
2 Likes