Re: [PHP-DEV] Initializing constants once, with code?

2020-01-04 Thread Rowan Tommins
On 03/01/2020 18:55, Mike Schinkel wrote: So for five data elements, 5 easy to read lines of code with constants vs. 20 harder to read lines with functions, or at least 40 lines if we include PHPDoc for those functions, which is part of our standard for writing functions. This is, as so ofte

Re: [PHP-DEV] Initializing constants once, with code?

2020-01-04 Thread Mike Schinkel
> On Jan 3, 2020, at 2:52 PM, Larry Garfield wrote: > > There's two broad reasons I think this is a bad idea. > > 1) Constants are one thing. Function calls are another. They serve > different purposes. Trying to mutate them into one thing can only lead to > confusion and lack of understand

Re: [PHP-DEV] Initializing constants once, with code?

2020-01-04 Thread Mike Schinkel
> On Jan 4, 2020, at 10:49 AM, Rowan Tommins wrote: > > This is, as so often with such comparisons, an exaggeration: the docblock for > a function need not be any longer than the docblock for a constant, and the > function body can be simplified. Fair point. > Add in the "initialise on firs