Re: Woah

From: Date: Tue, 11 Sep 2001 01:33:17 +0000
Subject: Re: Woah
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65732@lists.php.net to get a copy of this message
On Mon, 10 Sep 2001, Joey Smith wrote: > The point that *I* have been trying to get at is that this has *ALWAYS* > been a bad idea, no matter what langague you are using. > You all talk an awful lot about how _ decreases the "contextual > overhead". What I'm trying to express is that THIS IS BAD! gettext() is > deep magic. When you are doing deep magic, every single thing you can do > to make people MORE aware of what that magic relates to is a GOOD THING. > 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. :) > 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. > Sorry, I know I'm descending once again, but I have lost quite a bit of > time trying to figure out what _ was (in C, not in PHP). I want to save > others that pain and frustration if at all possible. It's a bad idea *to implement it in the language*, yes. It's a bad idea to implement this in the language for precisely the reasons that have been detailed here: it would be difficult to track down in the documentation (or header files), and it would clutter the language's namespace inappropriately. It's also against PHP's naming standards. But it's arrogant in the extreme to claim that it's always a bad idea for *anyone* to use such a convenience name. The practices of individual C programmers working on projects not related to PHP, or of programmers writing internationalized web apps, should not be at issue here, and I'm opposed to any measure which attempts to restrict the programmer's freedom in this regard. This includes the notion of removing _() without offering a suitable replacement mechanism that has comparable overhead both in the writing of the code and the running of it. Like it or not, the low overhead this gettext convention imposes on authors of C programs *has* contributed to its widespread adoption. I think a lesser solution in PHP is a disservice to the international community, and a terrible thing to do in the name of language purity. So I'm all for removing _() from the gettext extension... but I think the people who are so eager for this have a responsibility to make sure PHP has a good option for user-aliasing of functions in place before it goes away. Steve Langasek postmodern programmer

« previous php.dev (#65732) next »