Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
May 11, 2007, 1:44 pm
rate this thread
I've stuck to PHP's procedural aspects (haven't fiddled with PHP
objects). I've found it to be a fairly simple language with a number
of problematic exceptions. Function naming is haphazard, for example
some functions begin with "is" and others with "is_" which is just the
kind of thing to drive one mad with frustration. Unsetting global
arrays is another problem area. There are more. Function names are
not case-specific but variable names are. That kind of thing, what
one would expect of something developed by a committee of people who
didn't get along well. Version upgrades tend to enforce restrictions
that were never enforced before and additionally need not be enforced.
Andy Dingley once described PHP as something or other related to
Satan's piss, I don't recall his exact words but sometimes they seem
You can pick up a reasonable facility in a week or two, it'll take the
better part of a year to encounter most of the ugly bits and learn
ways around them. But I've worked with worse languages and it's a job
and pays money (right? gawd, I hope so!), so your suffering is on
their time. <g>
contact via http://www.ren-prod-inc.com/hug_soft
It's a site I'm taking over and giving a complete re-work. The original has
all of its active coding done in PHP and the owner has an account with a
hosting company (which offers PHP but not ASP), all bought and paid for
already which he's reluctant to switch from for obvious reasons.
I see that as a perfect opportunity to learn a new skill.
On Fri, 11 May 2007 13:44:57 GMT, Fat Sam put finger to keyboard and
PHP is easy to learn, but can be challenging to master - it has a fair
number of gotchas that are just waiting to trip up the unwary.
However, the online documentation at www.php.net is generally very
good and will answer most of your questions.
Visit: http://www.OrangeHedgehog.com - Useful stuff for the web
"Yes, I know the truth, how 'bout you?"
The register_globals setting -- is it on or off? When it's on, strange
bugs can crop up in places you don't expect; though some older code relies
on it being on.
Similar story with the magic_quotes_gpc setting.
"ol'softy" mentioned inconsistencies in function naming, giving the
example that some function names include underscores to separate out
words, such as "is_array()" and "is_null()", but others do not, such as
"isset()" (i.e. "is set").
There is also inconsistency in parameter order in search-related
functions. For example, to search for string within a larger string, you
but to search for an item within an array, you use:
Function names aren't case-sensitive, but variable names are.
The syntax of the language is very poorly designed -- perhaps because it
was never really "designed" at all -- it just fell into place. The only
fairly nice thing that can be said about PHP's syntax is that PHP isn't
That said, just because I'm not a fan of PHP's syntax, doesn't mean that I
don't think it's overall a good language to use. PHP still has a lot of
features that I really like:
- It's an interpreted language;
- It's weakly typed;
- As of PHP 5, it's got very good OO facilities;
- It doesn't force you to *use* those OO facilities unless you
want to (unlike, say, Java);
- It does a lot of things for you, like parsing GET and POST
requests and putting the submitted data into variables; and
- It incorporates a lot of useful functionality straight into
the language itself rather than relying on libraries.
Toby A Inkster BSc (Hons) ARCS
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
On Mon, 14 May 2007 12:36:05 GMT, Eric42 put finger to keyboard and
As Toby has already said, the register_globals and magic_quotes_gpc
settings and inconsistent function naming and syntax are generally the
worst. It's very easy to get things horribly wrong if you assume one
ini setting when the reality is different, and the inconsistent naming
and syntax makes it hard to memorise all the commonly used functions -
I still have to refer to the documentation for functions that I don't
use every day, whereas I can do most things in Perl without having to
look anything up despite using the language much less often.
Also, while PHP5 does provide a very good object-oriented scripting
environment, the design of the language makes it easy to mix up
procedural and OO scripting with, again, potentially damaging results
if you don't know what you're doing.
Please give me one! http://www.pleasegivemeone.com
"I believe in the kingdom come, then all the colours will bleed into one"