There are Other Minimalist Programmers!

Everyone has moved fiercely into the ever increasing complexity of frameworks like MVC and Robotlegs. There are books, presentations and everyone swears by it like a religion. But let’s face it, it gives you more files, more classes and more abstraction. Making a system with it requires tons of documentation, and lots of time to teach it to others.

For along time I thought I was the only one who strived for simplicity. I watched a Python video where the presenter, Jack Diedrich, was even encouraging people to “Stop Writing Classes”. He shows that writing an entire class file that contains a few lines is absurd, or how making a class with two functions (one is the constructor) doesn’t make sense when you can make a single function. Much MVC code will be a class with one page of SLOC (Controllers/VOs) some people even prefer it this way.

When I program in AS3 for small games I always try to make as little classes as possible. I make it so that basically I can save time easily teaching someone else what I made. Make sure that my job is easily replaceable, good or bad. So I was happy to see that there is a person or community (Python) that also thinks this way. Tim Peters is the author of “Zen of Python” who is also a minimalist. Some main points of the presentation:

  1. Simple is better than complex.

  2. Flat is better than nested.

  3. Readability counts.

  4. If the implementation is hard to explain, it’s a bad idea.

  5. Namespaces are not for taxonomies (Java).

  6. Don’t do hard things in the first place if you can avoid it.

  7. Revert complications later.

  8. We ship features, we don’t ship code.

  9. We don’t have customers because we have lots of code.

Stop Writing Classes


  1. don_loqheart says:

    Classes and OOP isn’t the be all and end all of anything. There are lots of other paradigms to work with that can be more effective depending on the task at hand. I stopped using PureMVC and created my own framework once I realized the best parts didn’t have to be stuck in so much boilerplate. RobotLegs didn’t seem to be enough of an improvement to be worth the trouble.

    For me the biggest improvement to my code was when I discovered State and Transition Oriented Programming (aka STOP by Troy Gardner) and HSMs (aka state charts) to structure my application. It let’s me build out the scaffold for my app fast, and I know exactly where everything is. Combine that with a messaging system where I can broadcast signals through out the app, and I find it much easier to see what the program is doing and how the data is flowing. So I can ship more features with less code and fewer headaches.

    • T says:

      I originally used a main game loop with states in it. Then I slowly learned out of it (peer pressure!) into event driven programming. For my full time work I made my first game using my states, the second version I refactored it to use the event-driven model. That state-machine style version was surprisingly way more stable than my new event driven version. It was easier to understand, and you knew the order of events. As a compromise I started to use AS3 Signals which cleared it up better. I will check out STOP and HSMs and see if it improves things. Thanks!

      STOP programming in Javascript