[FX.php List] [OFF] Someting to show at DevCon CWP User Group? -> web frameworks

Tony White tony_white at twdesigns.com
Thu Jun 20 10:02:48 MDT 2013


Hi All,

First off, I should say that on the topic of web frameworks, I have more
questions than answers.

That said, I have been researching web frameworks both in the PHP world and
in the Ruby world and have some thoughts on the matter.

I have to confess a bias...I prefer to code as ³close to the metal² as I can
for any given environment. I want the shortest path from point A to point B,
unless there is an advantage to inserting more hops along the way.

There are lots of blog posts (many of which I¹ve read) that talk about the
advantages of using a framework versus not using a framework.

There are also many blog posts on the web comparing procedural PHP to
object-oriented PHP.

There is also a lot of documentation about how different frameworks work. I
have read through much of the documentation for CodeIgniter and ZEND.

>From Joel Shapiro a while ago:
http://www.phpframeworks.com/

Having said all that...I¹m currently of the opinion that it is sometimes
correct to use a web framework and sometime correct to avoid using a web
framework. 

Likewise it is sometimes correct to use object-oriented PHP and sometimes
best to use procedural PHP.

Any given choice should be guided by pros and cons and how they affect a
particular situation.

I¹ll start off by making the assertion that the web frameworks have greater
complexity. This complexity must be balanced by benefits in order to justify
the cost.

For an example of complexity, have a look at what¹s involved using the ZEND
framework to add form elements to a web form...

http://framework.zend.com/manual/1.12/en/zend.form.standardDecorators.html

 Š and compare this to building a form manually:

http://webcheatsheet.com/PHP/form_processing.php

Most people would agree that it is more complicated to use a web framework
for this task.

This gets us to the question, ³what are the advantages to balance out this
type of complexity?²

The idea behind a web framework is that it solves a number of recurring
problems that will (or might) come up in any given web project. Examples
include:

* Protection against cross site scripting attacks

* The ability to implement unit testing (PHPUnit, RSpec, etc.) to protect
against changes breaking code, for example on large projects with multiple
team members.

* Protection against web form spoofing.

* Dynamic database query generation within an Object-relational mapping
pattern 
https://en.wikipedia.org/wiki/Object-relational_mapping

*** I wish I had a comprehensive list of all the things that a web framework
gives you. Please feel free to add to this list. Additions appreciated.

A web framework is a collection of code, some of which which will be useful
for a given project and some of which will not. There might be advantages in
deploying only the pieces of code that are needed for a given project and in
the simplest possible way.

For example, in the Ruby world, the 2 popular frameworks seem to be Ruby on
Rails (RoR) and Sinatra. Ruby developers talk about using RoR in some cases
and Sinatra in other cases where they don¹t need the overhead of RoR. This
method of starting with the amount of code that¹s appropriate for a project
seems like a good idea. There is also the question of how easy is it to
modify a framework for those cases where you need to color outside the
lines.

The most important question seems to be what problems does a framework
solve? If we can answer that question, it will help us make the best
decision of when to use a framework and when to keep it simple.

What do you all think?

Thanks.

All the best,


Tony White
Tony White Designs, Inc.
Tel: 646-714-2797 (Google Voice)
Tel: 718-797-4175
tony_white at twdesigns.com
http://www.twdesigns.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20130620/92717e0b/attachment.html


More information about the FX.php_List mailing list