[development] need a standard for contrib node build_mode constants
Karoly Negyesi
karoly at negyesi.net
Mon May 18 20:27:04 UTC 2009
On Mon, May 18, 2009 at 12:13 PM, larry at garfieldtech.com
<larry at garfieldtech.com> wrote:
> Peter's suggestion may work for D6, but for D7, I refer people to Eaton's
> "How to make good APIs" session from DCDC. Digest version: If you expect
> people to extend your list of flags/constants/modes, for the love of god use
> strings, not ints. Ints WILL break. Don't be stupid, use strings.
Hummm.
Ints, strings, these are just ways to express bits of information.
Each character of a string will have approx 5 bit of info (or a bit
less, 26 english chars, underscore, thats 27 not 32 but lets say 32).
It also must be noted that its unlikely you will use all possible
combinations, I bet XRNQW will not be used for example...
I am with Peter, his proposal makes sense to me and can code more
possibilities than strings.
More information about the development
mailing list