View Full Version : What to use ASP.NET or PHP
jhonlever
06-30-2011, 04:20 AM
I am looking to design a site but I am not sure what language to use. I have heard how good php and MySQL is and it is open source and I can use oSCommerce with it too, but I have also heard some raving reviews about .NET and XML awith the SQL Server 2005 soon to be released.
I am just wondering what everyone else thinks and what their opinions are?
deepsand
06-30-2011, 04:27 AM
PHP is a specialized scripting language; you cannot build an entire site using it alone.
ASP is not a language at all, but a specialized application that serves as a platform upon which a site is built.
denvermatt
08-09-2011, 07:59 PM
I've programmed in both, and used both extensively.
LAMP (that's Linux, Apache, MySQL, PHP) setups are the most common in the world. By learning to program in PHP and set up LAMP environments, your website will be portable from one hosting service to another and you'll be using a technology which is understood by a much larger percentage of the programming community.
You can easily hire PHP developers. You can easily find LAMP environments to host your sites. You can set up LAMP development environments for free on old laptops and don't have to pay thousands of dollars per machine for all that microsoft software.
Anything you can do with ASP you can do with PHP including all the XML and AJAX stuff.
Finally, once you've developed the skillset, you'll be able to get jobs much more easily with LAMP skills since that's what most websites are running on.
Oh, and one last thing: Windows crashes all the time. Production LAMP servers are much more stable.
deepsand
08-09-2011, 10:46 PM
Without first learning the basics, which includes HTML, all of the above named are useless.
And, no, Windows servers to not continually crash. In fact, at the moment, I happen to be on one that's been running continually, with no crash ever, for 11 years.
denvermatt
08-10-2011, 12:20 AM
JHONLEVER, what's happened here is that you've stumbled upon a bit of a religious conflict. You might as well have asked which is better, PC or Mac? Coke or Pepsi?
There are some folks who are more comfortable working in a Windows environment (the moderator is clearly one of these), while most *nix-based developers consider the term "Windows user" to be an epithet. Personally I waffle between the two. Windows is easier to manage from the whole polished GUI perspective. However, for web servers, the streamlined Linux installs are fast, cheap and ubiquitous.
Learning to manage Linux servers is difficult. Sometimes I hate it. But the result is more stable and cost-effective. If you can manage the learning curve, then you won't likely use Windows for web servers anymore.
If you want to take baby steps into Linux, then I'd start with CentOS (that's the free version of Red Hat that most hosting providers use) and install a GUI like KDE. Another popular distribution is called Ubuntu, but in my experience most hosting providers don't use Ubuntu so its better to stick with something similar to the system you'll be deploying to. There are important differences, so picking the right one to learn is somewhat important.
With regard to the moderator's comment about not being able to code an entire site in PHP, that's just not correct. I've built dozens of PHP sites, and I can't really think what he's talking about with that. You do need to understand that your PHP code generates the HTML, CSS, and JavaScripts that are interpreted by the browser and so those are foundational for all web development. However, that layer is the same for all server-side languages.
deepsand
08-10-2011, 12:39 AM
JHONLEVER, what's happened here is that you've stumbled upon a bit of a religious conflict. You might as well have asked which is better, PC or Mac? Coke or Pepsi?
If that's the case, then only owing to the above statement.
There are some folks who are more comfortable working in a Windows environment (the moderator is clearly one of these), ...
Assumes facts not in evidence.
With regard to the moderator's comment about not being able to code an entire site in PHP, that's just not correct. I've built dozens of PHP sites, and I can't really think what he's talking about with that. You do need to understand that your PHP code generates the HTML, CSS, and JavaScripts that are interpreted by the browser and so those are foundational for all web development. However, that layer is the same for all server-side languages.
PHP is a scripting language that takes an input stream and transforms it into an output stream. It is not an IDE.
If you do not understand what the correct output should be, it's GIGO.
AciveLite2k
08-21-2011, 10:22 PM
PHP is a specialized scripting language; you cannot build an entire site using it alone.
ASP is not a language at all, but a specialized application that serves as a platform upon which a site is built.
Since your a beginner, some of these answers may make you feel like this may be to hard...
The above answer is very technical and assumes you understand what everyone is talking about, however...
Personally, our web development company places all our clients in a LAMP (Linux Apache MySQL PHP) environment. Mainly because startup costs for our clients are low and the servers available on the internet are available with this configuration. IE Cloud servers using CentOS...
It is my opinion that Linux and Unix environments are more stable then Microsoft environments, not to mention free. On that note, PHP runs great on those environments while ASP can not run in Linux/Unix. Our personal flavor of Unix is CentOS 5.
As Denvermatt states: you can do anything in PHP that you can do in ASP, and to add to that, I believe you get more flexibility in PHP then ASP.
A good reference book for PHP/MySQL is Learning PHP, MySQL, and JavaScript: A Step-By-Step Guide to Creating Dynamic Websites (Animal Guide) by Robin Nixon.
Good Luck! PM Me if you have any questions!
Lets start at the basic:
You will need to learn HTML and maybe some basic JavaScript to create a website. HTML is not scripting but simply a way to communicate to a browser on how to make your page look. The stuff that makes your page interactive from a users standpoint is JavaScript. You need to know both of these wether you use PHP, ASP, Perl, Java etc...
Now scripting languages and application development languages are back end (server side) languages. Programmers use them to create and process collected data which in turn dynamically "makes" the HTML/javascript that is sent to your browser. These languages can be PHP, ASP, Java, Perl, etc... Your question asks what is better PHP or ASP.
Both have their pros and cons. The question is what do you prefer.
The basic Pros/cons are:
PHP can cost you absolutely no money and their are tons of free resources that can help you create your website. Many developing environments (editors) are free or extremely cheap. If you choose PHP your allowed the flexibility to choose what OS you wish to serve your pages out of. PHP can run on a Linux, Unix, or even Microsoft based operating system. In general, web companies have relied on PHP and various PHP based frameworks to create small mom and pop based sites to large enterprise websites.
ASP/ASP.net is microsoft based - With MS Products comes licensing and costs. If you use ASP you rely on a microsoft operating system to serve your website to the general public. Many websites created in ASP/ASP.net have been created by larger companies that can absorb the cost of IT and development. Microsofts IDE is VisualStudio, which also costs money to purchase.
Now you understand the "Browser Language" and "Server Language" lets move on to Database.
You stated you want to use either MySql or MS Sql. They both essentially do the same thing for Web based businesses and with new technology improvements, they are both scalable to enterprise environments!
SQL is your database - the part that stores and sorts your data (IE in a shopping cart - the product description, price, sku, etc)
The method to communicate with the database is a whole language in itself. It's just simply called SQL and the calls to the database (DB) is called a Query. You will need to learn some basic Queries such as Select, Insert, and Delete to be able to get and put data into a database. PHP and ASP both handle these queries very easily.
With MySQL your costs are none (null)... Most web hosts will already have this installed and ready for you to use.
MS SQL 2005 or higher will cost you some $$$ unless you get the "light" edition - even then the terms state its not for commercial use. MS Sql must run on a microsoft operating system while MySql you can choose what OS you want to use.
OH... And one last thing. You mentioned OS Commerce. OS Commerce is a shopping cart written and scripted in PHP using MySql... It outputs to a browser HTML and Javascript. So if you use OS Commerce, you can manipulate the source code (PHP) to customize it to your needs. Its not that is works with php, it's written in PHP... Many other carts are also available - i.e. ZendCart, PrestaShop, OpenCart, etc...
AciveLite2k
08-22-2011, 12:18 PM
If you do not understand what the correct output should be, it's GIGO.
Just incase you don't know what GiGo is:
“GiGo” acronym like this… “Good stuff in… Good stuff out… but Garbage In… Garbage out…" OR "Goes In... Goes Out...”
What goes in PHP/ASP is processed (Goes In) then output into HTML/Text (Goes out) - GiGo