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:
- Simple is better than complex.
- Flat is better than nested.
- Readability counts.
- If the implementation is hard to explain, it’s a bad idea.
- Namespaces are not for taxonomies (Java).
- Don’t do hard things in the first place if you can avoid it.
- Revert complications later.
- We ship features, we don’t ship code.
- We don’t have customers because we have lots of code.