Re: [PBML] minimise the code lines
>>>>> "Shawn" == Shawn H Corey <shawnhcorey@...> writes:Shawn> As in all great philosophical debates, there is no right or wrong, just
Shawn> a matter of emphasis. Your approach is focused on what the program is
Shawn> doing, the action involved. Mine is on why the program is doing this,
Shawn> the functionality involved. Why? Because the functionality reflects the
Shawn> user's model, that is, what the user is thinking (or should be thinking)
Shawn> when using the program. By stressing the functionality, the code
Shawn> reflects the model. It is this that makes the program easier to
Shawn> maintain; the user's model is there, embedded in the code, for the
Shawn> maintainers to see and follow.
OK, and as a programmer, I'm thinking:
"These buttons all need to be at the default state.
Set all these buttons to default."
So I write the action "set a button to default"
and then I write the action to apply it to a list of buttons.
How could it be any clearer than that? How could any way of writing it
differently express a "why" any clearer?
But it seems that you will just continue to disagree, so let's just agree that
if I were to see that code in a code review, I would suggest rewriting it as I
have done, and you probably would argue the other way. You're right, there's
no "right" here. There's only "clearer to me" and "clearer to you".
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!