[TYPO3-core] RFC #12066: Code cleanup: Add some constants

Marcus Krause marcus#exp2010 at t3sec.info
Sun Feb 21 17:56:35 CET 2010


Hi!

Am 21.02.2010 17:08, schrieb Benjamin Mack:
> Hey Oli,
> 
> well, I don't see the real benefit in have a constant like
> 
> +    // a tabulator
> +define('TAB', chr(9));
> +    // a linefeed
> +define('LF', chr(10));
> +    // a carriage return
> +define('CR', chr(13));
> +    // a CR-LF combination
> +define('CRLF', CR . LF);
> +    // one hour in seconds
> +define('ONE_HOUR', 3600);
> +    // one day in seconds
> +define('ONE_DAY', 86400);
> +    // one week in seconds
> +define('ONE_WEEK', 604800);
> 
>  * it's not really shorter than before
>  * it's not namespaced, what if I include a third-party tool that does
> the same?
>  * it's limited: "ONE_MINUTE"? Also, everybody can easily do the "60*24*7"
> 
> Maybe I just don't get it. Could you help me out here?

I'd prefer keeping number of constants to a minimum, too.

I'm fine with the character stuff and consider this to be helpful.

Regarding time; I'm of the same opininion like Benjamin. Proper code
writes time durations like 60*24*7 and you'r getting the meaning of it
at a glance.

So, IMHO, yes to the character stuff, no to constants for time durations.


Marcus.


More information about the TYPO3-team-core mailing list