Thursday, May 21, 2009

Debate(part II) - .NET V. PHP: Top 6 Reasons to Use .NET

1. Speed

Just like all .NET applications, ASP.NET applications are compiled. This makes them much faster than PHP, whose applications are interpreted. To achieve the same effect with PHP, Zend and PHP accelerator must be installed on the server, and this is rarely the case at most Web hosting companies. Also, OO is much faster in ASP.NET than it is in PHP.

2. More Language Support

ASP.NET is written using "real" OO (Object Oriented) programming languages of your choice. PHP is just a simple scripting language in comparison to .NET languages like C++, VB.NET or C# -- languages that give you more control, and more reusability. That said, these languages are also harder to learn and master, and might be intimidating if you haven't been programming for very long. ASP.NET, for example, can't be picked up as easily as PHP, though C# is not very hard to learn if you already know PHP.

Another good thing about .NET is that it has multi-language support. You can currently write (or will be able to in the very near future) ASP.NET applications in C++, C#, Visual Basic.NET, Jscript.NET, Python, Perl, Java (J#), COBOL, Eiffel and Delphi. You may even find yourself writing your ASP.NET applications in PHP in the future -- it's not impossible!

What's nice about this is that you can mix the code. can instantiate an object in C# from a class written in C++ or VB.NET. This increases the programmer hiring pool for companies, and improves your chances of finding a suitable pre-written class for your project on the Web.

3. Your Choice of Development Environments

This is an area where ASP.NET shines!

Microsoft has released a free development environment for ASP.NET called Web Matrix, which blows all other free development environments for PHP out of the water. It has a built-in Web server, database administration interface FTP integration, and more. Not only that, Microsoft has also released MSDE -- a free development edition of MS SQL server. It has precisely all the features of the full MS SQL server 2000, and any application you write for MSDE will run fine on MS SQL Server.

If you can afford Visual Studio .NET, it, too, offers some amazing qualities. It allows you to:

* automatically create reports and diagrams from your databases,
* debug the code line by line, while at the same time seeing what happens in the application,
* assign a temporary value to a variable in the middle of execution, in order to test out different scenario,
* hover the cursor over variables in your code while debugging, to see what value they have "right now",

...and much more.

4. It's Part of .NET

ASP.NET is a part of .NET, and that benefit is too large to simply ignore. If you know how to write ASP.NET applications, you know how to write ordinary applications too. Even windows apps, if you read up a little on the Windows Forms classes (as opposed to the Web Forms). PHP has PHP-GTK, but it's currently very immature compared to .NET.

5. It's Cheaper to Develop for

Didn't expect that one, did ya? It even surprised me! Due to the fact that ASP.NET is such a powerful application, and it's offered for free (including the code editor, Web server, and FTP client), I actually ended up paying less ($0) than I did for my PHP Development Environment composed of UltraEdit ($35), Bullet Proof FTP ($30) and mySQLfront ($0). With that said, hosting ASP.NET is still more expensive than PHP.

6. It's Cross-Platform

.NET is currently pretty much tied to the Windows platform. This is a bad thing, but I'm quite confident that .NET will become very cross-platform in a few years. Why? A while back, Microsoft released Rotor, a Shared Source implementation of the CLR (CLR = The thing that runs code) and most of the non-windows specific class libraries for Windows and BSD Unix, with source code for both. When I first heard this, I didn't believe it -- that REALLY didn't sound like something Microsoft would do. And when I realized that it was in fact true, I expected Rotor to be the smallest and most feeble implementation Microsoft could possibly get away with.

I couldn't have been more wrong. Rotor hasn't been built on the cheap -- it's practically identical to its commercial counterpart in most important respects. .NET also has a very powerful Platform Abstraction Layer, making ports to other operating systems pretty easy to achieve. Not only that, but the CLI and C# are now standardized by ECMA. And the Mono project, with Ximian behind it, is working on an Open Source implementation of the .NET framework right now. All these factors lead me to believe that the chances for .NET to become cross-platform are very high.
Try it!

But don't take my (or Harry's) word as gospel! Try ASP.NET out for yourself. First, download the .NET framework (21MB), then download MSDE (MS SQL 2000-light I talked about earlier -- 33MB) and finally, ASP.NET Web Matrix (1.2MB).

Once you have these installed, you're ready to develop ASP.NET applications -- go check out the official ASP.NET Quickstart Tutorials, or even better, Kevin Yank's excellent article series on beginning ASP.NET. Enjoy!

Hear both side ot the argument! Find out why the opposition thinks PHP is superior, and make up your own mind!

No comments:

Post a Comment

About Me

Hyderabad, Andhra Pradesh, India
I'm a MCA graduate working as a Web Developer.