Frameworks

  • What are frameworks? The worst enemy of a programmer.
  • Why do we use them? Because we are lazy…
  • Do we need them? No we do not.
  • If we do not need them, what can we do instead of using them? Use core language features.
  • Can we live without them? Unless we are good architects, we cannot.

Why do I say all these? Well because in the last 10 years I have gone through numerous frameworks. I tried the easiest ones and the most complex ones. In the beginning they were fun, in the end, it seems like they are just bulk and they encourage coding of slow software.

I started making a sample app today with all the latest MVC, Javascript and HTML features and I came to the realization, that I could do in 300 kilobytes including database, images what other programs could not do in 3 megabytes. All this was a PDO based PHP backend for business logic, HTML templates used on the client side via jQuery (no bulky Smarty unnecessary in server side) and JSON for communication, of course the markup is pure client side HTML as templates loaded via AJAX.

The architecture:

  • Built in PDO DB abstraction, which is multi database compatible
  • Built with PHP’s built-in validation system, I think almost no one uses it even though it is there and is pure C.
  • Used client side HREF hashes (#) to store where we are within the application, like FB and many people these days
  • jQuery UI to ease the UI development
  • jQuery for HTML fun
  • No framework at all other than jQuery, if you can call it that
  • No jQuery Extend function used for JavaScript inheritance, since JS implements it in a prototype fashion and it is beautiful
  • SQLite
  • Multi language by default
  • MVTC (model – validation – template – controller) so called pattern, but I do not like pattern, they are beautiful but limits and bulk
  • Rich client / so called thick client but people tend to like RICH more, whatever

The result was very small, very fast, pure SOA and most of all none of the frameworks can do that such thing. You are completely free to program like this. There is no framework to limit what you can do, only your imagination. Best of all you get full Netbeans, Eclipse, Zend studio auto completion, something you do not get in certain frameworks. High speed and high reliability and because of the SOA architecture, very secure. No tight integration between client and server but a well established, secure contract to be free.

That is all, this is just to say how much I am against framework. It is like steroids in sports. You get big, with less muscle and someone with 20kgs less might be stronger than you are… You can try them, but after all you realize that there is nothing like nature and the closest to nature is the language itself. The most expressive in computing. The hardware is the only limit. Not the framework. I love it.

Leave a Reply