[PEPr] Comment on Internationalization::I18N_UnicodeNormalizer
| From: | Michel Corne | Date: | Fri, 15 Jun 2007 17:26:29 +0000 |
| Subject: | [PEPr] Comment on Internationalization::I18N_UnicodeNormalizer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47050@lists.php.net to get a copy of this message | ||
Michel Corne (http://pear.php.net/user/mcorne) has commented on the proposal for
Internationalization::I18N_UnicodeNormalizer.
Comment:
Thanks for your comments. Please read my own comments below.
I would be interested to have some feedback from other folks, especially
those who have an interest in internationalization stuff. Also, feedback
from QA folks would be very much appreciated to let me know if the testing
suite and the API doc is in line with PEAR's standards.
MC
[pear-dev] "...Have you looked at the following ..
http://pecl.php.net/package/translit .."
[MC] Actually transliteration is very different from normalization so I
doubt that there is much that I could leverage. I have not checked that
package yet. There are 2 only methods that I wrote that are somewhat
similar to other packages.
[pear-dev] "... not sure I like the __construct($root='') part where you
prepend a root directory to constant (a path) which is defined inside the
class and not adjustable..."
[MC] The $root is not meant to be used in production. This is just a way
to trick the class to include a set of files similar to the production ones
but customized for some of the testing. I will make this clearer in the API
doc.
[pear-dev] "... some of your code is hard to read (lines are pretty
long)..."
[MC] The lines are long because there is the code itself and a comment
right after. I comment each line because it is easier for me to maintain
the code when I go back to it weeks/months after. Also, we have large
screens these days and editors with smart highlighting which I believe
makes the whole things pretty readable. We also all have different styles
to program I guess :-)
[pear-dev] "... some of the if()'s seem a bit complicated - for example,
exit early, instead of long code inside the condition and exit in the else
part..."
[MC] Good point regarding exiting early. I used to do as you say for
years. Then I changed things more recently. I may have to change that
back... The normalization rules are not easy to understand nor to implement
which may reflect in the code. This requires many conditions tests and
recursive programing. I am open to simplifying what I wrote, please be more
specific so I can take a look at it again.
[pear-dev] "...I'd (personally) always use empty() to test instead of, if
($foo != '')..."
[MC] Yeah, yeah... I use empty() too... depends on the day :-) Note that
it is not strictly the same thing.
[pear-dev] "...you should list the multibyte extension as a
dependency..."
[MC] I did not know that we had to list extensions as dependencies. No
problem. Where should I list that?
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=494
--
Sent by PEPr, the automatic proposal system at http://pear.php.net