PHP vs ASP.NET

Discussion in 'Indie Basics' started by tentons, Feb 10, 2005.

  1. tentons

    Indie Author

    Joined:
    Mar 1, 2004
    Messages:
    664
    Likes Received:
    0
    That's a lot of capital letters, but does anyone have comparisons to share in relation to web hosting, running a game business, and these technologies? I'm leaning toward ASP.NET because I want to be able to use C#.

    Thoughts?
     
  2. ggambett

    Moderator Original Member Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    1,982
    Likes Received:
    6
    If you want to use C# there's not much of a choice, I guess. However, PHP is portable, while ASP.NET is not (Mono notwhithstanding). So, you'd be doomed to use Windows-based hosting.
     
  3. MattInglot

    Moderator Original Member

    Joined:
    Jul 26, 2004
    Messages:
    170
    Likes Received:
    0
    I haven't worked with ASP.NET personally but attended quite a few talks on it. My impressions are that it's terrific for large-scale application development due to the ridiculous ease that common features are implemented.

    I do not see an advantage to ASP.NET for smaller websites, and definitely aren't interested in having to use Windows hosting. PHP is a terrific language and unless you are planning on setting up a real enterprise of a business from the get-go, or have strong prior knowledge of ASP.NET, I would strongly recommend PHP for the flexibility it offer you in your other business decisions. It's also freely available, does not need compiling, and can be easily edited in any text editor.
     
  4. Hamumu

    Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    557
    Likes Received:
    0
    PHP is the bomb-diggity snarkwhistle. I can't imagine why you'd use anything else.
     
  5. Pallav Nawani

    Indie Author

    Joined:
    Aug 13, 2004
    Messages:
    371
    Likes Received:
    0
    Use whatever you're comfortable with. I use PHP since it is cross platform, can work with a lot of databases, and has got built in functions for just about everything, newer versions of PHP even have a built in database! I'd say go with PHP.
     
  6. Gnatinator

    Original Member

    Joined:
    Nov 23, 2004
    Messages:
    357
    Likes Received:
    0
    PHP is awesome. I use it for everything. A big plus is that if you already know C/C++ then you can get comfortable with PHP in just an hour or so (thats how long it took me at least;) because the syntax is so similar.
     
  7. tentons

    Indie Author

    Joined:
    Mar 1, 2004
    Messages:
    664
    Likes Received:
    0
    Thanks for the feedback, everyone. I'll probably stick with PHP but wanted some kind of comparision to make sure it was the best choice since creating a website with C# on the back-end is very appealing to me. :)
     
  8. James C. Smith

    Moderator Original Member

    Joined:
    Aug 21, 2004
    Messages:
    1,768
    Likes Received:
    0
    We use both C# (ASP.NET) and PHP for server side web programming. More and more of the newer stuff is done in PHP. It hard to believe, but it seems like the C# code is already treated as a legacy system.
     
  9. MattInglot

    Moderator Original Member

    Joined:
    Jul 26, 2004
    Messages:
    170
    Likes Received:
    0
    James: that's very interesting to hear. Since you have experience with both, why is PHP chosen over ASP.NET?
     
  10. Air

    Air
    Original Member

    Joined:
    Jul 27, 2004
    Messages:
    90
    Likes Received:
    0
    From what I've seen (although my experience in ASP is limited) PHP is just, from the ground up, built to be a web developer's tool. Through and through it has been tailored to be exactly what every web developer wants and needs. PHP has so many common web authoring functions readily available that it just makes even some of the most complex web interfaces and database access almost rudimentary in nature.

    Webdevel aside though, I find PHP to be one of the most fundamentally sound scripting languages I've ever used for handling text/streams. It's typeless nature and its built-in support for hashed arrays are just so convenient when it comes to formatting text (input and output) and managing the often-dynamic nature of web data.

    My take on ASP/C# is that it's still a universal programming language first and a web authoring tool second. Where-as it's probably a bit more efficient in terms of server-side execution (optimizations afforded to it thanks to type strictness and other more concrete styles of language syntax), it also means a lot more programmer overhead to do the sort of things that are simply built-in top-level functionality in PHP. And while it might execute faster, PHP tends to have a much smaller memory footprint, so it ends up being a pretty even tradeoff.

    Due to the nature of website development that extra "robust language" nature of ASP/C# just isn't much use because you're still pretty much confined to one of two major operations when making a website : accessing a database and generating HTML code -- two things PHP currently does with unparalleled simplicity.
     
  11. PoV

    PoV
    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    2,132
    Likes Received:
    0
    I'm surprised (or I don't read) that no one mentioned the fact that ASP related hosting packages are usually stupidly expensive, given that you can be hosted on a decent host with PHP capabilities for $3 or less.
     
  12. Dominique Biesmans

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    101
    Likes Received:
    0
    Ruby On Rails

    Another great alternative for developing web applications is Ruby On Rails. Myself, I haven't used it, but it seems very powerful & easy to use. Check out the link for some real world example web applications (a project management tool, todo lists, etc...)
     
  13. Cornel

    Original Member

    Joined:
    Jan 28, 2005
    Messages:
    3
    Likes Received:
    0
    It depends what you want to do. I dont find the pricing an issue between PHP and ASP hosting. Sure you can find very cheap hosting but look at the top 10 shared hosting providers. I personally use http://www.exabytes.com and they ask the same for window or linux based hosting. But if the price on a McDonalds burger is a huge saving, then go for the cheap and nasty ones.

    In terms of ease of use, I think that if you already have Visual Studio.Net then it really is very easy to build ASP.NET websites. Even small websites are very simple to build. Of course if it is total price you want to keep low, then PHP is the best, because you dont need an expensive dev tool to create the website. But I dont think either one it is easier or better. Ease of use is always a subjective opinion anyways.

    Database connectivity:
    If you want to use MySQL, then ASP.NET has got a native DOT.NET connector, that is almost identical to using the MS-SQL connector.
    (Of course PHP talks easy to most databases)

    So it really comes down to skills, if you have C# and ASP.NET skills, then use them. Or if you have PHP skills then use them. Maybe the best one, is the one you like to use :)
     
  14. roygon

    Original Member

    Joined:
    Aug 19, 2004
    Messages:
    7
    Likes Received:
    0
    There are also free ASP.NET development IDE's (see www.asp.net although I have never used it). Cornel is right, it depends on your ability with the tools and your preference and potentially the future direction of your programming career if indie isn't a fulltime thing.

    Personally I don't see PHP comparing well to ASP.NET in any major category (ease of use, flexibility, speed, debugging, deployment etc) but I guess part of the Indie culture is to use non-microsoft products which maybe explains the very Pro-PHP responses on this thread.

    Here is a very good blog showing a comparison between PHP 5 and ASP.NET from a pro ASP.NET programmer and in the blog there is a link to a pro PHP & Oracle programmers review (which is a poor review IMHO). Read both of them and draw your own conclusions.

    http://weblogs.asp.net/bleroy/articles/193608.aspx

    But really, does any of this matter? Program using the tool you are most comfortable with and keep in mind what you would like to program with in the future. It sounds like you are wanting to go the C# route so just do it - you won't be disappointed.

    RG
     
  15. Martoon

    Original Member

    Joined:
    Nov 5, 2004
    Messages:
    329
    Likes Received:
    0
    That should be "da bomb-diggity snarkwhistle." Watch your grammer, son.
     
  16. Og!

    Og!
    Original Member

    Joined:
    Feb 13, 2005
    Messages:
    11
    Likes Received:
    0
    Server side language != web development model

    hey tentons,

    I program in both php and asp.net/c# at my day job. My use of each is pretty well partitioned into aspx stuff for backend type pages and php for pages that folk see.

    The reason for the seperation in my work doesn't have anything to do with differences between php and c# as languages. It doesn't have anything to do with performance or server platform either actually - it has to do with the difference in the model.

    I think it's bad to conflate c# and asp.net too much - asp/aspx is really a web model that has content of your web page represented as objects that can have server side code linked up to them. C# just happens to be a nice language that is commonly the code behind. PHP on the other hand is generally used in a web model where your pages are conceived as text streams.

    I find that the object model of asp is generally something that's kind of in-the-way and a bit black magic-y (not that getting html to look right in a browser isn't...) but the worst aspect about it for me is that it makes the page content too dependent on the code behind - which means it's very hard to collaborate with an artist on page design for instance. The best aspect of it is that I can have a pretty simple chain from database query results all the way to drop-down list, selection box, form or whatever. All that means I like it for back end

    I find the model of using a script to stream content into the page source to be more "honest" in that you are much closer to the page output, but it also means you have to do work in advance to be able to start working at a high level (which I generally do, with my own template systems and form/control libraries and all that). It's basically very low level in terms of the page generation, but still very high-level swiss army knife in terms of the functionality to do that generation.

    ... also, FYI, from what I've read from c# and asp.net architects, streamlining the server database to remote user-interface connection is what they are all about and will continue to move in that direction. PHP on the other hand was designed to be scripting glue for every type of functionality you can imagine, and has no designs to be anything more.

    ...Bottom line though, both models are still actively in development, so both will be useful for a long time to come. Also IDE's and platform support will always come with time, so I wouldn't trip out over server cost and platform stuff past finding a provider for what you need at a price you are comfortable with.

    sorry to go so long, I'd say you should keep learning asp.net/c# and using it when you can because eventually you'll hit a place where it's perfect, but always make sure PHP is available because it's just too darn useful and flexible.

    ---
    PS I'm just curious tenton, what is it about the idea of having c# behind your web pages that appeals to you so much?
     
  17. James C. Smith

    Moderator Original Member

    Joined:
    Aug 21, 2004
    Messages:
    1,768
    Likes Received:
    0
    That sounds similar to what we do. The ASPX code handles back end transaction processing and generates an XML “feedâ€￾ that is fed into PHP code for presentation an HTML.
     
  18. tentons

    Indie Author

    Joined:
    Mar 1, 2004
    Messages:
    664
    Likes Received:
    0
    Thanks for the replies everyone. Interesting to hear all the perspectives.

    I already know PHP, and am learning C# and really love it. Basically I wanted to decide if I should trim my skill set to become more focused on C# since I want to use it in the future for game programming, but obviously I also need a web site. If I could use C# for both, it would allow me to focus on fewer languages (going deeper instead of broader).

    At this point, I think I'll settle for knowing both, although my PHP skill is now rusty since I haven't been excercising it regularly (and thus the desire to trim my skills because it's time consuming to refresh). I like PHP and I like C#. It's probably more pragmatic to go with PHP for web development since I've done it before, and there's less education I need for that route.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer