Python array syntax in PHP

D

Dave Benjamin

There was a recent proposal on the PHP-DEV list to add a syntax similar to
Python's for arrays (in PHP, arrays serve as both lists and dictionaries,
though usually not at the same time. ;) Though several of the language
developers were marginally positive about the idea, I found it interesting
how much of a controversy ensued.

http://groups.google.com/groups?dq=...n%25242cut%25241%2540FreeBSD.csie.NCTU.edu.tw

I'm really starting to think that much of a given language's style is
arbitrary; the rationalizations come later, once the fear of change sets
in.
 
D

David M. Wilson

Dave Benjamin said:
There was a recent proposal on the PHP-DEV list to add a syntax similar to
Python's for arrays (in PHP, arrays serve as both lists and dictionaries,
though usually not at the same time. ;) Though several of the language
developers were marginally positive about the idea, I found it interesting
how much of a controversy ensued.

I find it interesting that the lead arguments against the syntax are
that of "there shouldn't be more than one way of doing things", and
"this is an unnecessary change", coming from a development team who
recently added iterators to their language after it had gone into
beta.

I promised myself that I would write an HTML hate-rant on PHP for my
web site. I'll get around to it someday. Roughly, the conclusion would
be:

a) Don't ever touch PHP.

b) Don't ever mention your PHP 'skills' or experience on your CV or to
your friends. Rest assured someone will find a steaming pile of crap
for you to work on.

c) If you are handed an existing PHP project to work on, rewrite in
another (say 'any other') language immediately. Don't port, you will
only carry the satanic anti-structure of the PHP application with you.

Rewrite all related documentation, schemas, and concepts. Don't spare
a single byte - you won't be free of the curse until all the children
are dead..

d) Time and cost are no exception to c). If this argument is proposed,
dispel it with: "how much time and cost will be involved in keeping
this application maintained, and running on future PHP releases?"
Shoot to kill if they don't accept this.

Follow these simple steps and you will find true peace. :)


David.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top