views:

288

answers:

6

Hi,

I am new to Web Programming and I hear that there are many biggies like Java, .Net and PHP for Web Application Development.

I would certainly appreciate if I can get some insights on how this technology stack up in comparison and in what scenarios one would prefer one technology over the other.

Thanks for all guidance in advance.

+18  A: 

PHP has low resource requirements, really cheap hosting, really low barrier to entry and is the most popular Web framework bar none.

That being said, PHP is a purely interpreted language (opcode caches notwithstanding) so tends to be slower than Java (not that that usually matters), the syntax is inconsistent and it's easy to make huge errors (like not sanitizing database query inputs; but you can do that in any language).

Neither is better than the other. For casual Web development I definitely prefer PHP most of the time. Java is probably better for more "enterprise" type software.

cletus
+1 well said...
Robert Greiner
Except PHP is not a web framework. It's a language. Also, there's no mention of .NET. But I do agree with the second paragraph (it's all truth) and the beginning of the third paragraph.
Thomas Owens
+2  A: 

One thing to look at when making your decision is how you are going to host your web-app. If you are looking to host it somewhere cheap you will be limited to what you can use, most likely things like PHP or ASP. If however you are willing to spend more money (or host yourself) you can get more control over your hosting and therefore make use of more technologies.

I have fairly good control over my hosting package but I have stuck with PHP because I found it easier to get to grips with having not really done anything like it before.

DaveJohnston
+6  A: 

This is just my opinion:

PHP is a great language for building the web pages themselves. It is relatively easy to learn. And it is very easy to combine the static HTML and the custom generated one. It is quite powerful. For example, Wikipedia's MediaWiki is written in PHP. It is also straightforward to access databases. But in the end, it is essentially a scripting language. It's hard to write maintainable code, and complex logic (e.g., a lot of calculations, algorithms, etc.) is not very natural in PHP.

Java is more of a "serious language". It can do a lot of things. Including web. However, creating the HTML is more "painful" and less natural than in PHP. Java shines, however, where there is a lot of smart logic in your program. There are also advantages to writing in non-scripting languages. And of course, if you know Java, you can use it for a lot of things.

.NET is nice, but generally restricts you to windows platforms, and the best tools are not free (unlike Java). I would only go into .NET if your local job market has a lot of .NET jobs, that changes a lot from place to place.

Also, PHP jobs generally pay less than Java/.NET jobs and seem to have a lower reputation.

Uri
having just done some job searching I can also confirm that PHP developers are paid less. Very frustrating.
nickf
+3  A: 

If you're new to web application development, make sure to give Ruby on Rails a try as well. It's a joy to work with compared to Java and PHP (I've worked with all 3). It's fast, common tasks are very easily accomplished and the community is huge and vibrant.

MattC
A: 

People make a good point about the inconsistencies of PHP. However there are numerous frameworks available that alleviate a lot of the problems of 'vanilla' PHP. So the low barrier of entry + huge community + numerous frameworks = the best web programming language IMHO.

Arms
A: 

I agree that the barrier of complexity to entry for php is lower, so on average you probably get more supply (php programmers), more demand (php type jobs), at a lowered-by-competition price (lower job salaries on average).

From a starting web-programmer perspective, php is good because you can use it in so many ways, html + a tiny bit of scripting, extensive procedural programming, OOP, and even something resembling functional programming. Since the web is so easy to get an audience for your software, you can really keep learning while you're doing. Php is what let me break into programming, which I don't think I would have managed if I were working with a language less tied to the web. After a good 6 years, off and on, I've got myself to the point where I'm comfortable with php as a job, but am looking to personally break from web programming to off-the-web programming (trying to get into clojure) and different languages. After all this time, I've become more and more aware of the often-lacking-security and the filled-with-legacy-functions nature of php.

The php language itself has a huge base of relatively high level functions built in that match tasks that people have done in the past, so you can get some complex concepts distilled into simple functions, even before you go messing with the many choices of libraries that are out there. So you can pretty much work with a huge body of code out of the box on most servers.

So it's an enjoyable way to break into web programming and build up your body of knowledge, a great jump-off points, though not such a specialized language that you can rake in the dough without a lot of work. From a hiring perspective, it's probably pretty easy to pick up a kid off the street who can write a quick web-app in php (that probably describes me a few years ago), but much harder to get someone who will write code that will be maintainable in five years.

Oh, and one more thing: doing programming needs source control, so get to know git and github.com or gitorious.com. It's hard when you first start to get into it, so cheat and use whatever tools and aids you can, but it's so worth it to have the freedom of being able to write whatever kind of programming you want.
The git website about git:http://git-scm.com/ Github guides on git: http://github.com/guides/home

It'll open up how you work and prototype.

Tchalvak