nav-left cat-right
cat-right

Reasons Why You Shouldn't Write Things Like "Top Ten Reasons Why PHP is Better Than ASP"

Morgan was trolling newsgroups the other day when he stumbled across a fun flamewar going on in microsoft.public.dotnet.framework.aspnet. Someone started a topic based on an old blog post entitled "Why PHP is better than ASP". If you read the ensuing thread on the newsgroup, you'll discover why I never read newsgroups. It's like sawing off the top of your head using a dremel and putting rabid Portugese Man-o-wars on your brain before arc-welding your skull back together. I'm pretty sure that jellyfish can't get rabies, but it makes my analogy more accurate.

Dubious literary merits of top-ten lists aside, I thought I'd re-post the list here. Then I thought I'd make fun of it and finish with a life lesson about how cheerleading for a technology is rarely worth the effort, unless you're getting personal kickbacks.

10 Reasons Why PHP is better than ASP

1. PHP.NET the greatest API resource known to MAN
2. If you have a problem, someone will have already implemented a solution in PHP for you
3. Syntax is better, closer to C, C++, and Java. Unlike VB where anything goes.
4. To run ASP you need IIS on windows, which is not free, for PHP however you need linux and apache which are FREE!!
5. Great built in support for ftp, email, graphics package GD2 and also MySQL (also FREE).
6. PHP will run on Unix, Linux, Solaris and Windows. ASP is mainly only Windows associated but you can use it on linux with additional modules installed.
7. PHP code is much faster, ASP is developed on the COM based architecture, this is an overhead for the server.
8. mod_rewrite, need I say more.
9. Advanced Perl-compatible regular expression functions and loads of built in support for regular expressions on the whole.
10. Greater control over error handling, and more detailed error messages.

My god! It's full of assumptions with no real data backing the arguments whatsoever! I am absoultely SHOCKED to find something like that on the internet!

Sarcasm aside, I think the author was just trying to say how happy he was with PHP. I can't fault him for that. Letterman has shown us that sometimes you have to really stretch to fill out a top ten list too, so I'll cut him some slack there. He probably just wrote down a bunch of stuff that his overall PHP programming environment did better than his old ASP one. But if you're going to promote something at the expense of something else, you should try to have your arguments straight. So let's burn it down:

1. PHP.NET the greatest API resource known to MAN

I like the php.net site as much as the next PHP programmer, but I'm going to go with Kip here and say, "Nobody can know that, Napoleon." I'll agree that the PHP site offers much better reference than anything I can find for classic ASP, but it's a bit of hyperbole to say it's the greatest API resource ever. It's a decent point, and I award honors for enthusiasm, but it's not really a concrete reason as to why the PHP language is better than the ASP language.

2. If you have a problem, someone will have already implemented a solution in PHP for you

That's not a reason why PHP is better than ASP. That might be a reason why the PHP community is better than the ASP community, but it says nothing for the language itself. All this can tell us is that there are likely more PHP users than ASP users. By this logic, C and C++ are 'better' than PHP.

3. Syntax is better, closer to C, C++, and Java. Unlike VB where anything goes.

Half-point for this one. If we're talking classic ASP, PHP is certainly more palatable, at least to me. But syntax is a subjective topic (which is why some people still use Perl. Hah! Low blow.) PHP isn't a walk in the park either though. One of PHP's downsides is that the core functions were put together a bit willy-nilly (some string function start with "str_", while some are just "str"), so often a programmer has to go to the documentation just to find out a function name. And keep in mind that at the time classic ASP was being compared to PHP, it was PHP 3 that most people were using. Go back to that baby and find out just how much better the newer PHP versions are!

4. To run ASP you need IIS on windows, which is not free, for PHP however you need linux and apache which are FREE!!

A for effort, D for results. If you were really using classic ASP without using Windows (IIS is free with Windows), then how about Apache::ASP? It's been around since 1998, eight years before this guy's post. This would be an argument for the cost-effectiveness of a language, not for how good the language is.

5. Great built in support for ftp, email, graphics package GD2 and also MySQL (also FREE).

I agree with this. PHP comes with a much better set of default functionality than classic ASP.

6. PHP will run on Unix, Linux, Solaris and Windows. ASP is mainly only Windows associated but you can use it on linux with additional modules installed.

I can only offer a rebuttal here from the point of view where both PHP and ASP are being used to serve web pages, and in this case his point isn't a real argument. To serve PHP web pages, you need to install a PHP module for your web server (the typical install), or a web server that handles PHP natively (none exist that I'm aware of). To serve ASP web pages, you need to install an ASP module for your web server (Apache::ASP), or a web server that handles it natively (IIS, UltiDev Cassini*). It's the same thing in either case: you have to install or modify a web server to serve pages for your chosen language. This is really a platform consideration, not a language consideration. You can't make this comparison for standalone PHP (such as the CLI) either… it would be like saying C is better than PHP because I can make desktop apps with C. You're comparing different tools in that case.

7. PHP code is much faster, ASP is developed on the COM based architecture, this is an overhead for the server.

Likely, but debatable. PHP is an interpreted language, which means that your web server has to load in the interpreter and all the required libraries each time it uses PHP. Just like a web server would have to load in the COM libraries each time it wanted to serve some ASP. So… got any benchmarks? Because my dad is faster than your dad.

8. mod_rewrite, need I say more.

This is a junk point and quite irrelevant. mod_rewrite is a feature of Apache, not PHP. If you don't like the features of IIS, use something else. Did I mention Apache::ASP yet?

9. Advanced Perl-compatible regular expression functions and loads of built in support for regular expressions on the whole.

Huh? I admit, I've never done any classic ASP regexp work, but a simple Google search resulted in this article on VBScript regexps. Looks pretty much like the standard "advanced" Perl regexps to me. I can get behind the "built-in support" aspect of the comment, as it looks like you might have had to write your own ereg_replace-style functions, but it doesn't look like ASP is lacking anything in the regexp-engine department.

10. Greater control over error handling, and more detailed error messages.

Disagree. PHP didn't get decent error handling until PHP 5, by which time classic ASP had been replaced by ASP.NET, so you'd want to compare those instead. Building an error-handling structure in PHP back then would have been about the same amount of effort as building one for a classic ASP application.

So, in summary, newsgroup arguments suck. Why would someone post a year-old argument about to a newsgroup that's not even on topic (classic ASP is not ASP.NET)? Whatever the reason, the resulting flamewar on the newsgroup is proof for one of my favourite sayings: "Think of just how stupid the everyday median person is… and then realize that half of them are stupider than that." Average newsgroup poster's intellect aside, cheerleading PHP in this kind of way generally just leads to all the nay-sayers pointing out how crappy most of the PHP code out there is, and PHP is still fighting this kind of image. If you were writing a professional application, some of these points might be useful in an overall comparison of system architectures, but as far as distinct language differences go it's a pretty fluffy list.

PHP is my favourite language. I personally would never use classic ASP over PHP for a web project, but that's not because of any significant language difference, claimed or real. None of the points in this guys list prove anything about either language, and are really just unsubstantiated ponderings on his own personal experience. That's fine, as long as you don't draw any conclusive results from it! I'm sure the guy just wanted to express his new-found satisfaction and personal appreciation for PHP in a catchy form, which is great. Have hammer, everything looks like nail, etc. However, judging by the ridiculous newsgroup activity, the author would have been much better off writing something like "I like PHP better than classic ASP because setting up a complex search-engine friendly PHP application using Apache and mod_rewrite is easier and more cost-effective than setting up a similar ASP application using IIS". His points would support that statement much better, and I would agree with him wholeheartedly!

  • Digg
  • del.icio.us
  • DotNetKicks
  • Slashdot
  • StumbleUpon

4 Responses to “Reasons Why You Shouldn't Write Things Like "Top Ten Reasons Why PHP is Better Than ASP"”

  1. morgan says:

    While the troll that started the thread really doesn't deserve this much attention, it does seem to lend significant weight to this blog's existence, especially considering the half-baked responses.

    I will throw one thing out there… Microsoft could have avoided some confusion by calling ASP.Net something other than ASP. But .Net 1.0 came out ages ago… in this day and age, who even still talks about classic ASP? I was pretty surprised to see that the original blog post was from as late as 2006.

  2. UltiDevEr says:

    Quick clarification: UltiDev Cassini Web Server (www.CassiniWebServer.com) does not support legacy ASP – only ASP.NET starting with version 1.1.

  3. blake says:

    Good call UltiDevEr… a bit too much copying and pasting on my part while I edited my ramblings. I'll slap a strikethrough on that, thanks.

  4. Andrei Rinea says:

    @morgan : Initially ASP.NET was internally called XSP but in the end the marketing decisions made it "ASP.NET". XSP would have been better.

Leave a Reply