Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP or .NET? 1

Status
Not open for further replies.

hapax

Programmer
Nov 10, 2006
105
US
I'm fairly new to web development. I want to choose a web platform for a new small project. I know some .NET but I don't know much about PHP.

For those of you who are familiar with both .NET and PHP, I have a general question:

What advantages does PHP offer? Why should I choose it over .NET and the Microsoft way of doing things?


(I'm not trying to troll here - I really want to learn about this.)

Thanks
 
hmm the obvious one is that PHP is an open standard & can run on may diferent server platforms
Linux, Windows, BSD
Apache IIs

which means code should be protable should you decide to change hosts.
 
Also, unlike .NET, PHP is free. Under the Open Source Conventions. Also, you can find many free tools to help you develop in PHP.

With NET, you are pretty much stuck with Microsoft's costly development environment.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
So, price aside, is there any technical or operational advantages for PHP?

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
that's a more interesting question, johnwm.

a key difference to me is that php is a largely encapsulated language. everything you need to do is within the php realm: install & go, so to speak. this maintains a consistent interface style, which has a value.

.net, by MS' own admission, is a 'strategy' for connecting systems to webservices. to implement a .net solution you need to bind together multiple bits and bobs using a base level language like VB (i am not a hardcore MS coder so i may be off-base here). This strategy has its advantages:

* It seems easier to extend .net than it does to extend php.
* because of the MS centric approach, richer functionality can be built into web services, more easily than one could do the same in php and maintain cross-platform compatibility

But the killers for me as already pointed out:

* .net is dependent on MS OS. It is inherently non-portable.
* php is portable across multiple webservers across multiple OS. And i really mean portable: with a very small set of exceptions the identical code will run fine on all installations of php. This is a truly huge plus for businesses and consumers alike.
* php is open source - you can extend its core as you wish.
* php is actively under development and very regularly released and bug-fixed. With .net you are hidebound to the MS release and bug-fix schedule (which, to be fair, is not terrible).
* php coding style/heritage and object orientation.
 
From what little I've seen of PHP, it looks comparible to the old classic ASP. Whereas, .NET has a rich object model, rich server controls, rich data objects, etc. that are powerful from a RAD point of view and do a lot of the grunt work for you. Plus, it has powerful object-oriented languages like C# and VB.NET.

What does PHP offer to balance out these positives on the .NET side?

Is PHP object oriented, or does it at least play well with Java?

Visual Studio, while not free, seems like powerful tool offering many benefits. The cost doesn't seem that significant, when you consider you're paying programmers US$50-100K per year. It would make sense to pay one or two thousand to give them good tools.
 
jpadie, thanks you answered some of my questions even as I was writing my latest reply :)
 
PHP is not really comparable to old ASP, imho. PHP is a far more comprehensive by way of functionality.

Although a bespoke solution like .net can offer richer functionality, that is not to say that php does not have RAD solutions. For example the PEAR repository (excuse the recursion) has a wealth of top quality coded solutions within it. and that's only one of many similar homes for php coding.

on the tools side: i've heard many detractors from Visual Studio. but the point really is not whether one tool is better or cheaper than another: but whether there is _choice_ in the market place.

Personally I find PHP easier and richer to code with.
 

jpadie

Thank you for your summary. May I extend with one further question. Does PHP scale well? Or is that primarily a function of server capability? All my current stuff runs on MySQL backends, so the DB should not be a problem.

Although most of my commercial websites are for SME type businesses (hence only a few thousand hits a day} I need to consider what happens with a more popular site.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
i'm probably not the right person to ask as the apps I tend to write are similarly scaled.

but ... php is a _very_ fast interpreter and seems extremely robust/stable. It doesn't need big kit to perform either. It has minimal memory leaks (i have never been noticeably troubled by any) and plays very nicely with apache and IIS. I suspect that apache will give up long before php will and so you could scale to your heart's content by adding more apache boxes with the php sapi on them, a few squid servers directing traffic and a decent database cluster at the back.

As always there are optimisation tweaks that can be done is scale is hurting performance: handing off give database queries to more powerful servers etc.

adding to my comments above, the other really important thing to bear in mind about php over asp/.net is the PHP manual. This is rigorously centrally maintained and has been truly invaluable in the take up of php as a core web-platform.
 
i'm not comfortable with this statement

jpadie said:
PHP is not really comparable to old ASP, imho. PHP is a far more comprehensive by way of functionality.

i think this is incorrect. My apologies for misleading the House, therefore. ASP is not a language but a structure for addressing functionality in other languages, typically VB and javascript.

it's better to say (in terms of what I meant to articulate) that php has more built in, easily addressable and consistent functionality than either of the other languages.

I came from a VB/VBA background but since learning PHP I have only worked on one VB project, and i didn't like it;->
 
I wouldn't worry about scalability. If you have a good network architecture, PHP itself shouldn't be a problem.

By way of reference, the site I recently started working for is written entirely in PHP and we do about 8 million page views a day. Our big bottlenecks are database load and filesystem access. PHP doesn't even enter the equation.
 

Thanks again.

No worry for me about ASP or VB - I've worked in both for longer than I care to remember [smile]

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
.net is MicroSoft, PHP is not. That make the choice clear for most. I do not know .net nor care to research it farther, but since you know a little of both, which is most supported in online forums? Which would you most likely get the best assistance should you need help?

People care enough about PHP to give their time freely to develop it and improve it. MS has developed many things that they no longer support. If they decide that a program is no longer profitable, where will you be then.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top