Benefits of PHP Frameworks

January 15th, 2012

Working with PHP Frameworks usually makes going live with a site much easier, primarily because the simplicity in using PHP sometimes acts against it. Since there are very few coding restrictions, developers tend to write a bad code

Some of the primary advantages of using a PHP framework are:

  1. Finish coding faster: Frameworks help the developers to write code in a shorter amount of time. In startups, time is is money, and money is in short supply. Not working with a framework means you reinvent the wheel every time.
  2. Coding consistency: The MVC code is easy to write and also follows the code restrictions. Due to a uniform and standard coding, things are simpler and bugs can be resolved faster. This also makes maintaining the code easier when multiple people work on the project or one developer initially writes the MVP and someone else has the responsibility for adding functionality.
  3. Code Recycling: By using PHP frameworks in web development, most basic features are almost same, and thus you can recycle the code (modified if necessary) of any module in different projects.
  4. Reliability: PHP frameworks already run millions of applications. They have been tested and proven, giving your application a very solid foundation.
  5. Debugging: PHP frameworks have their own specific debugging methodologies that allow you to easily identify errors in your development.
  6. Community Assistance: You can always ask for help in the very active framework community.
  7. Capability/Functionality: The frameworks have numerous functions that have been developed to assist in developing your application. There are functions for handling date formats, database connections, handling emails, editing strings etc. You no longer need to manually enter all the validation criteria for forms etc. You merely instantiate a new form validator object and instruct it as you wish. The framework will handle the rest.

An important consideration though is that Frameworks are for experienced people. Rails has the same problem, but maybe in even worse form, as most Rails coders have their first exposure to Ruby through Rails and not starting as a Ruby developer.

The bottom line is that frameworks considerably speed up the development of an application and contribute to a greater ease of maintainability and the adding of functionality.

PHP Frameworks

December 19th, 2011

There has been an explosion in the number of PHP frameworks over the past several years for use with PHP. This coincides with the explosion of the use of PHP in web development. PHP is easy to learn and was designed as a language specifically for producing web pages. This means that choosing PHP as your implementation language allows you to build a dynamically-generated web site quickly and easily.

However, coding in PHP, or most any language, can get repetitive when the same task is coded time after time. This results in lost productivity and the possibility of introducing coding errors. This is why frameworks have been built.

A framework streamlines the development of web applications by providing a basic structure. They promote rapid application development (RAD), saving time, money and providing the ability to get a product (maybe MVP for a lean startup) to market faster. A framework also helps build more stable applications as framework code, once it is developed, thoroughly tested and subsequently used, doesn’t require the same amount of testing each time it is used as a newly built application. Frameworks can enable you to get increased productivity and coding reliability from junior developers, which can result in reduced development costs and allow you to spend more time creating the actual web application rather than writing the same code to do common functions time after time.

The general concept used by a framework is the use of a Model View Controller (MVC) architecture. The basis of the MVC architecture is to isolate the business logic from the User Interface (UI) and the input logic while providing a loose coupling between the elements. In MVC, Model refers to data, View is the presentation layer and the Controller receives user input and initiates a response. The use of an MVC architecture allows you to work on individual components of an application while leaving the other elements untouched.

As I mentioned, there are many different frameworks, some of the most widely used being Zend, Symfony, CakePHP, CodeIgnitor and Yii. You can even create your own. However, you should always examine your project to decide if you should even use a framework. Will the framework save the development team time and effort? How will the app perform? Will the framework improve application stability? If so, a framework should be considered.

In a future post I’ll discuss the advantages and disadvantages of using PHP frameworks in greater detail.

Joomla vs Drupal vs WordPress

October 7th, 2011

All three of these are solid Content Management Systems, although WordPress is a relative newcomer to the full-blown CMS fight, having started out focusing on blog support.

They all have rabid, fanatical users, great communities and many, many addons or plugins.

They all have some things they do a little better or a little worse than the others. They also have a tendency to leap-frog each other in features and functionality from release to release.

The bottom line is that I think you can develop a great site in any of the three, but I think I would limit the choice to Drupal or Joomla.

General strengths and weaknesses of the two are:

Joomla

Joomla is designed for the masses, has a nice visual interface and is extremely popular. As stated previously, there are numerous plugins and a very active community of Joomla users.

However, not all of the plugins are of high quality and security is a bit of an issue. Layout and presentation are also a bit limited.

Drupal

Drupal is the most technically advanced of the three CMSs discussed. It was designed for security, speed and performance. Layout and presentation are less limited, but a higher degree of skill is needed to obtain that degree of flexibility.

This flexibility comes at a cost as it is known for being more difficult to learn and support from the community is weaker than Joomla and WordPress.

In addition, two key areas that would concern me the most are stability/performance and security. The links below, from fairly recent reviews, would lead me to believe that Drupal provides better performance and that with the incorporation of ACL in release of Joomla 1.6 security would be a toss-up.

http://sven.webiny.com/benchmark-webiny-vs-wordpress-vs-drupal-vs-joomla-vs-tomatocms/

http://www.a3webtech.com/index.php/compare-drupal-v-joomla-cms.html

However, these performance advantages are with extremely high loads so they may not be that important.

To me, the bottom line is that either Drupal or Joomla will work well in a fairly sophisticated site. There are certainly pros and cons to each and there will be supporters and detractors on both sides, but I don’t think you can go wrong with either one.