Why PHP is better than ASP
When I moved jobs, like most people I had to learn a new language. Lucky for me my boss was one from the modern era who was capable to understand that learning a new computer language for a programmer is not a major obstacle. I’ve had so many interviews in the past where they ask “so do you know xxx language”, and my reply being “no, but it wont take me long”, and still they refuse to hire me because of time needed to train. Nonsense! It takes most programmers at most a week to have mastered a new language!
Anyway rant aside, the new language I learned was PHP, in a sense learning php is more like learning a new framework; Linux, Apache, Mysql and PHP commonly known
as LAMP. After using it for a short while I realised all the time I had spent in the darkside was wasted! Here is why:
10 Reasons Why PHP is better than ASP
- PHP.NET the greatest API resource known to MAN
- If you have a problem, someone will have already implemented a solution in PHP for you
- Syntax is better, closer to C, C++, and Java. Unlike VB where anything goes.
- To run ASP you need IIS on windows, which is not free, for PHP however you need linux and apache which are FREE!!
- Great built in support for ftp, email, graphics package GD2 and also MySQL (also FREE).
- 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.
- PHP code is much faster, ASP is developed on the COM based architecture, this is an overhead for the server.
- mod_rewrite, need I say more.
- 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.
It would be fair to say that ASP (although some companies will continue to stand by this for a long time I’m sure) is almost extinct and a fairer comparison would be PHP vs ASP.NET, which hopefully I will do next.









Jeannette said,
April 24, 2007 @ 1:53 pm
I love your no-nonsense honesty about PHP… For years I worked with some developers who said ASP was absolutely the way to go, and that PHP was rubbish because it sucked up system resources, so it’s very interesting to read that “PHP code is much faster, ASP is developed on the COM based architecture, this is an overhead for the server.”
molotov said,
August 3, 2007 @ 4:08 pm
I share your sentiment, but I went the other way in my discovery. I started learning PHP with the intricacies of Apache and coupled it with MySQL and got good enough that I am employed for my skills. One of our most recent clients was the Department of Transportation for the state in which I live. The entire bidding system for highways and roads was written in ASP. It was a horrible cludge of code, which for it’s time, may have been great. In about 120+ files and an average of 3000 lines per file, ASP was doing what I could have done in perhaps 50,000 lines of code total, maybe, if I was coding while completely high and not using shortcuts like ternary operators and giving braces their own lines. It was horrible. There were miniature compiled .exes that had no documentation (programmer error, not language fault) but could easily have been replaced with shell scripts on a Linux system.
I was hired to ‘fix’ a problem. I ended up finding the problem and commenting out about 300 lines of superfluous code and replacing it with about 50 of my own. I told the client that I had ‘fixed’ it, but the problem wasn’t ’solved’. She didn’t understand :/
After tinkering with Perl though, PHP seems a bit…odd. PHP is sadly inconsistant with it’s own naming conventions [in_array() vs. isset() - underscore usage] and will employ such ridiculously named functions as mysql_real_escape_string().
anonymous coward said,
August 5, 2007 @ 4:10 pm
sorry but I disagree. I use PHP and quite like it ,and I use asp and quite like it.Each is good and bad. PHP sucks for speed when compared to asp.net that is compiled. in terms of speed though well coded php and well coded asp are about equally fast. Badly coded php is just as slow as badly coded asp!
Equally. PHP works well with mysql - true. but works badly with anything else - (ever trying connecting to a database in php on windows without using a dsn!!!
Equally mysql awful to administer (don’t get me started on the sluggishness and awfulness of phpmyadmin!!!!)
php is closer tgo c/c++ in terms of syntax. that - to me it’s biggest downfall. all those curly braces…. what a nightmare. not as easy to read and understand as vb based asp (IMO)
point number 2… someone will have already done it in php, yeah true… but equally true of asp also!
to run asp… you do NOT need windows… asp has happily worked on apache for years and years - I first used asp on apache around 10 years ago.
point 5: true, very true… php does excel over asp in that regard.
Josh said,
August 5, 2007 @ 9:49 pm
Hello,
I love the comparison! I am a novice PHP programmer and would love to check out the PHP .NET, anybody know where i can find that?
frozensage said,
August 5, 2007 @ 11:28 pm
I don’t think it’s fair comparing ASP with PHP. PHP is ongoing where as ASP is an old technology. It’s like comparing winxp with win 98, you can do something on both platform but it’s much better to do it with winxp. I think vb.net and php is more of a fair comparison.
lord said,
August 5, 2007 @ 11:28 pm
even though your arguments are good, i can say that the tools for developing ASP.NET code are way more better than any for php
and for your information ASP.NET can be written in C# so I guess there goes number 3
also, number 5 is bogus, ASP.NET has all that except mysql but you can connect to mysql so it’s kind of resolved
Ken said,
August 6, 2007 @ 11:53 am
“It takes most programmers at most a week to have mastered a new language!” ??
Are you serious ??
Neossian said,
August 6, 2007 @ 9:24 pm
Hardly no-nonsense, everything in this article is opinion. Half of the points refer to Apache functions, not PHP, Apache will install on windows and run ASP (to a degree). The other half are moot, IIS is free if you already own windows, will connect to MySQL, run ftp etc. mod_rewrite does rock, but once again, unrelated to php.
Keyser Engelberth said,
August 6, 2007 @ 10:24 pm
Gr8 news!! to find people that understand the php concept. Php has now began to revolution the OOP, We’ve got now PHP6 object oriented check this out http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html
zach said,
August 7, 2007 @ 12:22 am
I live by PHP. a friend tried to talk me into learning ASP.NET, but after all the effort i went through just to install it, I was already over it. PHP is king. MySQL is Queen.
den said,
August 7, 2007 @ 3:56 pm
PHP Foreva !!!
pcdinh said,
August 7, 2007 @ 5:30 pm
ASP is behind the times technology. Only poor programmers can use ASP to do their jobs because they don’t want to care where current technology world will advance.
Please have a look at http://pecl.php.net/packages.php to see unlimited possibility of PHP.
Sumo Wrestler said,
August 13, 2007 @ 6:18 am
#2; just because a language is more popular, doesn’t mean it is better!
#4 and #6 are self contradictory!
#8 mod_rewrite is an apache module and has nothing to do with PHP!
Despite these fallacies in your argument, I agree that PHP is a way superior language to VisualBasic! Unfortunately you make a poor argument for it. Try operating on binary data files with Visual Basic. Yikes! Try doing anything with arrays in Visual Basic. Double Yikes!
pcdinh said,
August 13, 2007 @ 7:28 am
@Amir
You said: Visual Studio is one of them. How many PHP editors are out there that can match Visual Studio.
My question: How much have you paid for Visual Studio? Have you tried Eclipse PDT (PHP Development Tool).
You said: My experience with mySQL is that it’s harder to code and you may often need support for it compared with MS SQL.
My question: I have used MySQL for 4 years and never need support from MySQL AB. Of course, there are several times I asked about some bugs of MySQL and got the questions quickly. MySQL is very developer friendly and super fast. MS SQL is too expensive and works on Windows only.
.NET is built for application developers who do not need to have any web development experience. I have met a lot of ASP.NET developers and found out that they have little knowledge on web platform, http protocol but they are competent on drag and drop. Without VS.NET, they are very junior programmers.
ASP.NET is not a good web framework. It is desktop-oriented framework. WebForms is bad in term of web standard. VIEWSTATE/postback is bad in term of performance and SEO. A pure ASP.NET application with tag soup dot aspx and code-behind is considered harmful in term of maintainability. Many PHP frameworks are superior than ASP.NET in terms of architecture such as Zend Framework, SolarPHP, CakePHP, Symfony. ASP.NET is not MVC framework. It is actually Visual Basic framework on the web.
ASP.NET is faster? No, give me your benchmarks. ASP.NET is compiled? PHP can be compiled too. Use APC, XCache and give me your response.
ASP.NET is not bad. It is only out of dated or at least, it is behind PHP evolution.
Amir said,
August 13, 2007 @ 8:06 am
If coders that you have meet before are beginners if they don’t use drag and drop then it doesn’t make the framework or technology bad. There is nothing wrong with drag and drop if it makes you to produce result faster. Why taking the hard way? You can start writing you code in assembler if you like! Why not develop you project in high level languages?
In many cases you don’t have much time to spend on the project. Second many serious companies doesn’t care if pay small amount to buy a development tool. Since if you produce more then you will cost less for them. If you buy MSDN-premium it will cost about 2000 Euro/Year and you will have EVERY THING you need for developing on the platform. That is about 3 day’s professional work. In my opinion it is worth it and you’ll work more efficient. I’ll like the why how many people gets blind of technologies since it’s free. The cost of tools is nothing compared to projects magnitude and you don’t buy it for each time you are in a project. Another disadvantage of Open Source in general is that there are so many technologies that make the same thing that it make the choice difficult.
Take PHP compared by Java JSP technology. Letting commercial companies take care of development makes it safe for developer since you don’t want to learn a platform that you don’t know if it has any future. Take technologies such as PEARL. How often is it used now days? There are actual more MS IIS in the world that Apache server. There it goes for Apache fans. I hope that there are always other technologies than only a single one. Since it will create more competition between the technologies and companies. Perhaps there will come something good out of it. But having the argument that IT IS FREE won’t last for ever. As a developer you need robust technologies. Same goes for companies.
my blog is devZebra.com.
RonnyZenn said,
September 10, 2007 @ 11:04 am
I used to code with both ASP and PHP but in some point i just thought it’s enough to be so dependent on microsoft and switch to PHP permanently.Apart from development variables, i think the best thing about PHP is there’re millions of resources out there but when it comes to ASP, you nearly have to pay for everything or you just can’t find any answer.
But there’s also a good point of ASP, if you’re not actually a programmer and don’t want to spend so much time learning the principles of it but just want some kinda dynamic site you develop yourself, ASP is the way to go. As VB itself, ASP is also a very simple language to learn for beginner. However with PHP it might be a bit more complicated. For me the case was opposite as I started to program with C/C++ then start to use VB and VC
Niko Bellic said,
October 26, 2007 @ 3:34 am
the best part is that php is so over-used (that’s a good thing) that solutions already exist. With asp (which I still love) doing anything means having to re-invent the wheel.