On Tuesday, April 1, 2014 8:25:21 AM UTC-5, Felix Frank wrote:
>
> On 04/01/2014 01:44 AM, Trevor Vaughan wrote: 
> > I have to say that I like 'hold' better than 'held' based on the way I 
> > would actually read this. 
>
> Right, and I don't agree about John's point about property names. There 
> are counter-examples that work very well like service/enable, 
> file/purge, file/recurse etc. The inconsistency with yumrepo/enabled is 
> unfortunate. 
>


Puppet resources and resource properties describe aspects of the target 
system's configuration.  Virtually all such aspects are things or 
attributes of things -- nouns or adjectives -- and it best models the 
target to use labels that are consistent with that nature.  That there are 
historic examples that do not comply with that principle is unfortunate, 
but not a good reason to reject the principle for future development.

Moreover, of the three examples presented, two -- file/purge and 
file/recurse -- are only parameters, not properties.  The same principle 
does not necessarily apply to parameters, because those may in some cases 
describe something the puppet agent is supposed to do (a verb), or how it 
is supposed to do it (an adverb).

 

>
> When I read those, I think 'imperative', which really is what the 
> manifest represents. Ensure this! Hold that! :-) 
>
>

But that's just the thing: to whom is such an imperative directed?  If it 
is directed to the Puppet agent then a verb is fine, but in that case the 
parameter you are dealing with is likely not a property.  ('Ensure' is a 
special case that we can discuss further if desired, but for the moment 
just observe that it is indeed an instruction to Puppet, hence a verb is 
reasonable.)  On the other hand, consider held/hold: puppet does not have 
the ability to hold packages, so it is sloppy to name a resource property 
as if it did.  What it really does for the held/hold property is configure 
the package management system to hold the package.  The *state* of such a 
package is "held", not "hold".

That distinction is colorable, of course.  For instance, one could say that 
"hold" is an instruction to Puppet, telling it to put the package in the 
"held" state (kinda roundabout, but whatever).  Consider, however: is that 
really what you would be telling the agent?  In fact not.  What you would 
be telling it is to check whether the package is already in the "held" 
state, and if not then to put it in that state.  That's not very well 
summed up by 'hold', but perhaps the property could be named 
"if_not_held_hold".  Or not.

Appropriate naming is important because the names we use influence our 
thinking about the named things.  We should choose names that promote clear 
thinking.  So in the end, yes, it's about how the declaration reads.  The 
"hold" alternative does not necessarily read badly -- that's subjective 
value judgement -- but it does read *wrongly*.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/edf99d3f-e332-4199-93e3-eb6d5db63acd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to