Thomas Koch wrote:
> Hi,
> 
> out of curiosity: There are several places in ezc where strings are used
> internally as kind of flags or enums:
> 
> - Column Types in ezcDatabaseSchema
> - MvcTools
> - ?
> 
> In contrast Sebastian used numeric constants in ezcWorkflow to indicate
> different activation states of nodes:
> 
>     const WAITING_FOR_ACTIVATION = 0;
>     const WAITING_FOR_EXECUTION = 1;
> 
> I thought, that using constants should be preferred, because
> - the compiler tells you, if you mistyped a constants name
> - comparing two integers is faster then comparing two strings(?)
> - You have a central place, where you can lookup all possible values
> 
> Or is there anything I missed?
> 

An additional incentive to use constants (left in the middle if their
value is a string or integer) is that they can be auto completed by an
IDE, thus decreasing again the chance of mistyping them.

Cheers

Kristof

-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to