Question:
Which is better PHP or ASP.net?
anonymous
1970-01-01 00:00:00 UTC
Which is better PHP or ASP.net?
Thirteen answers:
just "JR"
2009-06-25 05:39:57 UTC
PHP, [www.php.net], while loosely based on C and Perl, has never faced the overwhelming complications ASP has. PHP is an object oriented language - though scripts need not necessarily be developed that way (there are still a vast number of developers preferring procedural programming, and PHP caters to both schools). PHP is both cross platform and open source, available for every major operating system and works with most web servers. It is easily extendable by anyone capable of coding in C, and comes pre-bundled with more functionality than ASP could ever offer. Simple capabilities, such as FTP, data compression, file uploads, XML, MD5, encryption and email are not included in ASP and require expensive, third-party packages to be installed. All of this functionality and more are built right into PHP. Complex functions such as dynamic images, IMAP, SNMP, dynamic flash, PDF, native access (non ODBC) to Oracle, Ovrimos, Postgre, Sybase, mySql, MSSQL, Ingres, Interbase and Informix databases, LDAP, and sockets, just to name a few, are available for free to any installation of PHP, but are not (and probably never will be) available with ASP. In addition, one could make the point that PHP is a more mature language than ASP. ASP has only been around since 1996; PHP has been around since 1994, and has a huge base of developers working on it every waking minute of every day; bugs are usually fixed within minutes of being reported and new features are being integrated daily.



1) ASP is significantly slower than PHP, for obvious reasons. Primarily, PHP runs on notoriously fast Unix and Linux servers which have for years outpaced Windows running on comparable hardware. ASP does not run on any operating system other than Windows, and even then, only in IIS and PWS. I could discuss countless reasons why IIS makes a terrible web server, but that would be a discussion all on it's own. PHP runs on almost any web server, on

almost any platform. I have even built a web server in PHP which was capable of executing PHP scripts.

2) ASP natively supports only Access and MSSQL, whereas PHP natively supports a huge number of databases. They both support ODBC equally well. MySQL is a database that PHP closely integrates with; it is a very powerful database that rivals Oracle in speed. Like PHP, MySQL is free, and blows most other databases out of the water. Another hidden cost with ASP is the database angle; Microsoft expects you to develop using Access and when your webpage outgrows it, to switch to MSSQL, an extremely expensive option.



3) While even the best software has glitches, PHP has notoriously few. The PHP development team has an outstanding reputation for fixing bugs, and in order to streamline the process they even have an online system through which new bug reports can be submitted. Most bugs are resolved within 24 hours, and I'm speaking from experience here. There are a huge number of outstanding bugs in ASP which will probably never be fixed. Unless you're a major corporation, chances are that your bug report to Microsoft will likely go unanswered.



4) And finally, cost. PHP is free. ASP isn't free. If you want to use ASP, you have to use IIS, and if you want to use IIS, you have to buy Windows. Traditionally, the cost of Windows has been high. Microsoft has been aggressively trying to reduce this factor but they're hardly going to give Windows away for free. The cost of running an ASP-based website implies a full Windows server platform; development costs are higher, software licenses are expensive and speed, security and flexibility are all sacrificed.

There's a reason that Unix and Linux are dominant in the server market; money, security and performance all speak volumes.
patatasinpajamas
2009-06-25 04:31:44 UTC
For starters, I think PHP would be a better choice.



PHP has its own language and syntax which is simple and easy to learn. You can also find a lot of tutorials and free tools on the web. Plus, a lot of web hosts support PHP. Try too google "free PHP web hosting" and you'll get an ample amount of web hosting services that allow PHP scripting (most of them support MySQL database).
Cee
2009-06-28 04:53:32 UTC
For simple things, use PHP. For more complex projects using alot of business logic, you'll have less of a headache using ASP.NET.



Whether it is open source or not is irrelevant.



If you're more of a fan of scripting, use PHP. If you're more a fan of Object Oriented Programming, use ASP.NET (although classes can be created/used in PHP, I wouldn't recommend it).
superheroboy
2009-06-26 12:50:52 UTC
There's no real answer here. It's a matter of personal preference. I prefer ASP.net because of the "code behind" of C#.
bustin98
2009-06-26 08:53:28 UTC
I'm going to throw in a comment.



I like PHP for many reasons, but one big one is associative arrays. ASP needs a work around, and even then its only one level. No multi-dimensional associative arrays. You have to call arrays by a numeric key in ASP.



In the line of work I do, that's a big deal.
radhi
2009-06-26 04:57:57 UTC
php is better i think so . we can design our web pages as our wish
Dan
2009-06-25 22:42:54 UTC
Great way to start a fight.



Developers are very partial the unix/linux world or the windows world.



Many high quality professional applications are written in both php running on unix/linux and asp/asp.net running on windows.



someone stated that php has " FTP, data compression, file uploads, XML, MD5, encryption and email are not included in ASP and require expensive, third-party packages" and asp,net doesn;t. this is not true.



asp.net uses the .net library which has every one of those.
anonymous
2009-06-25 04:44:38 UTC
It is an interesting question. Of which there are too many options to tell you which one you should go with. I have worked with both PHP and ASP.NET



I would tell you that the more languages you know, the more marketable you will be. It will also give you an insight to the simple fact that sometimes PHP is better and other times ASP.NET is better or perhaps another task is suited for JAVA.



I have worked on several applications that mix langauges because each language has their own benefit.



Largely, it depends on where you want to work and the type of work you think you would like to do. If you want your own webdevelopment business, then spend some time looking at both languages and trying to do some common features in both like a user login feature and form submission to email. You determine what you would prefer to use.



If you are trying to look at a specific market such as online games, education, social websites (like facebook), or even government, then search a job site like http://www.dice.com for your area and see how many jobs are available what their pay rate is and who those jobs are for.



When I searched for jobs in my area I found:

228 asp.net job, 324 C# jobs, 1048 jobs for JAVA, and 138 jobs for PHP.



There are plenty of positions out there. However, if you only know PHP than there will be 138 jobs available for you to look at. You may not fit all the requirements for every company. They may ask for oracle experience or require degrees; you may not like what they are willing to pay. 138 jobs will turn into only a few pretty quickly.



While someone who knows more than php would be able to look through even more positions.



You'll discover that some languages are easy to learn at the same time. C# and JAVA are similar in syntax; ASP.NET is a framework not a language. You can use C# within the ASP.NET framework. Now, you have expanded your marketability.



Again, what's better for you depends on what you are looking to do with your career as a developer. Take the time and find out who is hiring in your area and what they are asking for and then make your decision.
elven_rangers
2009-06-25 03:07:19 UTC
The advantage of PHP is that it's completely cross-platform. That is, it will work at full capacity on both Linux and Windows.



On the other hand, for ASP.net there are a series of third-party extensions and add-ons to make it work with other web servers than Microsoft IIS. Those extensions sometimes greatly reduce the performance of ASP.net since the native environment is .net Framework.



On the other hand, the native platform for PHP is C/C++ (which both Windows and Linux rely on).



Given that the vast majority of web servers on Internet are running Linux/Unix/BSD, I'd say the advantage goes to PHP both in terms of performance and availability.



PHP is also a bit easier to get into if you have some C++/Java background since the object-oriented model of PHP comes from these two.
Nahee_Enterprises
2009-06-25 03:30:26 UTC
They will both do a lot for you, and they both will be around for several years (though PHP might be around longer in the end). But Microsoft's ASP is more proprietary and requires a few extra things.



Personally, I would go with PHP since it is more cross-platform. Plus, it is easy to learn, you can find several tutorials online, many free tools, and it interfaces with many databases very well.
Bob M
2009-06-25 03:38:15 UTC
Cost first-

UNIX/Linux hosts are much cheaper than Windows hosts. Search for web hosts and compare the prices of any of them, you will find you get much more for less cost when you choose a Linux host package.



Development -

.NET is very easy, you could use C# or VB to develop your web application. We keep getting told that asp.NET is language independant, but that is the sort of thing only said by Microsoft, ask anyone who has tried it and they will tell you just how un-independant it is.



PHP is an easy language to learn too, seems confusing to a new developer, but really it isn't hard. Here is the typical hello world in a fully functional web page -




echo "Hello world";

?>



No way in the world can you do that in just three lines using .NET.



PHP also has a massive collection of libs and classes that practically make it a matter of plug and play applications. Every PHP programmer has these two bookmarks -

http://www.php.net/

http://www.php.net/manual/en/funcref.php



There are times when I go to other sites for some specialist information, but 99% of the time I just have the functions ref open because it is really all that you need.



Tell you what, go to the first of those links, go through the first tutorials, yes you will make some early syntax errors, but you will find it easy to learn.



Also get yourself Netbeans, some use only download the one with PHP, you can get the others from inside Netbeans when ever you like, beware some are huge and take several lifetimes to downloand, so only get the PHP one.



Some people use Eclipse instead, this is bulkier, but until you get further in programming you wouldn't gain any real advantage from it.
?
2009-06-25 03:03:30 UTC
ASP.Net is only good for as long as Microsoft keeps supporting it. If you are looking at web servers, stick with PHP. The LAMP configuration (Linux, Apache, MySQL, PHP/Python/Perl) is still the workhorse of the Internet. Also, ASP.NET programs are usually not written in ASP. They're written in either C# or VB and then compiled (I personally don't like either language very much, but that's just me).
Raja
2009-06-25 03:06:18 UTC
php and asp.net are server side scripting languages

Benefits of php:

1. easy to use (doesn't declare variables and no need for data types, its automatically converted)

2. basic skills are enough to work with php

3. open source

Asp.net benefits:

1. using with web and desktop applications

2. you must know oops concepts

3. windows product



php is a simple and powerful dynamic web development language, it’s not used for desktop application.

ASP.net is a complex language compare with php and you must know oops concepts before you start working with asp.net

My suggestion is you can choose based on your technical skills.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...