PHP or .NET? Help me to choose!
We’ve all encountered it before, and we’ve all asked this question in one way or another. I see it appearing in Yahoo Answers every now and then, and I see similar platform comparison in blogs I read. Its clear this issue is still quite relevant today and will continue to be tomorrow.
So which is better? PHP or .NET?
I did some searching and came across plenty of articles discussing this issue, and here are some of the better ones I read:
So instead of debating the finer points about whether it better that ASP.NET is compiled and PHP is not, I want to take a step back and look at this issue from another angle. I’m really talking about that decision process every developer will go (or have gone) through sometime in their career - the decision that puts food on the table.
Where’s the cheese?
There’s no point debating over whether PHP or .NET is better if there are no jobs available. Thankfully, from what the few job sites I searched on, both PHP and .NET have opportunities available. My search at monster.com gave me 2560 jobs for ‘php’, more than 5000 jobs for ‘.net’ and more than 5000 jobs for ‘java’.
I know this is by no means scientific, because other factors are not taken into count - like where you’re located, or the number of jobseekers competing with you. In any case, your own search for job openings might help you decide whether PHP or .NET is better as a career choice.
Feel comfortable
When I started in my career, I was using Classic ASP for about 3 years, after that I switched to another company where I ended up using PHP (version 3, at that time). I tell you, the moment I was on PHP, I never looked back at ASP again. It just felt more comfortable and more intuitive for me. I felt that I was more productive in using PHP than I ever was with Classic ASP. I liked the PHP syntax, I liked the whole Linux environment and working with MySQL was a breeze.
Whether its PHP or .NET, one of these technologies should feel more ‘comfortable’ with you than the other. It’s like choosing between Burger King and MacDonalds - you will definately formulate your own opinion about which you find more comfortable. It could be that you like the fact that PHP is so community driven, you can interact with that community, openly share ideas and help, and get your hands on open-source apps. Or, maybe you like .NET because you like that structured NET framework, and you get a big kick out of using Visual Studios. Whatever. Just get comfortable.
Jack of all trades…
Whatever you decide, I dare say, don’t be a jack of all trades. Specialize. If you want to have any market value, you need to be good at what you do. It’s a full-time job just to be clued in to either domains. You will only be good at whatever do you if you enjoy the work. Again, my point - get comfortable.
In my case, PHP has put food on my table, and has done so for many many years now, and I know, no matter how crappy PHP gets, or how great .NET becomes, I would still keep using PHP.
What about you?
- Why should you use PHP?
- CakePHP: Using scaffolding for rapid application building
- Cacti: Using Cacti to monitor web page loading - Part 3
- Review: Programming PHP (2nd Edition)
- Webmaster tools I can’t live without






None of the above: choose Ruby on Rails instead!
In terms of job security Java and .NET are probably better prospects than PHP. The advantage of ASP.NET over Java is that Java web apps are written using many different frameworks by different programmers, so it is difficult to learn just one framework and be productive at most Java shops. Of course current JVM implementations are far more sophisticated than the .NET CLR in terms of optimizations and instrumentation and they also sopport more platforms.
In the long term there is probably a good chance that ASP.NET will be replaced by MS with something else leaving you high and dry with your ASP.NET skills (As has happened with classic ASP).
The tooling for PHP is probably the worst compared to the visual designers you get with Visual Studio or Netbeans for Java.
There, now I’ve enraged the .NET, PHP and Java folks in one post!
Pick your poison
Go with Java or PHP. They are open technologies that will live long past .NET.
Have you seen the new NetBeans PHP module? PHP already runs on the JVM (see the work that resin has). So with Java/PHP you really don’t have to choose platforms, just languages.
I’ve bounced back and forth between PHP and .NET jobs. I really like the simplicity of PHP and Linux as a development environment/application platform, but Windows Server 2008, IIS7, and the MVC extensions to .NET 3.5 may change my opinion of ASP.NET for the better. I really do like the .NET framework, so I would encourage you to keep your skills on both fronts sharp. Above all, make sure you learn and apply good OOP practices no matter what language you choose, and start learning about design patterns if you haven’t already. Everything else is convention and libraries, and you can learn those relatively quickly.
you are forgetting Corporate implications. Size of company has bigger role in selection of technology
I’ve tried .NET, PHP, Java, and Ruby (rails).
I feel most comfortable using either PHP or Ruby.
If I had to choose between the four, i’d choose ruby, php, java, .net, in that order.
the main reason is that, like you wrote in your post, i feel comfortable with one more than the other (+ productivity).
i used to program full-time in php, but i’ve been transitioning to ruby for a year now and i’m hoping ruby will be as mainstream as php in the near future.
good article !.Funny you should post this now though since I am trying to shift jobs and the php market here(South Africa) is very poor(companies do not want to pay for php developers) to the point were I’m considering going java or asp…not much of a choice if you ask me, but I have to eat.
Wow, great comments guys. Thanks for sharing.
@Me: I also get the feel that .NET or Java are better career prospects. Somehow PHP just doesn’t cut it as a mainstream enterprise tool. And of course good visual tools help to.
@ncloud: I dunno, I still think eventually a developer has to settle on one technology over another. It’s really hard to be able to keep your skills “sharp” as you put it, when you’re attention is divided. Maybe it’s just me, not so good with multitasking.
@ronald: I know what you mean, in Singapore here, I’m really lucky to land myself in one of the very few LAMP-centric companies here. The mainstream choices here were either Java or .NET. Neither of which I’m very good at.
The Answer is …
Mono. Mono has almost complete asp.net stack including ajax. This way you can work on any operating System, windows, linux mac and your program will be cross platform. It is open source and linux ide is free too! Along with great community/first hand developer support technically mono is unbeatable
I have worked with all three. They each have their place but my personal choice would be C# and then PHP. Java wouldnt even be an option.
.NET is a well thought out framework which can accomplish anything you can think of. If you write your code correctly, it will also run on Mono in Linux so you can still stay away from Windows (if that is your cup of tea) and coupled with the MySql .NET connector, you can also steer clear of SQL Server (which is what I do on all my projects).
Additionally, unlike the other two, .NET rarely needs any additional libraries to get things done.
I work with Java and Eclipse at work every day and one thing I must say is that Eclipse (MyEclipse 6) is garbage compared to Visual Studio 08!
But like I said, they all have their place.