How do I choose between PHP and ASP.NET?


This is my first time I visit Sitepoint. I have heared good things about it and I hope that I can find people who can help me. I’m in the middle between PHP and ASP.NET. I read the first chapters of some books for both languages but I could not reach to the place where I can decide which one to choose. I also read many articles which comapre between the two technologies.

Now, you are the experts in the filed and I need your help. My goal is to build dynamic websites that will be fast and secure. I also may go with freelancing and provide services for customers to build their sites. My targeted audience may be: public persons, schools, clinics, hospitals, shops, hotels,etc.

Do you have something to say?

I let the client decide. I do both, and the client usually either 1) already has an established site that needs updated, 2) has a server that only supports one or the other, or 3) has a direct requirement which language to use.

If you are going to freelance, you will definetley find more PHP jobs, because a lot of comercial CMS and blog platforms are written in PHP. Regarding security, application is as secure as you write it.
Good luck on your quest!

In my experience is more suited to a commercial environment than PHP is. Unless the PHP is done right by a team of people who live and breathe Open Source and actually know how to use this tool properly. This opinion does come with a small caveat though, which is, I’ve worked for some very bad companies that didn’t truly understand PHP or could get more work and wouldn’t even consider PHP. Or they didn’t want to spend the time scripting with PHP the proper way or focus on security. They wanted it yesterday kind of attitude. So my first sentence could be a slightly warped opinion due to my exposure to both languages thus far.

However I have had some albeit limited exposure to several popular PHP frameworks and frankly they’re just a hode podge of horribleness. Codeigniter is fairly clean but a bit limited in my experience but quite frankly I’d rather code by hand. PHP was never built as a framework, was, simple as. Zend is just a nightmare, if you learn Zend then in an odd sort of way you’re learning Zend not PHP. Don’t take my literally there as it’s still PHP but its kind of ZENDY :).

Some of the commercial work I have done with PHP has also been horrendous while using off the shelf systems, moodle being a prime example and even wordpress. Again my opinion here could be skewed due to a lack of training provided by the companies I’ve worked for and having to “muddle” through these systems. But I would often look over my shoulder and see my counterparts getting things done quicker in umbraco for example and generally having less stress. Everything just seems clearer and more structured with .net I feel. But having to compile stuff into .ddl files looks like a right pain in the rear, at least with php there’s no messing around like that.

I do strongly believe as well though that because is a Microsoft product it automatically becomes the default option for clients, again this could be because of the companies I’ve worked for not giving good enough advice to clients about other options.

One thing which cannot be skewed by my opinion however is the amount of C# / VB (mostly C# though) developer jobs listed on job sites in my area compared to PHP developers. I would say that in my area developer jobs outweigh PHP Developer job listings by 20 to 1. At least that. I’m really considering making the switch as it’s been this way for several years now and they get paid more it seems as well.

So thats my opinion from a commercial point of view if you had to work for a company that had medium to large clients. If however you’re a freelancer looking to target public persons to use your wording then I would definitely go with php. If you can control what happens on a project in a freelance environment like that then I do think PHP is a nicer option. More important or bigger clients may however favour .net.

You’re best option is to be “language agnostic” and get a good grounding on general programming principles and how to think like a programmer. Have an open mind about all languages. Don’t get dragged into the “this language is better than this language” arguments because I can tell you this fore sure; this field can change in a snap and you better be prepared to change with it. If you keep your mind open and get good general programming foundations you’ll be better placed to pick up a new language when and should you need to.

Couldn’t have said it better myself. I tell everyone that I’m an expert at none, a student in all (although many of my peers would say I’m an experts with .NET and PHP, you’ll rarely hear me say it). The biggest obstacle a programmer to be needs to overcome is to learn to think logically. You need to be able to visualize what the application/project needs to do, break it down into small tasks, and then be able to write them in a language of your/or the clients choice.

Once you know how to think like a programmer, the rest is syntax, you can usually learn a new language well enough to be dangerous on a weekend (I did with Java and Perl) or at least well enough to modify an existing application.

Symphony 2 is written beautifully with no ‘hodge podge’. One can learn a great deal about good OOP PHP programming including clear example of patterns by studying the code base. As mentioned PHP is a ‘double-edged sword’; with its ease of adoption it invites inexperienced people who sometimes sign up for jobs that they are not qualified to handle. This has in some cases put a stain on PHP work. However, there are also a good number of experienced PHP developers that develop fantastic applications and make good use of frameworks and libraries.

Normally the people I work with don’t care what technology it is written in they just want it to work. I sometimes use, JAVA, and PHP. Like @cpradio ; mentions the more you can learn as a freelancer the better and after a while you are able to switch between languages with relative ease.