[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Spacewalk-devel] "1", "y", "true", "yes", "on" etc

On 09/05/2011 04:08 PM, Bo Maryniuk wrote:
> Guys,
> should we support all of the list of "valid true's" for the config,
> listed in /spacewalk/java/code/src/com/redhat/rhn/common/conf/Config.java,
> or "1" is just enough for the next century?
>     /**
>      * List of values that are considered true, ignoring case.
>      */
>     private static final String[] TRUE_VALUES = {"1", "y", "true",
> "yes", "on"};
> This is a bit not synchronized, since *only* Java stack allows such
> odd choices, while the rest of the Spacewalk seems like "understands"
> only "1" or "0" (Python part, at least).
> I would suggest to put it to the common schema, because this is
> very confusing.
> So either:
> 1. Teach the rest of the Spacewalk to understand all of the above,
> where seems like Esperanto and Swahili are still missing :-)
> 2. Reduce it to just "1" or "0".
> What you think? I would go #2 personally...

Well it is always good to understand more languages. And I know from my
experience that people do not always know whether they should use
true/yes/1 as different projects use different constants.

So when I have time I try to write code which understood all possible
constants. When I'm lazy I just choose one.

Since our configuration files are well documented (hmm not documented,
but has all option and its default values) I will not object agains #2,
but I think #1 is better.

Miroslav Suchy
Red Hat Satellite Engineering

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]