On Mon, Jan 26, 2009 at 01:06:01PM +0100, Christian Schneider wrote:
> Things gettings reserved at a later stage (like originally keywords, now
> namespaces) can lead to a big deal of frustration. Therefore I think it
> is crucial to have a clear naming guide now.

+1

> And these guidelines have to be noticed by everybody who starts to use
> namespaces so they have to be placed prominently.

> Personally I'd even prefer them to be enforced in code so they can't be
> missed.

No:
* there are occasional times when rules might want to be broken
* to enforce it just makes the language/compiler bigger
* If it is advertised and someone breaks the rules - then it is their problem.

> Removing restrictions later on causes less trouble so I wouldn't mind
> too much if a couple of namespaces (or namespace prefixes) are reserved
> but never used.

As I suggested, do it the way that perl does: it is keyed off the case of the 
characters.
So, the reserved spaces could be one of:

1) entirely lower case (or perhaps just start with lower case)
2) entirely upper case
3) start with an underscore ('_')

Perl does (1).
It might be better to do (2) because system variables tend to be in upper case
anyway (think: $_GET). (3) also has the virtue that system things tend to start
with an underscore.

This scheme is nice and simple.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to