views:

355

answers:

3
+6  Q: 

PHP5 vs ASP.NET

Hi guys,

I am required to write a report contrasting PHP5 and ASP.NET after building an application in both languages. I've been looking for papers and resources to reference and quote on the subject but i am running a little short.

I was wondering if anyone directions as where i could find such papers / resources.

Thanks in advance.

EDIT:

To clarify: I have already built an application in both languages, however as this assignment is for a BSc degree everything I talk about requires a source to back it up. I’m looking for papers that have looked into comparing both languages and academic resources that deals with issues like speed, security and syntax.

A: 

If you're supposed to build an application in both, you'd be best off building one rather than looking for compare/contrast papers. Here are some helpful tutorials:

PHP Tutorial

ASP.NET Tutorial

You can get started doing ASP.NET development for free using Visual Studio Web Express.

You can get started doing PHP development for free using NuSphere PHPED

Randolpho
Sorry I think I haven't explained something correctly. I have built an application both, however as it’s a BSc degree everything i talk about requires a source to back it up. I’m looking for papers that have looked into comparing both languages and academic resources that deals with issues like speed, security and syntax.
Lee
+4  A: 

Take a look at the difference of how Php works and how asp.net works on a server in terms of threads and processes. This is one of the major difference between asp.net and php.

so asp.net is compiled and runs on a VM, as threads where as php runs on apache instances as lightweight processes.well php also runs on IIS.

So asp.net is supposed to perform better as the number of request to server increases. However we see that many companies that use php gets it to scale very well using caches etc.

In terms of security, developer should implement security policies etc. However in terms of the programs they both runs in jail.

asp.net is strongly typed (some calls it statically types), with context free grammar. where php is context sensitive and weakly typed.

Php is open source with a big community support. asp.net is from glorious microsoft with fine support and components.

In terms of development, they are equivalent, there is nothing you cant do with one of them that you can do with another one. Both of the languages are Turing Complete.

asp.net apps can be developed using vb or c#, where as php apps are built using php :)

in terms of MVC, asp.net and php has mvc frameworks as well as ORM and many other libraries.

Here is yet another difference, using c# with asp.net, you can use multithreading, threadpools etc. php lacks this.

Exception handling is also different, this is again related to type theory of the languages.

Can't asp.net apps be written with any .NET CLR language?
Gregory
This is true.You can write ASP.NET in any .NET language, not just VB or C#.However, PHP is single language.
Venemo
A: 

Hi Lee,

Unfortunately this topic is quite debated. There are very few actual comparisons which are objective, because such questions are often religiously handled even by some professionals. There are not many people who use both of these technologies to really comprehend both of them enough to make a comparison.

Most of the time ASP.NET is at least 10 times faster simply because it is compiled, however it is more robust and therefore harder to master. (Especially for beginners.) On the other hand, PHP is more lightweight and it requires slightly different thinking and design principles.

Some people (mostly the PHP fans, no offense) say that PHP is cheaper, because it is free, and it can run on a free platform (Linux). However, my argument against that is this: Even if it is free, it is 10 times slower, so you have to buy slightly better hardware to achieve the same results, which makes up for the price of Windows.

With all said, there are actually some objective comparisons available on the net if you search carefully. Here is a blog post: link, and the detailed test results: link.

I hope this helps.

Venemo
[subjective]Even if it is slower(which I'm not saying either way) you can run a Linux/Unix system much more lightweight than a Windows Server system. >512mb of RAM is used just for the OS! [/subjective]
Earlz
Have you actually measured? Because, with all the waiting on one side or another of the network cable, and the delay introduced by the eventual database engine (not saying that it's worse, only that it's *different*), the delay introduced by compiled / not compiled is most of the times moot. Otherwise, let's go back to coding CGI in C.
Adriano Varoli Piazza
No, I haven't measured myself, but please check out the link in my post. That guy made very good measurements.
Venemo
I don't consider a 20,000,000 empty for loop very much indicative of anything. Or the fact that he only did one set of tests for each item. Or the fact that he grades on 'average', 'good', 'suboptimal' based apparently only on the relative results for that test, not on any useful metric. What is 'suboptimal' or 'best' about the time taken for 20 million useless loops? Labeling the results as 1st, 2nd, 3rd, 4th would have been more correct.
Adriano Varoli Piazza
Actually, the colours in that test mean 1st, 2nd, 3rd, 4th. The textual description is just bulls*t, we agree on that. :)
Venemo