I think that the point Zeev, Joey, I, and maybe one other person in the
world are trying to make is not that _() is the best way to call gettext,
our point is that being a nifty shortcut doesn't land its home in the heart
of our fabulous language. We have a billion modules in php now, everything
from cybercash to ircg (no offense to Sascha). What if EVERYONE who uses one
of these arbitrary modules is used to _() in their preferred language? Of
course you're going to say name one, but that would be you missing the
point. We're being hypothetical, because as computer scientists, we know
that the worst will always happen. We often ignore that fact, as in this
case here (similarly with y2k).

I think that I can summarize the viewpoints of my comrades as follows:

1. Yes, everyone who uses gettext expects _() to be there

2. Yes, its a good thing to make these people happy

3. Making them happy does not mean we need to risk confusion in our entire
language. It also doesn't mean we give gettext people special treatment over
some other module that may want _() for an equally good reason.

4. We (being people other than myself) came up with several naming
conventions by which PHP should behave. These apply to functions, not to
things like regexes and <?= as others have brought up.

5. It's not like removing _() from PHP blocks any future ability to use _()
in code. The myth that people will have to change thousands of lines of code
is patently false

6. Even C's gettext, the primo example of _ in action, DOES NOT BRING _ IN
BY DEFAULT. It requires the DEVELOPER to introduce the alias via a #DEFINE.
Even C, the mother of polluted, distasteful namespaces doesn't dare bring it
in, and in fact in GNU Gettext's documentation, it states that doing so
arbitrarily would not be good.

7. Plenty of alternatives have been suggested. Userspace functions were
suggested but not liked because of the potential for apocalyptic performance
losses that singlehandedly drives even the smallest i18n site into the
ground in a ball of fiery mass (end of sarcasm). Still, the option of
introducing runtime function aliases and/or compiler directives was brought
up. I personally prefer this solution, its not a bad idea for PHP to have
anyway, and gives users a ONE LINE solution, while giving the rest of PHP,
the overwhelming majority mind you, a more consistent language.

Clearly, no one loses in this scenario. The small chunk who use gettext make
a one line change. Performance is not affected. Conventions are satisfied.
Everyone goes home happy. What's the problem?

Regards,


Cristopher Daniluk
President & CEO
email: [EMAIL PROTECTED]
direct: 330/530-2373

Digital Services Network, Inc
Unleashing Your Potential
voice: 800/845-4822
web: http://www.dsnet.net/


-----Original Message-----
From: Wez Furlong [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 6:00 PM
To: Joey Smith
Cc: Wez Furlong; PHP Developer List
Subject: Re: [PHP-DEV] Woah


On 10/09/01, "Joey Smith" <[EMAIL PROTECTED]> wrote:
> I would love if every C developer in the world would stop using this. I
> doubt that's going to happen anytime soon...but at least I can voice my
> opinion here, what people at least hear me out, if they don't exactly
> *hear* me. :)

I hear you, but sadly I don't think this will ever be changed :-(

> It's a bad idea. Always. No matter what language you are using. No
> matter what kind of library you are talking about. Making things this
> complex into such an easy thing to overlook is a good way to hurt and
> frustrate your users, and your fellow coders. Is gettext() *REALLY* that
> hard to type? I find that really, really hard to believe.

It's not just the typing factor, it's the readability factor.
Yes, gettext tells you what it does but it gets in the way.
Do you use syntax highlighting in your code editor of choice?
I do, and I find that I take in a lot of the syntactic information almost
on a sublimininal level; my brain doesn't have to work as hard to understand
the grammar so I can spend more time understanding what the code does.
If I turn off the highlighting, or if it is not available (like running
vi over telnet) it is that much harder to work with the code.

To a certain extent shortening gettext() to _() is the same; think about
it for a moment (you don't have to like it! ;-) If I gave you a piece
of paper that had the word gettext tiled in the background with the code
printed over the top you'd find it hard work to read the code.

I know it's not exactly the same thing, but I'm just highlighting why
I prefer _() in this case.  The sheer quantity of gettext calls does
make it unwieldy to use the full function name.

--Wez.


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

BEGIN:VCARD
VERSION:2.1
N:Daniluk;Cristopher
FN:Cristopher Daniluk
ORG:Digital Services Network, Inc.;Executive Management
TITLE:President & CEO
NOTE;ENCODING=QUOTED-PRINTABLE:=0D=0A
TEL;WORK;VOICE:(330) 530-2373
TEL;WORK;VOICE:(800) 845-4822
TEL;CELL;VOICE:(330) 219-4819
TEL;WORK;FAX:(208) 723-6782
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;President;89 West Marshall Avenue=0D=0ASuite A;McDonald;Ohio;44437;United S=
tates of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:President=0D=0A89 West Marshall Avenue=0D=0ASuite A=0D=0AMcDonald, Ohio 4443=
7=0D=0AUnited States of America
URL;WORK:http://www.dsnet.net/~cris
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20010528T230445Z
END:VCARD

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to