on code.

software, code, art, etc.

RYO – I’m an apprentice

without comments

(RYO – roll your own)

Suddenly, on some rainy sunday afternoon I decided to start buildingmy own “Web Application Framework”
It did not start out as a framework immediately, more like gradually formalizing code I’ve written before into a library, removing overlapsand stubs and cleaning up naming, as a part of a small, quick codeproject I need to finish. With building “my own application framework” I mean that I set out tocreate code for other people to read and use, with a public coderepository and real documentation.The first question, of course, is WHY.

There are plenty of solid,opensource application frameworks that do fine. Most of them well featured, perfectly documented and better implemented then I could ever dream of working on this in my spare time, and they have large communities and piles of example code. Paradoxically, one of my main reasons is to study those application frameworks in detail. This may sound as a crazy idea for any programmer with a solid CS background, but as an artist I find myself in a rich tradition. Students of the great masters practiced by copying great works.

Keeping a couple of real projects at hand that share your framework helps in avoiding over-engineering, although you have to be ready to kill off your darlings ( another similarity with art? ), or even abandon those projects if the composition of your framework demands it, so it’s best not to have any real-world dependencies until your framework reaches a certain maturity. The same goes for code in your framework that really belongs inside some kind of application library. (An attempt at ) Writing my own  framework is not an act of vanity, stubbornness or naïvity.

It is an attempt to copy a great master andstudy the details you admire. On the other hand, it gives you the freedom and incentive to play with coding style, conventions and explore new programming concepts. The “Play Real World” helps to keep discipline in writing your code: Keep documentation up-to-date,sensible naming conventions, keep commit logs, finish what you started and all that. That’s like students of Rembrand using *real* canvas, paint and brushes, and doing minor details in the big works. A side effect of this approach can be that, given that the student is talented enough, his work may once stand to live on it’sown.

This has happened to some of Rembrand’s students, too, you know…

ps.

code is here: http://github.com/mvhenten/nano

Written by Matthijs

January 1st, 2010 at 11:03 pm