|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2002
Location: Miami, Florida - Caracas, Venezuela
Posts: 382
|
PHP vs. ASP.NET Fight
I need help!
I'm a designer in the process of learning PHP and need some help. At work developers from the IT Dept. keep arguing that asp".NET" is better (for many reasons that they have failed to explain) than PHP. They say PHP can't survive and that it doesn't compare to the speed and agility of ASP.NET. One of the explanations that I did get is that with asp.net you can comile code into much faster *.aspx files. Is there an equivalent in PHP? In your opinion what are the pros and cons of each? Help me win this one please!!! Thanks, LG |
|
|
|
|
#2 |
|
Sultan of Ping
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2002
Location: Svíþjóð
Posts: 4,101
|
|
|
|
|
|
#3 |
|
Grumpy Mole Man
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2001
Location: Lawrence, Kansas
Posts: 2,190
|
Any speed differences will only become noticeable if your site gets hundreds of hits a minute. ASP.NET does have some significant advantages (the standard class library and the fact that C# is a very nice language spring to mind), but at the end of the day its biggest disadvantage is that if you go with ASP.NET you are pretty much tying yourself to developing for the Windows platform, which leaves you stuck in Microsoft's insidious (and expensive) upgrade cycle
PHP can be deployed on a much wider range of operating systems and doesn't tie you to one vendor.(I know Mono is an open source project that plans to get .NET running on non-MS platforms, but I don't trust MS not to deliberately screw it up somehow so I will only believe it when I see it deployed). |
|
|
|
|
#4 |
|
No.
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2001
Location: Nottingham, UK
Posts: 1,147
|
The notion that PHP 'cannot survive' in the face of ASP.NET is, and always has been, total bullfaeces. PHP is free, open source software which can run on damn near any web platform and integrate almost every web technology you care to name. ASP (and ASP.NET) is prorietary, and stuck on Windows. Ive no doubt whatsoever that your IT dept people are long time Microsoftphiles who have probably never used PHP anyway.
PHP is also a far more appropriate choice for most web apps, in the same way that Java is not always a good choice. |
|
|
|
|
#5 | ||
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
Quote:
Quote:
As to agility, ask them if they can write a Lotus Notes client in ASP. Then point out that you could write in Java and PHP for about 2 years now and it's now possible to drop Python into PHP. The only thing .NET really has to offer that PHP can't do easily (if you discount PHP-GTK) is to interface natively with the client (Windows). Which is nice but given MS's security record, if they unleash that on an unsuspecting Internet, all hell will break lose. Main thing to remember is you can't compare PHP with ASP.NET. PHP and ASP can be compare (they're both languages) but .NET is an application framework. Anyway - enough already - it's well discussed in other threads. Last edited by HarryF; Jul 10, 2002 at 14:56. |
||
|
|
|
|
#6 | |||
|
morphine for a wooden leg
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2002
Location: .chicago.il.us
Posts: 957
|
Re: PHP vs. ASP.NET Fight
Quote:
Quote:
Quote:
PHP has a stronger (more C-like) syntax, while ASP is highly verbose and looks more like pseudocode than like programming. All the .net languages are new and untested, and knowing Microsoft's reputation, there will no doubt be hundreds of security holes and bugs discovered in the CLR. PHP has been in wide-spread use for a few years now, and is completely open-source, so bugs are few and they are fixed immediately. A PHP program can send an email with ONE LINE of code. Try that in ASP.net Want more? |
|||
|
|
|
|
#7 | |
|
SitePoint Member
Join Date: May 2002
Posts: 3
|
Quote:
Code:
System.Web.Mail.SmtpMail.Send("from@email.com", "to@email.com", "Subject", "Body");
|
|
|
|
|
|
#8 | |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Feb 2001
Posts: 302
|
Re: Re: PHP vs. ASP.NET Fight
Quote:
PHP only has a more C-like syntax than VB, not C# or J#. Anyway syntax is secondary anyone can quickly learn the syntax of a different language, it is the concepts that take longer, of which all the .net languages have more in common with C++ than PHP. |
|
|
|
|
|
#9 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Sep 2001
Location: Vancouver
Posts: 407
|
In my opinion php has some huge advantages.
- You can run it on so many operating system - if something is broken it will be fixed a lot quicker then asp.net because of it's huge openness - Easy to Learn many resources - Hotscripts.com - look at whats already done for free, with this said you can saves hours in programming time by borrowing others code for the beginning of your projects. - The php community is also much more open, there are so many resources to help others along. These advantages don't have much to do with the actual syntax comparison but in my opinion they are very valid. |
|
|
|
|
#10 | |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Sep 2001
Location: Vancouver
Posts: 407
|
Re: Re: PHP vs. ASP.NET Fight
Quote:
. |
|
|
|
|
|
#11 | ||
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Re: Re: Re: PHP vs. ASP.NET Fight
Quote:
This reflects many PHP guys opinions on ASP. So many people automatically put off Microsoft technologies before even trying them. I started with PHP about 18 months ago, and have done it since. I love the language, and I definitely don't think it will die. However, I'm currently looking into ASP.NET, and I can safely say that it, without real contest, is generally superior to PHP. The "battle" between old-ASP and PHP generally just came down to a matter of taste and amounts of jobs, but ASP.NET really is superior, believe me. ASP.NET has several major differences from PHP:
I'm not going to get into the debate of whether .NET is really going to be tied to the Windows platform or not (even though Microsoft HAS released the source code of the FreeBSD .NET CLI for anyone to look, and is having Corel Develop a proper framework for it), but I will say, as a PHP coder, that ASP.NET is a very good piece of technology. Last edited by M. Johansson; Jul 13, 2002 at 09:25. |
||
|
|
|
|
#12 |
|
Grumpy Mole Man
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2001
Location: Lawrence, Kansas
Posts: 2,190
|
Don't confuse ASP and ASP.NET. ASP is basically an IIS extension to allow it to execute scripts. ASP.NET is the web scripting element of .NET, which is a whole new development platform.
PHP beats the pants off traditional ASP, but ASP.NET has some big advantages over PHP (compiled scripts, the ability to use proper OOP langauges such as C#, a very well designed standard library). That said I'm not goign to touch .NET until I'm sure that the open source implementation will be a viable alternative to hosting on a Microsoft platform. PHP is also easier and cheaper to host. |
|
|
|
|
#13 | |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Quote:
|
|
|
|
|
|
#14 | ||||||||
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
I get tired of hearing this;
Quote:
Quote:
PHP.ZendAccelerator is still faster than ASP.NET It's been possible to do this for two years already, using the Zend Accelerator. What Microsoft call "compiling" in regard to .NET is not real compiling. Zend, who are more honest, admit it's a form of caching. But in case you're in any doubt, read this. Quote:
Now further quotes. From Zend here; Quote:
Quote:
So in conclusion: Oh dear! ASP is back where it started - still lagging behind PHP (it always was faster)! If you're going to talking about ASP.NET (which is language + application framework) then hey - I'll talk about PHP.ZendAcc in future. Otherwise; Quote:
Quote:
Quote:
.NET blows out on being Windows only and here's a prime example. If you head to Brinkster and buy they're Premium hosting account [$13 setup + $13 / month) only then do you get access to all these Com Components. And don't expect installing new Components to be free - they cost money after all. That's a typical, cheap ASP host. With PHP, you'll find thousands of hosting companies offering all the functionality of those components for free (as a default install) and will probably be willing to install further libraries for free or at a very small charge. That's because all the libraries are typically open source in the first place. .NET is, in my opinion, a language only for those backed by a corporate account. Last edited by HarryF; Jul 15, 2002 at 07:45. |
||||||||
|
|
|
|
#15 | ||||||
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
||||||
|
|
|
|
#16 | |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Oh, and out of curiosity, how is ASP.NET not compiled? As I've understood it, the code is compiled into native code when it is first ran, and then it's... well, compiled?
From Arstechnicas article on .NET: Quote:
Last edited by M. Johansson; Jul 15, 2002 at 08:39. |
|
|
|
|
|
#17 | ||||
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
*Wipes froth from corners of mouth*
![]() Quote:
If you did deep, you'll also find little snippets like this; Quote:
Quote:
The basic idea is in old days of ASP 3.0 or PHP (without Accelerator), a script was "re-parsed" (or compiled) each time it was run. So for PHP, the langauge get's interpreted (aka compiled) into something more like C++ (bytecode I believe it's called). This wasn't particular fast so people looked for ways to speed it up. One simple approach was to cache the output - the end result - a web page. That works for a static page but where dynamic content from a dB is concerned, you need a new version of the page each time, making this approach more or less useless. But then someone realised that to the number of times a script gets run from a site, it very rarely changes. So if you cache the compiled bytecode, you would save the PHP (or now ASP) parser from having to repeat the job over and over again for every script execution, while still allowing for "dynamic content", because the bytecode contains instructions on which database to access, the queries to run etc, in a form that is very fast for the low level C++ executables that make PHP "happen" to work with. So what Microsoft and Zend are doing is partially compiling a script into bytecode then caching it for re-use. This is not the same as a executable you compile from C++ program, for example, which I'd call "truly" compiled. This quote from MS here sums it up; Quote:
It's no coincidence that both are quote "5 times faster" - there's only so much this approach can do for you and both have probably hit their limits. |
||||
|
|
|
|
#18 |
|
.NET inside
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2002
Location: Strongsville OH
Posts: 1,588
|
i have been doing some research and i have found that the code validation controls that are generated by asp.net do not work with any version of netscape. another reason to go with php.
|
|
|
|
|
#19 |
|
Super Ninja Monkey
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2001
Location: Sioux City, Iowa
Posts: 709
|
Whats that? A Microsoft product doesn't work with Netscape? Well, what did you expect from a company that has trid everything to make their web browser the only one used? Its probably just another way for Microsoft to push Netscape (and Mozilla) out of the market.
|
|
|
|
|
#20 | |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Quote:
The server controls works absolutely flawlessly in any standards compliant browser (Read: IE, Opera, Mozilla, etc). I personally couldn't care less if the server controls doesn't work in NS4, since NS4 usage will be very low when .NET picks off, and secondly because NS4 users aren't even going to notice that they don't have dynamic "*". If you are still unhappy with the form validation control javascript not working with NS4, you can just redefine/rewrite the server control. PHP doesn't even have form validation controls in the first place. |
|
|
|
|
|
#21 |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
You can see an example of the Form Validation here:
http://samples.gotdotnet.com/quickst...alidator8.aspx Fill in the form, press validate, and then change the field to be incorrect if it was correct, and vice versa, and the red text beside the form field will change. Source code here. |
|
|
|
|
#22 |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Well, Harry, I guess time will tell whether ASP.NET or PHP is faster. I don't belive marketing texts, whether they come from Microsoft, Zend or anyone. I believe benchmarks. Some real benchmarks will come soon enough, I guess. One thing is sure, though - .NET is very fast. This guy made a goddarn 3D engine using it.
|
|
|
|
|
#23 |
|
Wanna-be Apple nut
![]() Join Date: Sep 2000
Location: Halmstad, Sweden
Posts: 7,614
|
Oh, and I just recalled an advantage of ASP.NET - it has a totally free and very good development tool for ASP.NET, called Web Matrix. It's essentially a scaled-down/customized version of Visual Studio.NET. It has WYSIWYG, Direct editing and viewing of your SQL db in the little DB window, code completion, and editing over FTP. It also includes lightweight versions of IIS and SQL server. (Full functional, but won't handle real load) There is nothing like it for PHP that is free.
ASP.NET is more expensive to host, but it's cheaper to develop for. |
|
|
|
|
#24 | |
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
Quote:
As to marketing texts, don't believe the hype (which is exactly what everyone has done with .NET). .NET or Zend Accelerator simply optimise the process of interpreting scripts. If you know a hard core C++ coder, have a long chat with them about how a C binary is compile and how this compares to what .NET does. All in all, the .NET languages and PHP can only get so fast (and will always be as fast as each other) - there's a limit to how much you can do with a script. If you want to get faster, you'll need a true binary. For some benchmarks, try this for a start. |
|
|
|
|
|
#25 |
|
SitePoint Wizard
![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
PS: Some real feedback on VS from MS developers: http://www.dnjonline.com/articles/to...newsgroups.asp
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 06:58.





PHP can be deployed on a much wider range of operating systems and doesn't tie you to one vendor.





Linear Mode
