Skip to content

PHP Frameworks are Governments

I was e-mailing a friend the other day talking about PHP frameworks. He’s been writing one for himself and I’ve written many many frameworks and CMSs through the years. I’ve also looked at a lot of existing frameworks out there like Zend, CodeIgniter, CakePHP, Solar, Symfony and I’ve come to a conclusion. There are a lot of similarities between PHP frameworks and governments.

If you don’t use a framework of some sort (I’m using a loose definition of framework) you would have anarchy. I’ve seen a lot of anarchy in PHP code. No consistency, code all over the place, probably insecure.

There are Libertarian frameworks, that provide some structure and common libraries but generally leave you to your own devices. They are lightweight, so they don’t use up too many resources and they are flexible. A Libertarian framework will probably not force you to use an ORM to connect to the database.

On the other end of that spectrum are the Fascist frameworks. They tell you how to lay out your code, how to write your controllers, how to write your templates and don’t even think about writing a line of SQL because you’ll be using ActiveRecord. These work because you don’t have to think much. Everything just works, you don’t have SQL injection problems, everything is filtered properly and forms are a piece of cake (as long as you don’t care how they look.)

Where does your favorite framework fall on the political spectrum?


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.