On Sat, Nov 17, 2012 at 3:13 PM, Sebastian Krebs <krebs....@gmail.com> wrote:
> 2012/11/17 Andrew Ballard <aball...@gmail.com>
>
>> On Nov 16, 2012 10:24 PM, "tamouse mailing lists" <tamouse.li...@gmail.com>
>> wrote:
>> > Just a tad obscure for someone coming along
>> > later
>>
>> Without knowing the intent of the code, it could be a headache to maintain.
>>
> Interesting, that you see 5 lines of code and assume, that nobody will ever
> get the intent of this code ;) Of course the context is missing. I guess,
> that "$count" is something like "remaining days", or such, because "7" and
> "14" look like "one week" and "two weeks", respectively. Thus I wouldn't
> name the variable "$count" [1], but "$remainingDays" and voila: Context is
> back and so is the intent :)

This was actually the thrust of my remark about obscurity. I could
easily see how the refactored algorithm worked from the original
code's algorithm. What was obscure was exactly the variable name
$count, i.e., the meaning of the data driving the algorithm. When you
know the actual meaning of data being used, the obscurity goes away.
Hence: useful variable names.

Again, well done, Seb.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to