PHP vs ASP.Net

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I have a co-worker (not a developer tho) who keeps singing the praises of PHP..PHP this, PHP that...

I'm developing an application with ASP.Net using datagrid, basically .net stuff....

Wondering what advantages PHP has over ASP.Net..can I have the same database capabilities in PHP as in ASP.Net?

Any thoughts?
 
That's good to know...

Any disadvantages why PHP shouldnt be used for web development? or are they equally good for web apps?

Thanks again.
 
That first link is grasping at straws, the article may have been written by a politician :) I can imagine what kind if work this guys puts out :eek:
What is significantly different is "Language.NET" will force you into an object oriented approach from the start, while PHP won't. The Web typically does not require OO -- for your average dynamic Website, a few "hacked" scripts are perfectly fine if they meets the site's requirements. Deliver a live site now, rather than a beautifully abstract piece of code that's ready one year after it's needed. Paraphrasing SitePoint's recent interview with Rasmus Lerdorf, PHP's down-to-earth approach to problem solving is what has made it a success. And when you need OO, it's there waiting for you.
 
The problem with that argument is that ASP.NET does not force one into using a object-oriented approach to programming. It's there, and it's the predominant option, however there's nothing stopping anyone from using render tags, inline code, and many other pre-World War II programming methods.
 
They say that ASP.NET is more faster than PHP because ASP is compiled and PHP interpreted.

Here is my opinion... slowdown of ASP.NET are coming from ADO.NET and not from ASP.NET as it may seem. I think that SQL Connection to a server are rather slow.
But as they say (www.IBuySpy.com) when ASP.NET is cached... it's way more faster.

Some comments ? Let's continue the debate.
 
I'm new to ASP.Net and started this thread because i really want to put an end to what my co worker keeps saying..but his reason is different..his reason is "people dont like microsoft so why didnt you use PHP" !!!
 
I'm sick and tired of MS bashing, if they don't like it let them work on Mac, Linux or something else that may be from the last generation of ..... :mad:
When they say they're forced to work with MS products well too bad then go into another line of work.

Arch4ngel, I have to disagree with your ADO comment, I tested the old against the new running exactly the same code and SqlClient flies as compared to the classic methods.
 
PHP needs Apache server, which runs on Linux servers, which is much more secure than windows servers.
PHP, MySQL and Apache are all for free.
PHP hosting is still cheaper than windows hosting.
These are some reasons why its so popular.
 
Explication

They are so popular because it's free.
Everyone can begin to make their own web site with PHP,MySql and Apache.
However... it cost too much for the public to buy Visual Studio 2002 or 2003 (even the lowest edition with less features). And did you think again of Sql-Server ? And Windows 2003 Server or Windows 2000 Advanced Server ?

And if you buy an ASP.NET Web server it cost some butter :p .

And what about hosting ? They got an OC-13 connection and boxes and some soft to buy.

PHP ? Everythings free. No operating system cost (linux) and nothing to pay (Apache is "free" and MySql is free either)
ASP.NET ? Everything is own by Microsoft (they don't give too much). Operating system start at 500$ to 800$ and the Sql-Server must be around 200$ or 400$ and if you include ASP.NET (0$ let say because I don't know the price).

The difference ? 700$ to 1200$.

Performance have a cost.

Other want to share their advice ?
 
One more point, PHP don't support so well ODBC. So when you try another kind of DB... you have to download plugins and others.

With ASP.NET, you have the choice of language. You can even do it in C++ or in VB.
What are the choice with PHP ? :p

I like ASP.NET and I'll stay with it. It may be slow when not cached but it's SOOOO fast when everything is cached.

I'll need to learn PHP however... because too much compagny work with it today.
 
wessamzeidan said:
PHP hosting is still cheaper than windows hosting.

Look at dotnetpark.com - asp.net hosting + MS SQL for about $6/month. ASP.NET hosting is cheap these days.
 
I think they both have their place but are deisgned for different purposes. Personally I love PHP but dabble in ASP.Net every so often.

The PHP language does have features that ASP.Net doesn't have though meaning that a forum such as this one written in PHP could not really be done in ASP.NET. These are all due to it being interpreted rather than compiled.

:)
 
mark007 said:
The PHP language does have features that ASP.Net doesn't have though meaning that a forum such as this one written in PHP could not really be done in ASP.NET. These are all due to it being interpreted rather than compiled.

:)

Could you elaborate on this? Perhaps an example?
 
Sure.

All the pages in this forum are generated using templates with code like:

PHP:
evaluate("$html='".fetchtemplate('templatename')."';");

The template returned in fetchtemplate could for arguments sake be:

Code:
<html>
<head>
$header
</head>
<body>
$navbar
<hr>
$content
$footer
</body>
</html>


and say the header template is:

Code:
<title>$title</title>

Prior to that line the variables in this will have been filled using for example:

PHP:
$navbar=fetchtemplate('navbar');
$title=fetchsetting('title');
evaluate("$header='".fetchtemplate('header')."';");
$footer=fetchtemplate('footer');
$content="This is some content."

The resulting page being:

Code:
<html>
<head>
<title>Page title</title>
</head>
<body>
<!-- navbar html -->
<hr>
This is some content.
<!--footer html-->
</body>
</html>

Hope that clarifies.

:)
 
Back
Top