[dev] Re: [cvs] commit: imp compose.php imp/lib Folder.php

Jan Schneider jan@horde.org
Tue, 21 May 2002 17:38:43 +0200


Zitat von Chuck Hagenbuch <chuck@horde.org>:

> Quoting Jan Schneider <jan@horde.org>:
> 
> > No, we decided to only use encoded folder names internally and decode
> > them only if we present them in the ui. This commit fixed some places 
> > where we didn't follow this rule.
> >
> > It might be possible that it breaks things in another place but it has
> > to be fixed there. Though I didn't find any place where it broke 
> > something.
> 
> IMP_Folder is a class for dealing with folder names. It is the proper
> place
> to encode _new_ folder names - you removed the encoding in
> IMP_Folder::create(), which would mean that users of the library - the
> rest
> of IMP, and anything else - would be responsible for encoding the
> folders.
> That's not the right way to do it.

Don't you find it inconsistent and unintuitive for users of these class if 
some methods take the folder argument encoded and some decoded. This is 
definitely a source of confusion that would leed to more discussions like 
this in the future.

I don't mind if we decide that all methods should take decoded folder names 
but at least they should all behave the same. Anything else is absolutely 
error prone and I still see no reason why we should sometimes pass encoded 
names around and sometime decoded. Uft-encoded strings are the language of 
the imap servers and we speak imap so why not use them. The end users don't 
speak imap nor utf so they'll get the decoded names.

It think it will be pretty clear for future development if we decide that 
all methods of the Folder class take the same kind of arguments. I didn't 
look at it but I hope that there are not some method that take the folder 
name with prefixes and some without. That should be fixed then too, but at 
least that's not what I'd expect from the api.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft