There is no cause for name calling lazy_yogi. Straterra made a valid point that in a PHP forum you are going to find people who have already made some type of decision that they prefer PHP to ASP.
First let's recognize one thing. .Net is not intended to be M$ answer to PHP. When it was developed it was primarily intended as, marketed as, and evangelized as an answer to Java. It happens that it can serve the roles PHP does, but that doesn't change it's initial targets. It is therefore of consequence to recognize that many of the higher order elements of C#.Net should be compared vs. Java not PHP.
Second, do not not make assumptions about people's level of knowledge or experience. It is unseemly. I have tried .Net and I have developed and deployed enterprise projects using it and using Java/C++ to abandon it. Oh, and then there's the MCSD for .Net Certification I took the time and effort to obtain.
I'm not going to go into Java vs. .Net. I feel it is beyond the intended scope of this thread and this forum. You have your opinions, I have mine, and I'm content to leave that alone. I'm also not going to go into the evils of M$ and the large turd that is a Windows Server (too much at least). Again I have my opinions, you have yours and I'm not interested in going down that road.
However, I will provide a more detailed PHP vs. .Net comparison from my perspective. I invite your comment and rebuttal as I feel that your arguements for .Net are worth hearing for myself and I'm sure others here would agree.
To begin (the you is the general .NET/forum reader user not yogi):
1. Operating environments compared.
PHP is open source and can run well on a variety of systems ranging from Windows to Linux to BSD to MacOSX and more.
.Net is closed source and is intended for use only on Windows machines. Yes there are open source implementations in the works, but neither the option of mono or wine are suitable for commericial deployment by comparison. That may change in the future, but for now it is a fact.
Given the instablity, the insecurity, the high cost of ownership, the relatively poor performance, and the overall turdness of the Windows Server, this is an issue of consequence to many.
2. Debuggin/IDE.
I have been writing in PHP for years and I have NEVER felt the need to use an IDE or a third party debugger. See my anti-WYSIWYGI/pro-Text Editor manifesto. If you can't debug PHP using its internal error messages than the sad reality is that you don't know PHP as well as you should to be using it. The third party debugger just allows you to overcome your personal shortcomings that should instead be overcome by reading the darn manual. I have never had a bug in my code that the PHP error messages didn't lead me to solve.
More importantly this is a spurious arguement and merely indicates a lack of knowledge of what .Net is. PHP is a programming language. .Net is an Application Framework. These are two fundamentally different entities. If you want to whine about debuggers/IDE's then compare .Net to a third party framework for PHP. If you want to compare directly then you should compare the languages of .Net, such as C# and asp, to PHP. Apples and oranges people.
If you want to talk about RAD, code libraries, and such then you should at least make a fair comparison. Include PEAR, PECL, the numerous other "libraries" of reusable code for PHP and IDEs like Zend Studio to the tools of .Net. Other comparisons are simply artificial and unfair ones designed to give the impression of .Net superiority.
So I'm turning on the lights and reminding people again, PHP is a programming language. .Net is an Application Framework. To this end from this point forward I'm not giving creadibility to any further comparisons by using the incorrect terms as have been previously laid out. A valid comparison is apples to apples. So for the sake of correctness I'm going to refer to .Net as "lang.Net" from this point forward to simply reinforce the truth behind the comparisons being made.
The first post calls .Net, asp.Net, true. But then they proceed to make arguements vs. PHP that are predicated on the Application Framework of .Net and NOT of the language specifics of asp.Net. Is this deliberately deceptive or is it the accidental result of someone posting on a topic they are not well-informed on?
3. Data and html caching.
Refer to my discussion of #2 above. This is another spurious arguement in favor of .Net rather than a realistic comparison of lang.Net vs. PHP. .Net is an Application Framework and so provides these elements as a part of that framework. PHP is not. Period. gg. Compare apples to apples and consider solely lang.Net or consider PHP + third party solutions and you'll see that both can provide data and html caching.
4. Compiled vs. Interpreted.
If you buy this arguement then you really did drink the Kool-Aid Crazy Steve Balmer was serving up. As someone who works more with C++ than PHP or Java or .Net I will tell everyone here. .Net applications are not "compiled" in the sense that C++ applications are compiled. It's just not true, sorry.
What is going on when Microsoft claims it is "compiling" is more in line with caching. They have simply chosen to call it compiling to give people the impression of speed. The uniformed and unwashed masses hear "compiled" and they think "fast." They hear "interpreted" and they think "slow."
Realizing that, let's move on to "compiling" (in M$ parlance) or caching your PHP. Zend has been doing THE SAME THING SINCE 2000. Sorry for yelling, but lies like this one are insidious and deserve to be shouted down. Zend describes their caching
in their FAQ, here. If paying for the Zend Accelerator is not your bag, remember php-accelerator offers a free PHP "compiler" (in M$ parlance).
If we're going to make comparisons, let's at least be honest and compare apples to apples. I am a broken record, yes. In this case compare ASP.Net to PHP.ZendAccelerator or PHP.php-acclerator. In both cases you have simlar caching/"compiling" architectures that by BOTH M$ and Zend claims show a 3-5x speed improvement vs. un-cached/"un-compiled" versions of the same script. Strange isn't it that M$ "compiling" gives the same touted speed improvement for ASP.Net vs. that which Zend's more aptly termed "caching" does for PHP.ZendAccelerator.
4. Separation between presentation and business code.
This is just another restatement of #2 above. Comparing an Application Framework to a programming language alone is disingenuous at best, deceptive more likely, and deliberately ignorant at worst. Why does .Net get to enter the comparison with all of the extras associated with the framework instead of just the base ASP or C# language? Why does PHP have to enter the comparison without all of it's extras like Smarty/FastTemplate/PEAR and instead with just its base language? Sounds like someone's trying to slip one past those who don't know better.
5. RAD/IDE.
I lumped this into #2. Nothing like someone setting up a false comparison of .Net Application Framework vs. PHP programming language and then proceeding to examine it without first establishing the validity of the comparison. Why do I keep reiterating this point? Because the .Net advocates kept ignoring it in their posts.
I am waiting for one reason why the comparison of an APPLICATION FRAMEWORK to a PROGRAMMING LANGUAGE is nothing more than an intellectually dishonest affair.
6. OOP
Well, first
a reference to an interesting FAQ about Objects in .Net. This part of the FAQ describes in depth the massive problem that exists with garbage collection and the lack of deterministic destruction of objects in .Net. It further provides added links that describe added details about this problem and the major effect it can have for various projects.
Now, it is certainly correct that ASP.Net forces the programmer into OOP. But the real question is is that good? Does the web designer who doesn't want to be a programmer want to also be forced to learn OOP? And how exaclty does forcing OOP on users constitute a good thing?
One of the wonderful things about PHP is that choice. I can choose to keep it simple, linear, and rapidly deployed for small tasks. Or I can choose to go OO completely for more complex ones. The choice is mine to make based upon MY needs or MY CLIENT'S needs, instead of being a decision made for me by M$'s "one ugly suit for everyone" approach.
I can write OO code using any OO design pattern I need to. I can implement some patterns and not others. I can do what needs to be done for my project and I can do it the best way, not just the M$ way.
"M$ bashing <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>"?
I think it is worth noting that this thread was started by a pro-M$ TROLL and not by any M$ bashers. Are we guilty for taking the bait? Yes, I am. I will take it every time I have the time to reply as it gives me a nice opportunity to vent the pent up frustration built up from years of having to slog through messes created by M$ crap. I have worked on literally dozens of "cleanup" projects fixing Winblows Server fiascos, VB coding debacles, and M$ security failures. If I call M$ I get some smug SOB who has no appreciation of the magnitude of the problems and no cares beyond tomorrow's M$ share price.
Just because other companies suck is not an excuse. I don't get to steal just because other people are thieves. Business ethics are not predicated on compromise or obfuscated by collective evil. When we stop working to be better as individuals and as businesses and as a society, we fail. When we fall back on the excuse of others are bad too, we enable that failure.
Where else am I supposed to vent? I didn't go to a .Net forum and pee in their soup. Yet someone comes here and pees in mine. The only acceptable place to troll is the Ottawa Lady Senators forum at ESPN.com.
Is .Net an exceptional product? Yes, it is. Did some people at M$ work hard to make it? Yes, they did. On these things I will agree with lazy_yogi. There is a time and a place for .Net as there is for all things.
But does that fact make .Net better than PHP? Hardly. Nor does it make PHP better than .Net in every circumstance. What makes XXXX better than .Net is not principally .Net's failings (thought it has some). It is the failing of the Windows Server platform.
7. Not mentioned - development and deployment cost.
If you don't have $$$$$ to burn then, sorry, .Net is not for you. That is now and always will be a fact. PHP is free. php-accelerator is free. PEAR and other script libraries (including templates and cms systems) are free. MySQL, Postgres and SQLite are free. BBEdit Lite, Notepad, vi and emacs are free. Apache is free.
In the final analysis, I stand by my previous statement:
.Net is Micosoft attempt to beat on Java and PHP simultaneously. Problem is it does neither. Java is far better in the enterprise and PHP is far better for the average Joe's web app.
I will take Java/C++ in the enterprise. I will also take PHP every time for the average Joe's web app/site.
peace