I am not really familiar with PHP, but I get the impression that it is like JavaScript (syntax-wise).

What are the benefits of a dynamically typed language, when compared to a strongly typed language like C# or Java, and how would this help in the context of web development? What would make a dynamically typed language so attractive? Or, does the popularity of PHP have more to do with it being free?

Okay, I think I better give a little more background to get more meaningful answers, because I am not wanting a flame war.

I come from a C background, and when I moved into C# and Visual Studio. Having code completion, integration with an SQL database, huge existing class libraries and easy to access documentation, as well as new tools such as LINQ and ReSharper was like heaven. I didn't enjoy JavaScript before JQuery, but now I love it as well. Recently, I ported a PHP project over to C# and I used Zend to help me debug and understand more while porting - instead of maintaining two code streams. That also cut down on the cost of the server and maintenance.

Getting into PHP would be nice. I think that Visual Studio has spoiled me - but again Eclipse is also equally spoiling.

It would be nice to have an answer from someone who has experience developing both under PHP and .NET.


nothing personal seanlinmt, but this question comes across as ignorant and highly biased, IMO

Written by nickf

No worries, I had a feeling this question would attract attention. :) Ignorant with PHP, yes but biased towards?

Written by seanlinmt

Biaised against PHP.

Written by Sylverdrag

of course it's ignorant, he says he's not really familiar with PHP, hence the question :)

Written by Zeus

Shoving hot pokers in your eyes. But that's just my opinion.

In my opinion, PHP is something you use to create a quick dynamic web page. For larger projects you should probably look else where.

Written by Ben Shelock

Accepted Answer

I am not really familiar with PHP but I get the impression that it is like javascript (syntax-wise).

It falls into the group of languages that take inspiration from C, but that is about as far as it goes with similarity to JavaScript (which is a prototype-based OO language while PHP is a classical OO language).

And I can't imagine doing a huge project with javascript.

I can. JavaScript is rather nice, once you get into the right mindset.

My main objections to PHP are the amount of stuff it puts into core (rather then organising things into optional namespaces) and the inconsistency it has with argument order and function naming conventions.

Wouldn't it be nicer using a strongly typed language like C# or java?

That is somewhat subjective. I've talked to people who love strong typing and people who hate it.

So I wonder why PHP is still so attractive?

  • Hosting is easy to find
  • Upload a script and go - very low barrier to entry
  • Lots of cheap PHP developers out there
Written by Quentin
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki