[fpc-pascal] CGI (with Free Pascal) vs PHP
cburkins at gmail.com
Tue Mar 6 15:10:38 CET 2007
This is an interesting discussion, guys. I really believe that there
is no one perfect language and some languages are better at some
problems than other. I should also know better than to argue with
people who clearly know more than I do about *writing* a language,
since I know nothing about it, and some (all?) of you are on the FPC
> PHP has serious defficiencies, one is raw performance, another is the way
> it deals with libraries, which is just like a C compiler, include all
> files you need. This means once you get a large PHP library, it starts to
> suck, even though you only use one procedure in your library.
Yes, this is a problem. In my experience, not a large one. Most
languages have problems you have to work around, this is one of PHP's.
For instance, I've had to work around the lack of hashes in Pascal (by
including some kind soul's module).
> Another issue is the dealing with databases. The php way is to do text
> substition, which is a serious risk of SQL injection vulnerabilities.
> More often than not, PHP does not do database connection pooling, and this
> because everyone is writing his own database abstraction layers, there
> exists no good database API in PHP.
The fact that there is no single database API (well, there is one in
PEAR) is oft regretted. It is indeed a deficiency. I think you'd have
to be careful about sql injection in ALL programs that take user input
and use it in database queries, regardless of the language.
> Yes, but you know what we mean. In syntax PHP cannot match Pascal.
I agree. But that is something of a matter of taste.
> PHP is not professionals. If things get big, either in code or in
> performance, PHP becoems a serious handicap.
I don't agree. PHP is used by corporations all over the place now.
I've been making a living at it since 2000. Search dice.com for 'PHP'
and you get over 1500 hits. Search for pascal and delphi, and you get
under 300. So if being a professional language means you can make a
living at it, PHP qualifies. Of couse Visual Basic qualifies too, so
I'm not sure that means anything ;)
As to scaling, that problem seems to be solvable. There have been some
very large websites using php for a while. (digg.com and yahoo.com
come to mind)
I'm don't want to evangelize PHP on a Pascal list, so I'll stop. PHP
has problems. So does Pascal. I happen to like (and work in) both.
The original poster wondered about PHP suitability to the task at
hand. IMO, it's suitable.
And by the way, FPC rocks. Really.
More information about the fpc-pascal