This is a very shallow comparison of my experiences with PHP and ASP.NET
Don’t take this as a religious war or something, the idea is just some basic comparison.
Here is a summary: If you are choosing which technology to use to build an application, use .NET. You will get more bang for the buck. With the same effort you will be able to build a much more rich user interface.
My Disclaimer: Keep in mind there are a lot of great libraries and tools for PHP which I never got to use, I just had a simple PSPad text editor and my handy PHP web site. I really wanted some “Intellisense” style code completion but I could not get it to work with PHP since I couldn’t find a decent IDE (i.e. editor)
However, it all depends on your requirements. For example, if you are selling something that most of your customers will be on a shared linux hosting environment, then why would you use .NET ? A good example is the software Clipshare, which is a clone of Youtube. The sites purchasing this product are mainly shared hosting customers who have PHP but not .NET. And Mono (.NET port on Linux) is not yet stable or popular enough to use.
I did some PHP programming before I started doing .NET fulltime. Before then I couldn’t say much about it, but after working with .NET for a few years now, I have much to say.
.NET does a very good job in handling the whole life cycle. With PHP you have to do it manually. For example, there is no such concept of “Postback” with PHP. This is such a basic thing that you can easily check with .NET to see if the page has been submitted and what button was pressed. For example if your “btnSubmit” was pressed, it will call btnSubmit_Click. With PHP, you have to do this manually. Not to mention how mish mashed your PHP page can be in terms of mixed code and style/HTML elements.
How about caching? I wanted to implement caching with PHP and I had a fun time, I had to check if the cached output file existed, and then if so, then check how old it is, and so on… Yeah okay again maybe there are some nice components already done for this, but I didn’t have to look very hard to do it with .NET, I simply added a CacheDependency on an XML file (or whatever the case was), and BOOM! It regenerated the file whenever necessary.
How about reusable components? With .NET you can create ASCX (Custom Controls) that you can place within a page that expose certain properties and the control itself maintains its state, can have buttons, etc, etc.
How about master pages (i.e. templates) in .NET? Again, super cool reusability! You can create pages with repeatable parts, with headers, footers, all sorts of fun stuff.
I can go on and on… but in general, the more I use .NET, the more impressed I am with it. However, what makes it not-so-practical is how expensive Windows Server hosting is. In summary .NET kicks butt!
Update Oct 8 2008
I wanted to add some more meat to this article based on the comments below I mentioned that getting Windows Server hosting is more expensive.. However, lets look at this in perspective. What’s more expensive – server cost, or development cost? Development cost in most cases far outweighs any particular savings of a Windows license. What this means is even if your application takes two or three times as long to write, then you have lost any potential savings from running a "free" linux box.
Also, I would like to hear about how to unit test with PHP.
.NET offers unit testing via many different frameworks, NUnit probably being the most popular right now. I would like to know how can I unit test in PHP? There is also an extension for NUnit available called NUnitAsp that allows me to test my interface. Another notable extension for Nunit is an automatic database rollback. SWEET! More details to come as time goes by.
You might want to take a look at the LAMM stack (linux apache mysql mono). ASP.NET apps run just dandy in *nix with mono.
Cheers,
Greg
You gotta admit that ASP.NET has one failing. ViewState and WebForms. Fortunately it’s not difficult to replace that monstrocity with your own httphandlers/modules or something like MonoRail, Promesh.NET, ASP.NET MVC (When it comes out), etc.
I have to agree with Lucas, however, advantages of .NET are amazing, development time is so much faster in rich Visual Studio Interface.
Another interesting article:
http://www.prosperwebsolutions.co.uk/blog/2008/04/19/ASPNETVSPHP.aspx
The only thing lacking in the PHP realm is a solid IDE.
PHP does everything .NET does. There is even a very matured framework out there named Prado that is modelled after MSFT’s MVC approach. You can check it out @ http://www.pradosoft.com
Besides the greater argument…Ever heard of Zend IDE?
Also, better bang for the buck??? How much do you expect a LAMP install to cost? A whole lot of nothing. Sounds like a whole lot of bang for NO buck.
Will rant more later..
-W
I am amazed people praise the visual studio development environment. it think it is as clunky as hell.
also the asp.net event/viewstate driven model was a huge leap in the dark: do we really need events to gather information from a webpage?
i have found development timescales (i commision as a manger now) have not shrunk as a result of dotnet, and that maintenance of code has become a greater problem than under scripting approaches.
Hi Will. Total Cost of Ownership is a much more comprehensive way to look at it. Just the installation and hosting cost is not enough of a comparison. You also have to factor in development time, how easy it is to do bug fixes, unit testing, and so on… You made a good point which I did not cover in my article, so more on this topic coming soon…
PHP, in my humble opinion, scores well over ASP.net.
Here are the reasons:
Power to the people: Need simple encryption like MD5/SHA for storing passwords? Buy the library (and spend even more)from microsoft. With PHP, you get it all free.
Need a site in 20 minutes? Try Joomla.
Need a full fledged Shopping cart to run your superstore online? Try OSCommerce.
Need a blog in what? 3 minutes? Give me $50 and I’ll do it with wordpress.
Hey, Lehman Brothers fell big time. What if Microsoft… sorry, I know I went a bit too far
. Don’t see open source falling anytime even in a bad, bad economy.
With Vista now, you must switch to it or your support (patches for virus) will be ending soon for XP. If you don’t switch before the support ends, you gonna fall bigtime. Has anyone heard of support being stopped for Open source?
Same application developed in JSP, ASP and PHP . Result – PHP is fastest.
Highest number of sites in the world are on PHP. Even Yahoo.
Gotta run now, or will be late for office
Sounds like you were comparing little PHP knowledge and experience against ASP.NET. PHP 5 with the right framework (codeigniter for example) will take care of all like caching and reusing code components with one line of code. You argue a PHP project costs more because of a longer development time? Well this just not true. This has nothing to do with the language but the developer. A seasoned PHP developer will known which framework, library, and tools to use making development just as fast if not faster than an ASP.NET project.
I will agree with the fact with PHP you have known where to get a good framework or library to do a lot of the leg work like caching and component re-use where in ASP.NET it comes with it out of the box (or at least the option to buy comes out of the box).
Dave, how would you even be sure that your scripts are all valid? Since they are interpreted, you can’t compare them..
Charles, you are right. I am comparing ASP.NET to my very little PHP knowledge. But apples to apples, a seasoned PHP developer vs a seasoned ASP.NET developer, would you agree .NET development is more maintainable?
For example, with PHP, how would you even ensure that your code is valid? Since its not compiled, how can you verify.. ?
I like PHP5 and I like C#. I am currently reviewing ProMesh.net (C# thing mentioned above) for porting our CMS solution from PHP5 to .NET.
There are cases where a Client insists on Microsoft. In those cases we want a good solution, so C# is our preferred language in those cases.
PHP5 vs .NET, I am a big fan of “strongly typed” languages (C/Java/C#,etc). PHP was at first an issue for myself, I was used to declaring my variables, etc and PHP was lose on variables. Today, I find PHP5+ just crazy cool. It is very flexible and with proper sanitation of user-input it’s safe. I have pages/queries cached and PHP Zend optimized — fast. The .NET side, C# is very nice and with ProMesh, it’s much easier to implement websites. C# is just a great language. (Usage: 90% PHP right now)
Tools…
Using the proper tools, PHP5 does have tab-completion of functions, even custom ones (using PHP doc). Look at Eclipse for PHP and Komodo Edit (and others).
RIA
Ajax or RIA can be done with either C#/PHP (jQuery,Flash,Silverlight).
I am leaning towards PHP for being so flexible.
[...] goes So for me, the clear winner is Wordpress (even though its not running .NET). I claimed that .NET is superior to PHP, however, of course, that does not mean that every single software written in PHP sucks, nor that [...]
I just would like to make a correction of two mistakes the writer has made in the article. First, the first official version of PHP, PHP3, was released in June 1998 by the very small development team at that time. In fact, PHP4 in May 2000 is the first widely known version of PHP. Second, ASP has been widely known and used since December 1996 when ASP1 was distributed with IIS3 by Microsoft, and every one knows what Microsoft was at that time.
.NET vs. PHP is not an apples to apples comparison. PHP + some application framework (some were mentioned above and I like CakePHP) vs. .Net is more like it. You see PHP is a LANGUAGE, where as .NET is an application FRAMEWORK. So PHP should be compared to C#. CakePHP should be compared to ASP.NET.
The thing I was most surprised to read was when the author said, “I couldn’t find a decent IDE (i.e. editor)”. What? I don’t know what the names of the popular Mac IDEs are, but I know I’ve seen some with intellisense via screen casts. For any platform, including Windows, there is Eclipse with the PHP plugin (all free). SVN, TortoiseSVN, and/or Subclipse take the place of SourceSafe and can handle more than source code. Aptana is a version of Eclipse that is perhaps a better web dev IDE out-of-the-box. There are also PHP plugins for MS Visual Studio if that’s what you’re already using! And there are even SVN plugins for MSVS too!
Personally, I think the whole “versus” arguments don’t resolve to a clear better choice. Any web problem can be solved with either solution, or nearly so. It comes down to programmers’ skills with their language(s) of choice. Can the programmer accomplish the task in XYZ language/framework? That’s what matters in the real world.
I did try Eclipse + PHP Plugin but it was a complicated mess and I couldn’t get it to work
Your comments are good. thanks Ryan
For those with the same experience as Sameer, try Aptana. Yes, it’s a big download, but the install is more ‘Windows app-like’. Quite a different experience. I’ve used both. I will also be trying out one of the VS PHP plugins soon at my day job, so I’ll have to see how that compares.
I think the whole debate is just wasting your time. None of the people on both side, knows the opposite side.
Look at Nikhil Narayan :
Power to the people: Need simple encryption like MD5/SHA for storing passwords? Buy the library (and spend even more)from microsoft. With PHP, you get it all free.
!!! Ooops, did you even use .NET framework? It got built-in support for it!!!!
Need a site in 20 minutes? Try Joomla.
.NET: Or try Dot Net Nuke!
Need a full fledged Shopping cart to run your superstore online? Try OSCommerce.
.NET: Or try Dash-ShoppingCart, or Dot-ShoppingCart….
Need a blog in what? 3 minutes? Give me $50 and I’ll do it with wordpress.
.NET Or try BlogEngine.net
This is correct about .NET fanatics as well.
There is one really good thing about ASP.NET and that’s AJAX. That partial page push refresh is killer. It’s fairly easy to develop web based equivalents to my grid oriented desktop application. Now we are looking at WPF so that the desktop applications are just ports of the web stuff. Two implementations with the same code base.
On the other hand I have a bunch of heavy hitter clients using web apps that we wrote in PHP / Apache running on Windows servers. Light weight as far as resource consumption. IDE? What IDE? EditPlus and knowing what you are doing. Emphasis on the latter.
There are some cool tools for PHP now and lot’s of people use it every day. I keep hearing that VB is dead. With Dot Net that’s not so. VB and C# can produce identical runtimes.
For IDE, I’ve discovered NetBeans 6.5RC has great PHP support. Code completion, intellisense, debugging using xdebug which took me awhile to configure on Mac Leopard; but go to Komodo site and download the xdebug binary. NetBeans is free. I’ve tried Aptana, Ecplise + PHP, and Textmate. Now my favorite is NetBeans. For PHP framework, I am amazed by ZendFramework and CodeIgniter, if you are a Ruby on Rails fan. I code in C#/ASP.NET for a living but I am considering PHP for some side projects. Also checkout Phalanger project at codeplex. It compiles your PHP code to .NET bytecodes.
I don’t have strong opinion which is better — PHP or ASP.NET. I’ll use both if it pays the bill. Learn from both camps. Learn a new language every year. Checkout Django and Pinax(it’s nice), and Ruby/Ruby on Rails. Buy a Mac laptop. Great for development. Try mono. See Dekiwiki. It’s a PHP frontend with RESTful .NET running in mono in the backend.
Also checkout these two wonderful opensource projects: Magento is an awesome eCommerce application in PHP/ZendFramework. ELGG is a cool opensocial application also in PHP. The web is alive with excitement! Cheers!
hi
about the php ide, i suggest you to use Aptana, a great free web develop IDE with PHP support.
Thanks.
At work, we use C#, but we now have a need for PHP, so I’ve just bought VS.PHP, a plugin for Visual Studio that supports PHP and includes both the XDEBUG and DBG modules for debugging. It is supposed to have intellisense and many bells and whistles. As mentioned previously, I’ve used Aptana and Eclipse + PHPIDE, so it will be interesting to compare my experience with the new tool.
Hi All,
I use to work on ASP.NET but there are lots of restrictions if I will compare this to the PHP. Just try to get done the code for this requirement in asp.net :
1) I want to trace the E-mail id existence in asp.net , just help me where to find working code or guidelines including MSDN,
2) I want to create a basic domain management tool in asp.net , please help me how to handle DNS in asp.net using vb.net or c# . My basic requirement is to Add / Update and Delete the domain http://www.xyz.com to IIS , want to mange MX Records, A Records using asp.net
3) I want to fetch all the hosted domain ( reverse dns ) on a particular IP address , please help me how to fetch ALL the hosted domains.
there are lots other question, but will put later If I will get answer of my these simple questions.
Hi Mentor. To do these things I would use the 3rd party components at http://www.aspnetpop3.com/examples.aspx
It is possible to do it yourself, but it would be more difficult. My experience with the above controls is it becomes very easy to do any of the above. There are also free code samples on codeproject.com that demonstrate some of the above (DNS management for example).
Well, guys…this very web page is using QuickPress, a PHP based Blogging application…case closed..LOL! Thanks for all your input everyone, it seems for different uses ASP may fit, but I would rather start in PHP so that down the road I help myself out!
Its not quickpress its Wordpress.
I explained why I switched to it here:
http://www.sharpdeveloper.net/content/archive/2008/10/07/net-blogging-softwares.aspx
To me you’re being a bit biased you know.
Well about first thing there are many greate IDEs available for php for instance you may check Netbeans 6.5 which has everything for free, you may also check Eclpise PDT and if you can pay a bit PHP Designer, TSW phpCoder and many other are real strong IDEs with everything you may want to perform under PHP.
Now coming towards life cycle of program there are many professional frameworks available you should consider trying, Zend, Cake, Prado and Code Igniter.
Another clear advantage of php over ASP is its speed, it clearly beats ASP when it comes to speed of website, php is very fast as compared to .net in speed.
PHP do have postback.
About templates you may use so many templating engines which have powerful functionality and of course re-usability.
http://www.delehack.com/book.pdf
i think you got a prob with your design…
even if im really good at reading, i cannot read black letters on dark grey background for a long time, or my eyes start to hurt.
All in all PHP has more open source resources than any other web languages, even tutorials as well.
PHP’s ecosystem is multiple times larger than .NET. There are more tutorials, free libraries, free off-shelf scripts (like Wordpress, Joomla, Drupal, osCommerce, Zencart, Wiki, and many many many more
Many popular big websites are (fully or partially) using PHP: Wikipedia, Facebook, Friendster, Yahoo, Delicious, Youtube, Digg, Wordpress, Tagged, W3Counter, MyYearBook
PHP 5 has made it possible for serious framework like Cake, Zend, Symfony, etc. They are really good, very MVC, very Enterprise. Symfony (used by Yahoo!bookmarks, Yahoo!answers, Delicious) for example has hundreds of free well developed plugins.
IDE? I personally use Eclipse PDT. The new version, Eclipse Galileo is very nice
Eclipse is free, has everything:
- auto code completion (for your classes and functions as well, not just the built in PHP functions)
- syntax coloring, code folding
- SVN and CVS plugin (by the way, the svn in eclipse is way, wayyy, better than Netbeans PHP)
- code validation (yes syntax error checking, xhtml validation, javascript validation)
- debugging with xdebug or other (Zend?)
- integration with server
- integration with database
- Web editor (edit HTML visually!)
- lots and lots of free plugins as well as commercial plugins
Zend Neon a commercial plugin for Eclipse is really good, worth buying if you have the budget. It’s like Eclipse PDT but nicely packaged and has extra nice features.
Eclipse, although open source and free, was created and is used by IBM. I’ve worked along side IBM in a large J2EE project for government. And what IDE did the IBM use? Eclipse!
From what I see, this whole debate can be summed up into the following points made by people in this discussion (if they knew it or not) and many other comments I have read that led me here to this web site’s article:
1. ASP.NET is a clean, easily installed solution out of the box. PHP is a mess of scattered, ad-hoc freeware products that must be combined to achieve the same results, and you’re lucky if you get it working (“add-on hell”).
2. ASP.NET is based on full programming languages that can be compiled into standalone apps, PHP is just a web site scripting mechanism and nothing more. C# is easy to learn, and does everyhting that PHP does and more tenfold. If you wanted to, you could write your own database engine in C# and compile the binaries and run your web site – or company – with it. PHP doesn’t even know what a compiler is and will forever be imprisoned inside a web browser.
3. PHP’s only argument that really comes through in nearly every discussion I read is that “it’s free, so nyah!”. But PHP zealots forget that properly run companies can afford the tools needed to do business adquately, and if you put up a professional ASP site against a professional PHP site, the ASP site is most always far more professional, polished, complete, etc.
4. It is undeniable that putting the astronomical power of a full, mature, compilable language (like C++ and C#) up against a mere scripting engine is like swatting a fly with a Mack truck.
5. The IDE issue: It takes a seasoned PHP “developer” to crank out a web site on par with an intermediate-level ASP.NET developer, and the ASP.NET developer will most always get the work done much faster. The Visual Studio IDE alone allows this to happen, nothing else like it exists for PHP. And the newly redesigned Visual Studio 2010 IDE will only make this comparison even more dramatic.
6a. Microsoft SQL Server against MySQL? No contest, the last two versions of MSSQL even beat Oracle, which proved twice in a row that it was actually possible to get Larry Ellison to shut his mouth. MySQL doesn’t get anywhere near Oracle, let alone MSSQL.
6b. MSSQL has been 64-bit since 2005 (two major versions ago). MySQL is 32-but unless compiled from source by the end user or installed along with a 64-bit Linux distro. MySQL also cannot use multiple CPUs for a single query (a major performance criticism that was just recently removed from WikiPedia). Which database do you want to drive your web site? Out of all the databases available, MySQL is free, but also the weakest and most limited.
6c. Who’s got MSSQL support built-in by default out of the box? (Hint – it ain’t PHP without a going through a lot of reading and/or add-on hell).
7. PHP is cool. VERY cool, there is no argument there. It is more widely used than ASP on a vast scale, and the LAMP infrastructure is easier to set up (only because XAMPP came to the rescue). Why? Two reasons: Linux and price. If ASP.NET were released for free, and worked on Linux, how long do you think the “AMP” part of “LAMP” would last? You’re probably going to find out – keep your eye on Mono, which now has corporate development support, has become quite stable and far more trusted since this article was first written two years ago.
8. ASP.NET is used by serious developers because it is often found to be the best tool for the job when it really matters and where freeware falls short – which is OFTEN. This happens FAR more often than the freeware priests are willing to admit. The number of “Linux only” shops that actually don’t have any Windows infrastructure tucked away in the back rooms but alive and well on their networks are very very few. After 20 years of Linux, market share is still less than 18% in the back room and less than 5% on the desktop. And Mono is growing in the Linux world.
9. “Free” rarely EVER means “superior”, and turning “free” into a religion changes nothing. The whole “freeware/GPL” religion, as demonstrated by the original pushers of OpenSource, is for suckers – just ask Linus Torvalds and all the original Linux rock stars who have long since laughed their way to the bank. Linus Torvalds didn’t have any problems whatsoever getting paid millions for Linux while simultaneously making even more profits by publishing his hypocritical book about the evils of profits and the virtues of the utopian GPL. And don’t think for a second that he’s working for free out of the goodness of his heart today. So how’s LAMP looking so far?
10. Conclusion: The reason PHP is so dominant is that LAMP is what you use when you can’t afford any better, which is pretty much everyone these days, and thus clearly understandable. IIS is more powerful and feature-laden than Apache, MSSQL is far more powerful and feature-laden than MySQL (even Oracle now), and Visual Studio (and any of its associated languages that can be used in ASP) is far more powerful and comprehensive than any little scripting method and its scattered/jigzaw-puzzle/”use the force” development environments. This is why every kiddie project on the net is done in LAMP. The PHP vs ASP.NET comparison, if done accurately without blinders on, is a textbook example of “you get what you pay for”. PHP is an absolutely fantastic solution if budget and platform are your issues. If you’re not limited by those issues, ASP is monumentally better. Quality is not determined by price or popularity. Popularity, however, is usually determined by price alone.
And in case you’re wondering: Do I work for Microsoft? Nope. I used to though, I quit April of 2009. Hated the place, worst place I’ve ever worked. But I do know what I’m talking about.
Highwinder’s assessment was not “done accurately without blinders on” as s/he’d like to think. S/He clearly never developed in PHP using the best PHP tools and IDEs available. A survey of the companies using PHP shows that companies with deep pockets and lots of options still turn to it. Even whitehouse.gov runs on Drupal which is written in PHP. And as for which sites are more professional and polished, I doubt anyone can tell what is running behind the scenes just by looking. Google uses PHP in places, as does Yahoo and many other well known companies.
BTW, PHP is planned to become a compiled language and/or at least be able to be used to create desktop apps. I haven’t checked on that progress in a while.
The characterization of the PHP language as a “little scripting method” shows that highwinder may not have taken formal CS classes in college. There are numerous languages on a continuum where the written language and it’s final state varies. Early languages were very close to machine code and some still are. Others are very high level and almost pseudo code. And the state these are transformed into varies as well. PHP is not the only interpreted language and is not weak just because it is. .NET is not fully compiled either as it uses an interpreter similar to the JAVA runtime. That’s what the MONO project is – making an interpreter for Linux – which MS said it would do before .NET originally launched but failed to complete. As has been said elsewhere, depending on what you’re doing PHP often runs faster than ASP.NET. I’m sure in other cases the reverse is true.
Highwinder bemoans the religiosity of open source advocates but comes off just as “religious” in opposing it. PHP developers wouldn’t make livings if the tools and methods were so out of whack in comparison to ASP.NET – and highwinder admitted there are more PHP devs than ASP. Putting quotes around “developer” doesn’t make them any less developers than those using ASP.NET. In fact, I have known many .NET devs who couldn’t program a recursive function or explain how pointers (in C++) work if their lives depended on it and languages like Python or Lisp would confuse them.
There are a lot of factors that go into selecting the tools that a particular job will be completed in. Price is one, support is another, ease of knowledge transfer another, and so on. Why can’t people just accept that both PHP and ASP.NET are the correct tools for certain jobs and certain conditions with considerable overlap?
> PHP is an absolutely fantastic solution if budget and platform are your issues.
So choose PHP is you want cost efficient solution without vendor lock down? Got it!
Actually my assessment is quite accurate, all of the points above can be looked up on Wikipedia alone or personally verified by going to the vendor sites and studying features and stats. I can handle being hated and spit on, but I do my best to ensure that I’m hated for being accurate, not wrong.
To wit:
C#, VB.Net, etc (ASP.NET) is vastly more robust than PHP. To dispute this is idiocy.
MSSQL is vastly more robust than MySQL.
IIS is vastly more robust than Apache.
Additionally, they are all far more well-integrated with each other than LAMP and the results are visible on screen.
Argue it any way you want, but the fact remains: LAMP has absolutely no technological advantage and is nothing more than the “cheap alternative”. “Free” is the only leg LAMP has to stand on, especially when every development tool for the LAMP stack is also freely available for Windows, but supreme Windows-only tools from vendors like Borland, Embarcadero and InstallShield are NOT unavailable to *NIX (what was that about “vendor lockdown”?).
Again: you get what you pay for.
Highwinder,
In real world, practicality trumps idealism. You might think that ASP.NET is more robust and to the point calling anyone disputing it to be idiot. But the market is more practical, and they tell a different story, and a story I can relate to as a business owner.
Look at this graph: http://www.search-this.com/2007/06/27/microsoft-iis-vs-apache-who-serves-more/
50% of the top 20 companies use IIS. But 50% of the top popular websites use LAMP.
60% of web servers in the world run on Apache. Facebook serves 400 Billions PHP page view a month.
Most of your points about LAMP are inaccurate. I have no time explaining them but you could Google them up (or Bing them). You can argue and b*tch all you like, but I used to use IIS+ASP/ASP.NET and I’ve worked as J2EE developer. LAMP is the best for overall productivity, interopability, and cost for small to medium business, that’s the fact and the market tells this exact story.
Your whole argument is based on “it’s popular so it’s superior”, which is just stressing the point I previously made – it’s only popular because it’s free, period. It has nothing to do with technological superiority.
“50% of the top 20 companies use IIS. But 50% of the top popular websites use LAMP.”
Yes, let’s take a look at those numbers and take price out of the picture:
With ASP/IIS/MSSQL being as expensive as they are while still dominating the Fortune 1000 and 40% of the web servers in the internet, how do you think those numbers would change if ASP/IIS were given away for free?
Don’t be too enamored with Facebook – according to Facebook, only the front end servers are powered by LAMP – the whole backend is vastly more complex, and mostly written in C++ and Java.
“60% of web servers in the world run on Apache. Facebook serves 400 Billions PHP page view a month.”
Both moot points: price alone is the reason.
“…Facebook serves 400 Billions PHP page view a month….”
Anybody, no matter what technology they use, can handle hit rates like that if you throw enough servers at it. However, if you want to discuss the clustering capabilities, 64-bit architecture, queries-per-second, queries-per-processor efficiency, self-tuning, unlimited file sizes, etc. of MSSQL vs MySQL, it will certainly be entertaining, especially comparing how many MySQL servers are required to handle the same load MSSQL does – and IIS vs Apache would be about as entertaining.
It’s very true that LAMP dominates the general internet – 95% of the web sites out there require nothing more than “quick, cheap and dirty”. All the LAMP-based social networking sites out there merely absorb twitter posts all day long and do little else, so ASP.NET/IIS could certainly be overkill in many cases.
But IIS/MSSQL/ASP.NET dominates the Fortune 1000 for reasons that go far beyond LAMPs featureset.
Final point: Imagine waht Facebook could do and look like if it was based on an ASP.NET/IIS/MSSQL platform – it would skyrocket to SharePoint quality/capability instead of looking and behaving like exactly waht it is – a glorified Drupal site.
No, my argument is not “it’s popular so it’s superior”. LAMP is the perfect overall solution for small to medium business and that’s why it is popular, not the other way around.
I said it is perfect because it is within the budget and it meets the business requirements (it does what most small to medium businesses need).
I’d say open source solution is superior, not because of it’s price, but because of it’s openness and community collaboration. But I don’t have the time (nor motivation) to elaborate, hence I won’t argue that point here.
“Yes, let’s take a look at those numbers and take price out of the picture:”
You can’t take price and licensing from the picture. Price and licensing are two very important part of business. IF ASP.NET is open source and without string attached (that would be a real big IF!), it could have been more popular, may be, but that’s pure speculation.
“according to Facebook, only the front end servers are powered by LAMP – the whole backend is vastly more complex, and mostly written in C++ and Java.”
I know Facebook don’t use PHP for everything, but they did say they serve 400 Billions PHP page views a month. They certainly are not using IIS, they use open source solution.
Most of your arguments are imagination and speculation, e.g.: if ASP.NET is as free as LAMP, if money doesn’t matter, etc, etc.
For me I’ll accept the facts. That Facebook, Google, Yahoo, and plenty of other popular top websites are successfully running their business with LAMP. Also the fact that most small medium businesses go with LAMP and become successful.
I don’t have problem accepting that ASP.NET and Java are dominant in the corporate world. I’ve worked in the corporate world, I know they have different requirements than most small to medium businesses.
Yes, speaking of the market dictating the winner, let’s look closer at this as you suggest:
“Apache runs 60% of the world’s web servers.”
Actually, it’s now down to only 54%.
I remember back when it was over 85%.
According to market determining relevance, Apache’s tanking while IIS continues to grow at 30% when it used to be virtually zero.
On-going market trend seems to suggest I have chosen my platform wisely, but for the sake of humility, I will simply call it “luck”.
Stats are only indicative, and it depends on which one you pick. But unanimously, Apache is still the king of the web server hills quite significantly.
One factor that contributes to Apache slides is probably because these days more and more production environments use Nginx or lighthttpd.
Then there is security thing about hiding what’s behind the website to prevent automated attack.
I will also say that IIS 7 is going in the right direction from what I read (mostly by doing things the Apache ways like text file for configuration, distributed configuration, and more). Also Microsoft has been working with Zend to improve interopability for PHP in IIS.
I did not choose any platform, I have done and can do both Microsoft way and open source way (and Java way, and soon will learn iPhone app development as well).
Although personally, from my experience, I would say that for small to medium business, that Apache is significantly superior to IIS.
Talking about trend, open source is the new trend since the last few years. So I don’t think you have chosen that wisely
You should at least learn open source as well …
I never said I didn’t know open-source. Most of my non-web work is Java-based, and I absolutely adore Linux (SuSE to be exact) though I use the magnificently “looks like a million bucks on screen” proprietary InstallAnywhere to create my distro packages instead of using hideously outdated methods such as tarballs and RPM packages (I include YUM in that list too – YUM is the direct evidence that Linux suffers “DLL hell” even worse than Windows ever did – library management in *nix is an abysmal mess). Sometimes freeware just doesn’t cut it, and sometimes not by a long shot. Ever seen a GUI InstallShield package install a package on a Linux app? It’ll bring a tear to your eye. Past versions of Sun’s NetBeans used Java-based InstallShield (NB v5 did), and it was beautiful to see on the screen in Linux. That product is now called InstallAnywhere. Whenever someone sees one of these installers, they immediately start jealously drooling. And I stress this statement with all of my spine – there is nothing like it in the freeware world.
To get back on track, there’s no question about Apache’s popularity, I have used it many times before. It’s what I use when I’m being lazy, cheap, or stuck in *nix. I never said “Apache sucks”. What I do say is that Apache is limited and IIS does it all. The main focus of this conversation is PHP vs ASP.NET, and there is no comparison to what can be accomplished with ASP.NET vs PHP. Does Apache do PHP? Of course. Does IIS do PHP? Of course. Does Apache do ASP.NET? No, not even with Mono – that sound you just heard was the sound of screeching tires and breaking glass.
PHP is a great but limited solution that fully illustrates “you get what you pay for”, including the web server it typically sits on. PHP is not for people/companies that require more out of web technology. As the web gets more and more complex, you will see Apache and PHP fall futher and further behind (as it has been doing for years despite continued development, which recently has been at a snails pace, not including the plug getting pulled on PHP6 for a do-over). You will also see IIS/ASP.NET continue it’s advances into web dominance, just as it has been doing for years.
With increasing relevance, and certainly in my line of work, “good enough” just doesn’t cut it, and that difference is seen on a paycheck.
Excellent discussion. I think though, that its just like buying a car. What’s better? BMW or Audi? Toyota or Honda? To be honest, each has its strengths and weaknesses. We cannot say that one is absolutely better than the other. No, they have pluses and minuses. You have to look at the requirements and choose based on that.
Cheers!
“InstallAnywhere to create my distro packages instead of using hideously outdated methods such as tarballs and RPM packages”
Ever tried Aptitude? Every tried .deb?
“PHP is not for people/companies that require more out of web technology.”
Sigh … here we go again, rhetorical bull: Facebook, Yahoo, Flickr, Digg, SourceForge, istockphoto, Wikipedia, and many more large popular websites are running LAMP. I guess they don’t require more out of web technology huh?
The strength of LAMP is its scalability. It has solid proven track on that. ASP.NET might be a better programming language, but IIS/ASP.NET just doesn’t scale well. Scalability requires fine tuning, lots of it, sometimes recompiling the web server, something IIS/ASP.NET does not offer.
Zend reported in 2002:
“PHP Overtakes Microsoft’s ASP as Web’s #1 Server-side Scripting Language … Prominent corporations using PHP today include Cisco, Worldcom, NTT DoCoMo, CMG, Vodafone, Motorola, Siemens, Ericsson, CBS, Unilever, Philips, BMC, NTT, Air Canada, JAL, Lufthansa, OnVista, Lycos Europe and Deutsche Bank.”
(Well now in 2010 it is still #1 most popular)
“You will also see IIS/ASP.NET continue it’s advances into web dominance, just as it has been doing for years.”
It might be (or not) dominant in the future, but right now I just don’t see it happening. It’s pure speculation.
Seem like you keep saying it to entertain yourself.
“ASP.NET might be a better programming language…”
This was the main subject of the article. Therefore, I rest my case.
Hi Sameer,
Yep, there is not a single tool that can solve all problems. LAMP just happens to provide solution for the bigger market (small-medium businesses). Hence it is very popular.
And the popularity brings large community, in return the community enhance the package even more.
Closed source tend to have the components packaged more nicely and have better interoperability because they are more controlled. Closed source usually offer better integration with IDE. But when you need to fine tune the package, Open Source provides the flexibility with its open nature. This is why LAMP is hugely successful, because this makes LAMP very scalable.
For example, with LAMP, you are free to recompile Apache to suit your business needs. You can remove many of its components to bare minimum for speed. There are so many more things you could do. Why? Because it is open source and it gives you the freedom. With IIS, you better have a good lawyer to find out what you’re allowed or not allowed to do.
This fine-tuning is VERY important to any web business. No solution is out of the box ready for large traffic website like Digg. They all need to be fine-tuned.
For hobbyists at home, LAMP is also appealing because it is simple. Just use notepad, PSPad, Netbeans, or Eclipse.
With ASP.NET, unless you use Microsoft’s IDE, it’s too complicated.
This and other reasons makes LAMP the most preferred solution for web and that’s why LAMP is leading the market.