Forum: CFEngine Help
Subject: Re: CFEngine Help: Thoughts about some cfengine design decisions?
Author: lauwersw
Link to topic: https://cfengine.com/forum/read.php?3,24294,24325#msg-24325
Mark Burgess Wrote:
-------------------------------------------------------
> In CFEngine 3 syntax we have managed to reduce
> 10,000 lines of code down
> to 1000 due to the absorption of irrelevancy using
> the body templates.
> The interesting part of the code is not what all
> of these attributes
> actually are, but what is the *intention*. Now we
> can write
>
> "$(ftp)/usr/lib"
> perms => simple1,
> depth_search => simple2,
> copy_from => x("/usr/lib");
>
> And you can sprinkle parameters where you want for
> *clarity of
> communication*, not for programming necessity.
..
> This does not mean that the discussion is over, as
> there are plenty of
> things we can do to make CFEngine 3 even simpler
> to understand. I hope
> to come back with something on this in the new
> year.
I agree that while inlining parameters looks tempting, it will probably create
much harder to maintain code. On the other hand now we risk ending up with tens
of bodies, all looking very similar but being different in small details. It
isn't really a blocker for me to learn the cfengine3 language and usually I can
limit the number of different bodies. So I've got a bit mixed feelings about
this.
Still somewhere (but I don't find it back) I've read a suggestion that a kind
of inheritance of bodies would be nice, and I like that idea. For example you
could have the basic copy_from bodies, but if you want them to use digest =>
"true", you have to copy all of them and just add that parameter. I liked that
suggestion, though it might be hard to implement in a clear way.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine