Gardening is my preferred metaphor for software. When I grow a new piece of software, there is a very predictable path I go through as I attempt to manage it’s complexity. It is, in fast-forward, the history of programming language design. That process is short enough to capture in about 400 characters, as two tweets.
Growing software, in two tweets:
1. Writemain. Put your program in there.
2.maintoo big? Extract functions. Use global vars.
3. Too many functions? Group functions and their data (replacing global vars) into objects.— grahamking (@grahamking) March 12, 2018
- Too many objects? Group objects into packages. Make some methods private.
- Too many packages? Split out a new project, either library or network service.
- Iterate from 2 when other functions grow too big.
— grahamking (@grahamking) March 12, 2018