To edit the page, the password is go
From: "Hayden Kirk" <hayde...@hotmail.com> Newsgroups: comp.lang.php Subject: PHP and large projects Lines: 54 MIME-Version: 1.0 Content-Type: multipart/alternative; I've used PHP for many smaller projects, but now im embarking on large corporate websites. After reading this: http://www.ukuug.org/events/linux2002/papers/html/php/index.html PHP does not sound like the right language for large scale sites. My main concern was Namespaces... What would you suggest any why? My application is relying heavily on databases, with around 200-500 co-current people using it at any one time,


 
From: "Tony Marston" <t...@NOSPAM.demon.co.uk>
Newsgroups: comp.lang.php
Subject: Re: PHP and large projects
Date: Sun, 23 Jan 2005 11:49:25 -0000
Lines: 100
Message-ID: <ct0306$l4h$1$8302bc10@news.demon.co.uk>
References: <9JJId.10663$mo2.809748@news.xtra.co.nz>
Reply-To: "Tony Marston" <t...@marston-home.demon.co.uk>
NNTP-Posting-Host: marston-home.demon.co.uk
X-Trace: news.demon.co.uk 1106480966 21649 80.177.120.119 (23 Jan 2005 11:49:26 GMT)
X-Complaints-To: a...@demon.net
NNTP-Posting-Date: Sun, 23 Jan 2005 11:49:26 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527

I have read that article and IMHO it smacks of failures at the 
designer/developer level, not the language.

(1) Separation of Presentation from Business Logic

It is not a function of PHP, or ANY language for that matter, to provide 
out-of-the box separation of presentation and business logic. It is up to 
the designer/developer to create his/her own infrastructure. I have built my 
own which is described in 
http://www.tonymarston.co.uk/php-mysql/infrastructure.html. Other people 
have built their own infrastructures which work along completely different 
lines. There is no "one size fits all" that is built into PHP, you have to 
plug in one of your choosing.

(2) Using a Team of Developers

Just because PHP gives you the ability to redefine functions does not mean 
that you HAVE to use this ability. It should be used when absolutely 
necessary. Any such failures are due to lack of discipline among the 
developers and NOT a failure with the language.

This so-called "namespace problem" is really getting on my wick. I have 
programmed with various language over the past 25+ years and none of them 
used namespaces, therefore I do not miss them. I do not see what problem is 
caused by the lack of namespaces, therefore I do not see the need for a 
solution. Just because a previous language you may have used had namespaces 
does not mean that PHP should have exactly the ame feature which works in 
exactly the same way. PHP is a diferent language. Learn the differences and 
live with them, otherwise go back to your previous language.

(3) Deployment Problems

So PHP allows the developer to change configuration settings? Big deal. If a 
developer screws up it is a developer problem, not a language problem.

The restriction of only one php.ini file per web server has workarounds 
which are clearly documented.
- You can use ini_set() within individual scripts to change standard 
settings.
- You can use .htaccess files within individual directories to change 
settings.

As for the fact that you cannot rely on a particular web hosting company to 
have the most current version of PHP with all the required set of extensions 
loaded, this has got absolutely nothing to do with the language. If your web 
hosting company cannot supply what you require then switch to a different 
company.

(4) Oversimplification Leading to Excessive Complexity

Every language evolves. Nothing is created perfect first time. The fact that 
PHP is now a collaborative effort of many talented programmers instead of 
just one or two cannot be held up as a disadvantage or a failing.

The fact that funtion names do not follow a consistent pattern is not a 
problem. I agree that some tidying up may be a good idea, but it does not 
stop me, or millions of other developers, from using the language to build 
web pages. Different languages have different naming conventions, but that 
does not prevent those languages from being used successfully.

The comments on arrays shows that you are fixated on how arrays are handled 
in another language. Well, I have news for you - PHP is not that other 
language. It is different. Get used to it. If you have a problem when using 
arrays in PHP then the failure is yours and not a failure in the language.

This constant comparison with other languages is a waste of time. I have 
used many languages in my long career, and I have had to get used to the 
differences. Some things are easier to achieve, some things are harder, but 
that is what you should expect from a different languages. There is a 
different set of commands, a different set of capabilities. If you don't 
like the differences then stick with your previous language, but for Pete's 
sake STOP COMPLAINING ABOUT THE DIFFERENCES. If these differences give you a 
problem then the problem lies with you, not the language.

Rant over.

-- 
Tony Marston

http://www.tonymarston.net

 

Page last modified on January 20, 2008, at 10:48 AM