Page 1 of 2

Server Side Languages

Posted: Fri Jan 15, 2010 3:25 am
by AJ
Hi,

I was recently asked by a friend about Server-Side languages. They are planning to do evening-classes in web design and have been looking at PHP / ASP.NET. Although this will just be a hobby for them initially, they may consider a change of career if they like it.

So my question is not really "which is better" (no flame wars, please). It's more "Which web design technology is more of an industry standard? / which is more likely to lead to work in web design?". Would it just be best to learn both so that one technology could be used where the other falls down? Not being in the industry myself and only having ASP.NET knowlege, I really have very little idea what path to recommend.

I'm aware that people get very emotive about which technology to use and don't want them to select the wrong path simply because they have spoken to an ASP.NET / PHP zealot!

Thanks for your objective answers!
Adam

Re: Server Side Languages

Posted: Fri Jan 15, 2010 3:56 am
by pcmattman
It really depends on the server software in use (ie, how much your friend is willing to pay ;) ), as much as it depends on comfort in the languages themselves.

For instance, if you're working on Windows (perhaps with Sharepoint or just a stock web server, this is not cheap) the best choice would be ASP .NET. It's probably more of a Windows world industry standard, at least for those who are working with Windows servers (whether voluntarily or involuntarily). Knowing ASP .NET will probably bring in more career opportunities.

PHP will work on most systems with a half-decent HTTP server (Apache seems to be the most popular choice) - this means it's cheap. It's also extremely easy to learn, and the documentation for each function is second-to-none (close to the MSDN, I'd say). PHP can also bring in career opportunities, but I wouldn't call it an industry standard when comparing to ASP .NET (others with more knowledge in the field might beg to differ).

ASP .NET:
  • High standard of documentation and easy to find out how to do something
  • Used widely in the industry where Windows servers are at work (IIS etc...)
  • Allows code-behind modules in C# or VB, allowing a little more flexibility (at a performance cost)
PHP:
  • Each function is documented - you can literally Google a PHP function and get a result instantly (and some match POSIX's definition too). There are also hundreds of tutorials out there to do just about anything
  • Practically any half-decent web host will provide PHP, and it's free (Apache + PHP on a local machine gives a very cheap system to play with while learning)
  • Open source (as if that actually matters)
I've totally oversimplified this, but I hope the main idea still comes across right. Others will correct/fill in the gaps later.

Re: Server Side Languages

Posted: Fri Jan 15, 2010 4:51 am
by Combuster
Googlism says:
php developers (156 million hits) are 3x as wanted as ASP developers (50 million hits), and half those times, they mention PHP too (22 million hits). Correcting for that makes 134 million for PHP versus 28 million for ASP, which differs by about a factor 5. Which matches my personal observations that I rarely see ASP positions, compared to PHP.

So you can add the "PHP is more popular" as an argument.

Re: Server Side Languages

Posted: Fri Jan 15, 2010 5:33 am
by MasterLee
Combuster wrote:Googlism says:
php developers (156 million hits) are 3x as wanted as ASP developers (50 million hits), and half those times, they mention PHP too (22 million hits). Correcting for that makes 134 million for PHP versus 28 million for ASP, which differs by about a factor 5. Which matches my personal observations that I rarely see ASP positions, compared to PHP.
There are 132 Million hits when you search for 'JSP developers'.

Re: Server Side Languages

Posted: Fri Jan 15, 2010 11:07 am
by Owen
If you'd ever worked with JSP, you'd understand why: Nobody likes it ;)

I regularly see businesses running their sites on ASP.net, PHP and Java (Among others!). It really seems to just depend on the business; pick whichever you feel most comfortable with.

I'd evangelize Django though, but failing that, PHP is never a bad choice.

Re: Server Side Languages

Posted: Fri Jan 15, 2010 6:38 pm
by AndrewAPrice
pcmattman wrote:Allows code-behind modules in C# or VB, allowing a little more flexibility (at a performance cost)
How are you so sure? As far as I know ASP.Net JITs pages into a cache and stores it in native machine code on the server the first time a page is requested, PHP requires a 3rd part solution (phc, or Roadsend).

In saying that, PHP is the server-side language I'm most familiar with and would choose.

If you want raw speed, you could write your webpages in pure C, C++, or any other compiled language. Though for security reasons many servers don't allow this so it's not a popular choice.

Re: Server Side Languages

Posted: Sat Jan 16, 2010 3:13 am
by AJ
Thanks for the replies and for throwing DJango/JSP in to the mix! I'm still not certain which way to suggest but will point them towards this thread. I realise that some Googling and asking around is also in order.

As for the open-sourceness of PHP - that doesn't really matter although the cost considerations of ASP.NET may do. Of course with getting started, the bundled IIS is probably sufficient, but it would possibly be a problem if the site then has to be uploaded to a provider who's going to charge a lot more. I've just had a look at my own basic 1&1 package, which includes PHP as standard, but you have to pay a fair bit more for ASP.NET.

Cheers,
Adam

Re: Server Side Languages

Posted: Sat Jan 16, 2010 4:05 am
by MasterLee
JSP is loved by the General Management ;)

DJango is an Python Framework. But an more general web server interface for python would be WSGI. Also you could use perl and mason that is what amazon does.

By the way i hope that Pedrigree support for python will raise and support at least the wsgiref modul some day.

Re: Server Side Languages

Posted: Sat Jan 16, 2010 11:19 am
by Owen
Raw WSGI is like programming a raw CGI: About as much fun as gouging one's eyeballs out ;)

Re: Server Side Languages

Posted: Sat Jan 16, 2010 12:27 pm
by nedbrek
You know a bit of programming is bad when an OSDev'er says it's bad. We program in raw asm to the bare metal!

(And yes, I have written raw CGI...)

Re: Server Side Languages

Posted: Sat Jan 16, 2010 3:07 pm
by Brynet-Inc
nedbrek wrote:(And yes, I have written raw CGI...)
It's not a language.

Re: Server Side Languages

Posted: Sat Jan 16, 2010 4:04 pm
by MasterLee
Using CGI and Assembler would be an option too ;)

Or use TNTNET and C++

Re: Server Side Languages

Posted: Sat Jan 16, 2010 7:44 pm
by earlz
Ok, I am quite experienced in both languages. I have been working in ASP.Net(C#) for over 6 months now in my job. I've been using PHP for websites for god knows how long... (though I don't work on websites that much so I know them about equally). Personally, I prefer PHP as it's more "free form".. Sure it's a bit hackish around the edges, but it's trivial to get most stuff working, and the page lifecycle and strictness of ASP.Net might be good at times, but it seems to get in my way a lot more than it should..

Ok now my unbiased opinion of the two.

ASP.Net has 26918 hits for stackoverflow(for the tag) and PHP has 25365 hits. So they are about equal in programmer popularity.

ASP.Net has the pro of being able to develop in just about any language, including Ruby and Python and others and still remaining fairly constant in speed. ASP.Net can also run on *nix OSs because it runs on Mono(it works well too. We do it for a commercial application at work).

Now for PHP.
PHP is supported on almost every free and commercial host out there. Knowing PHP means you can manage just about every PHP application out there(minus framework weirdness), unlike in ASP.Net where you never know what language your up against. PHP is very simple to get started. Making a hello world is a simple as a line of code on all platforms. PHP is much more freeform. You don't like how PHP is rendering the page? Well thats your own fault, and thus you can change it without being considered it being considered inappropriate. You always know exactly whats going on.

</unbiased>

I would compare the two somewhat similar to "theoretical-portable assembly" vs. C++ where assembly is actually HTML... PHP is much closer to the HTML than ASP.Net...

Everything is possible without hacking in PHP. The same can not be said in ASP.Net (unless you count custom protocol handlers as non-hacking)

Re: Server Side Languages

Posted: Sat Jan 16, 2010 9:02 pm
by gravaera
Brynet-Inc wrote:
nedbrek wrote:(And yes, I have written raw CGI...)
It's not a language.
I found this to be particularly funny, probably because I'm very tired after doing tonnes of UNI assignments, and knowing that I have much more to do for tomorrow.

Anyway: I can only offer a biased "PHP is easy to use and widely installed and supported."

The reason I say it's a biased statement on my part is that I've never learned any SS langs other than PHP, anyway.

Re: Server Side Languages

Posted: Sun Jan 17, 2010 7:06 am
by nedbrek
Brynet-Inc wrote:
nedbrek wrote:(And yes, I have written raw CGI...)
It's not a language.
Ok, technically I was writing Perl which wrote the raw CGI responses...