Blog Views


Thursday, October 13, 2011

ASP versus PHP The Big Dog challenge

Introduction

So I get asked a lot what is better PHP or ASP.NET (oddly enough not as much about Java as I would think). I always find myself stopping and having to think to myself, how does one answer a question that is much more based on the business need and resources available (monetary and employee). For instance if you were to say that you were a start up company with $5,000 to your name 2 employees one of which has done some web design (mostly html). I would say PHP all the way. For several reasons that I will get into later.

Now if on the other hand, you were a medium sized company with some Windows machines, your own Domain etc... I would lean more towards ASP.NET. I'm not at all saying that a huge corporation cannot benefit from PHP by any means. I believe parts if not all of Amazon are PHP based. This article is much less a debate and more of a giving my own experiences and knowledge and putting it out there for everyone to make their own decisions because in the end, it soley depends on your particular scenario.


ASP.NET ( Bill Gates and beyond!)

So if there is one thing I can assure before going any further is that if you know ASP as ASP Classic, this is nowhere near what ASP.NET is. ASP.NET combines web techlogies such as AJAX, HTML, Javascript and CSS and attempts to make a nice platform within Visual Studio for .NET programmers to transition into designing robust Web applications. Notice how I said "attempted to". As you may have read in my other post about ASP.NET versus MVC For the love of MVC, Web Forms uses the drag and drop controls concept to add things like tables and text boxes to your web application.

While a great idea, the concept of compiling your code after every little change instead of using an interpreter like PHP where individual files can be uploaded without effecting anyone else can becomes problematic when multiple developers are maintaining a website. Another draw back to web controls is that they cause quite a bit of overhead as well as unexpected tag IDs especially when using Master files.


This by no stretch of the imagination means that ASP.NET is horrible never use it. It has it's uses and one of which is it is extremely good at RAD (Rapid Application Development). You don't have to spend months learning 3 languages (HTML, PHP, and CSS) in order to build a simple Website with a contact form. ASP.NET is also still great for development teams that comprise mostly of software engineers/developers. It is a very easy transition into the exciting world of Web within minimum previous knowledge.

Another part of ASP.NET that has taken off by storm is MVC which is actually a design model developed in the 70's, but has since been adopted by Microsoft as well as other languages such as Ruby on Rails. This adoption has allowed Microsoft to bring the HTML and JavaScript control back into the developers hands, but still allow .NET platform compatibility. For more information on MVC, see the above post.


So is it worth it?

ASP.NET in some cases is able to some things much better than PHP. One of which is it's interaction with the Windows machine, auto authentication via IE and easily create hooks into Active Directory. Again, not that PHP can't do some of these things, but it is easier with ASP.NET because it is made to handle. This also should set off a spark in your head that asks the question "Is our business a Microsoft house?" If the answer is yes, more often than not, ASP.NET is the way to go. If you are more of a Mac or Linux house, then PHP might be your better option.


Cost

Although ASP.NET itself does not cost anything, you really must run ASP.NET on a Windows server which cost money for licensing. PHP on the other hand is open sourced, so it's free for anyone to use.


PHP ( The way of the open source)

PHP has been around a long time now and has definitely come a long way, but I can't say that I would call it a RAD language. These days business want to see things out yesterday. The ways that you learn in school that everything needs to be done a certain way and takes time blah blah blah can be thrown out the window. RAD development is the way of the future and won't get any slower. PHP definitely takes someone with a certain mindset and C or C+ background wouldn't hurt. Although they are trying to add the OOB functionality and Systems such as CakePHP and Joomla try to create API's for it, it still isn't OOB and can get awkward trying to get it to be.

With that said though, you can make things pretty robust with PHP, it just takes time and experience (and patience). Another big negative I find with PHP is it really has no IDE that has the kind of IntelliSense and productivity tools that Visual Studio has. None that I have seen even comes close.


There you have it!

The above is based on my experiences with the 2 languages and please take it for what it is, an opinion. Nothing more, nothing less. I tried to make it as unbiased as I could although, I feel like I gave ASP.NET more props because it is what I currently use. I have spent many years on PHP though and have to say that if given the funds to spend on the hardware, the new MVC framework along with Visual Studio is what I would choose. I feel like productivity goes so much smoother and strongly typed is just awesomeness with whipped cream on top!

No comments:

Post a Comment