Monday, April 10, 2006

PHP vs. ASP.NET:

Making the Choice

Without assuming you've already decided to go with PHP, I'll conclude that its strengths far outweigh its weaknesses. (See the summary in Table 1.) It boils down to price, speed and efficiency, security, cross-platform applicability, and open-source opportunity. Its only weakness is its lack of a pure and perfect OOP implementation; however, this is a minor drawback. Though language constructs do help, ultimately, good coding is a matter of practice, execution, good habits, and discipline.

Table 1

PHP 4 PHP 5 ASP.NET
Software price free free free
Platform price free free $$
Speed strong strong weak
Efficiency strong strong weak
Security strong strong strong
Platform strong strong weak (IIS only)
Platform any any win32 (IIS only)
Source available yes yes no
Exceptions no yes yes
OOP weak strong strong

Price. Here, we must consider not simply the price tag of the initial investment, which, in the case of PHP, is obviously free, but also the implementation, maintenance, and debugging costs. In the case of PHP, you may invest in the Zend optimization engine. With ASP, however, you're investing from the very beginning, and you're spending for add-on technologies—libraries for doing graphics manipulations, for instance. But, in the long term, PHP isn't going to press you to upgrade and collect more licensing fees. Everyone who has dealt with complex licensing also knows that companies spend time and money just ensuring they are compliant. Furthermore, you have a difference in response when getting bugs fixed. This, of course, translates to time, which translates to cost for overall development.

Speed and efficiency. As I mentioned earlier, ASP.NET is a framework allowing you to use various programming languages. In addition, it is touted as having a great object-oriented model. All this is true, but it becomes a detriment as far as speed is concerned. For all that advantage, there is a lot more code to run through to execute the same ASP page than you have to execute in the PHP engine for an equivalent PHP page. PHP is the quick-and-dirty type of solution, the one to get the job done. And though a lot of robustness has been added to it since its 2.0 and 3.0 days, it still retains that core optimized high-speed approach.

Speed is not the only consideration. Memory usage is also important.

0 Comments:

Post a Comment

<< Home