.NET vs PHP

Discussion in 'Third-party applications' started by Rookie, May 31, 2007.

  1. So I have been developing website for about a 1 1/2 years using asp.net and a friend asked me today why I chose to use .net instead of php. My simple answer was it was available to me, and I am comfirtable with Microsoft. That got me thinking, I should probably learn a little more about php so the next time someone asks I can have an intelligent answer.

    Does anyone have or know where I can find a good comparison (non-bias) on the two asp.net and php?

    Thanks, rookie
     
  2. Well its really hard to find links or articles that will compare the two with any bias opinion. I guess a more important question is what hosting environment will best fit what. Obviously for a Microsoft Windows environment, vb.net, or C# is the way to go for creating .net web application. For a Linux/Unix based environment PHP is certainly a way to go as asp.net won't even go there.

    Post Edited By Moderator (mjp) : 6/4/2007 6:29:41 PM GMT
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    This is a interesting suggestion from your friend.

    We have seen many people converting to ASP.NET to PHP but we have seen very few go the other way.

    PHP is a scripting language similiar to ASP. IMHO, ASP.NET is by far superior.

    See this webcast, http://www.learn2asp.net/php/Campaign.aspx


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. PRB

    PRB

  5. Thanks everyone for the imput.
    I am in graduate school and my classmates are all Linux guys [​IMG]. So any arguement I make against them has to be solid.

    And it is pretty much pointless to argue but I try!!!

    rookie
     
  6. mjp

    mjp

    Google is only reporting on search patterns, not use.


    Netcraft does actual analysis of scripting technologies used on the web, but they charge a good deal of money for those statistics. They do offer free server software use statistics that you can make general assumptions from though: http://news.netcraft.com/archives/web_server_survey.html


    You can assume Apache is predominantly html/php, so IIS and Apache trending closer to each other in use would suggest asp/asp.net is increasing in use and html/php is declining. Again that's a very unspecific comparison, as IIS servers also host a lot of regular old html sites that do not use .net, php or anything else.


    Of course the use of one technology over the other doesn't necessarily mean the more popular technology is better (think Beta vs. VHS). As long as php/MySQL/Apache are free (as in no licensing fees)you will have some people using them who may have adopted IIS/.net if they were free. So it's difficult to compare them.


    As for which is "better," .net or php, you will never get an unbiased answer. You may as well ask people which is better; Mac or PC...or Republican or Democrat. ;)




    mjp
    DiscountASP.NET
    <SUB><SUP>http://DiscountASP.NET
     
  7. I checked out the link that Bruce posted above (http://www.learn2asp.net/php/Campaign.aspx), and it had a great video that compared the two. Of course it was made by microsoft, but it did a good job of explain the difference between php/.net.

    If you are interested i would check it out.

    thanks all!
     
  8. Why ask when everyone knows Macs are better. /emoticons/wink.gif
     
  9. mjp

    mjp

    Well, of course they are!


    My girlfriend may get one. It will be nice for her. I see they come in pretty colors...





    See? This will only lead to trouble.

    mjp

    DiscountASP.NET - Microsoft Gold Certified Partner
    - asp.netPRO Magazine 2007 Readers' Choice Award for Best Hosting Service
    - Visual Studio Magazine 2007 Readers' Choice Award for Best Hosting Service
     
  10. I am a new developer and have chosen .NET, C# and ASP.NET to be my first "big" languages (I have some experience with HTML and CSS). The reason for me leaning towards .NET development is because my company (defense contractor) is big into Java and .NET development. They do zero PHP development. For me, it would be more beneficial to pick up these languages as I could one day use that experience on the job and get paid for it. That ismy .02.
     
  11. I'd like to add my two cents...

    I began my web development on linux / php. PHP is a lot of fun, and with the self-installation of the entire operating system, web server, and php / mysql, it's really easy to get set up and writing code.

    And I think that really highlights what makes PHP great - it's ability to get a website up and running, very quickly.

    There are a few functions in PHP that you'll find are similar to .NET. In my opinion, the "Backbone" of all PHP applications is the "include" function. It makes modular design much easier than before it was developedbecause you can apply templates and use files from common stores. In .NET, you can use Server.Execute to produce the same results.

    Highlighting what someone else wrote above, PHP is a scripting language and after a while can become very difficult to maintain and modify. I know PHPIDEs are making great strides, but you're pretty much on your own to have correct syntax. That's where .NET is strong - Visual Studio. VS is phenomenal because it provides so much help when you're writing code. Because PHP is scripted, and C# / VB.Net are compiled, you get the advantage of using a variety of out of the box and even your own custom types, not to mention a drag-and-drop experience that makes writing custom components and utilizing partial-page caching very easy.

    So, PHP is great for beginning web developers - it forces you to use good syntax, and you can publish new sites very quickly. The downside is that its increasingly difficult to maintain as sites grow larger.

    ASP.NET is great because it can support a more robust website and is very maintainable. You find much less "spaghetti code" in .NET than PHP, and being able to apply lines between application layers makes utilization of business and data objects across implementations very clean. You can essentially use the same business and data access code you wrote for your web app in a windows service, a desktop application, a mobile web applciation, or any other .NET implementation types.

    I hope this helps. I personally started on PHP and would never go back because of all the great things .NET does to make application maintenance so easy.
     
  12. mjp

    mjp

    Seems to me that .NET would better than php for beginning developers for the very reasons you've noted.

    There is no 'drag and drop' in php, and no repository of pre-written blocks of code (unless you're a masochist and heavily into reverse engineering).

    You can build a relatively complicated .NET without really knowing what's going on under the hood. You certainly can't do that with php, or perl or python, or any of those scripting languages that start with 'p.' ;)

    But there are significant learning curves with any of these things if you're starting from square one.

    mjp

    DiscountASP.NET - Microsoft Gold Certified Partner
    - asp.netPRO Magazine 2007 Readers' Choice Award for Best Hosting Service
    - Visual Studio Magazine 2007 Readers' Choice Award for Best Hosting Service
     

Share This Page