>
> Hi Puppet Developers!
>
> I have some real practical problems with the maintainability and
> readability of puppet code. Here are some thoughts about (backwards
> compatible) language syntax additions that IMO could greatly help to
> clean up puppet code.
For the record, changes that require deprecating existing syntax
doesn't really qualify as backward compatible. :)
>
> I have to say beforehand that I'm not able to implement my own
> propositions (ouhh). But maybe some puppet architect finds my ideas
> interesting anyway more as a kind of teaser...
>
> http://projects.reductivelabs.com/issues/show/1645
>
> Here some superficial discussion I had on #puppet to validate the
> idea:
>
> [00:11] fujin: jerico: considering that your changes would break
> backwards compatibility, and require a large number of users' manifest
> rewrites.. it'd probably only ever be changed with a toggle option
> [00:11] fujin: jerico: what problems do your changes fix? ;}
> ...
> [00:23] jerico: fujin: Why would it break backwards compatibility? I
> consider backwards compatibility in my feature request.
> [00:24] jerico: fujin: The benefits are that you could avoid global
> variables (which you cannot currently if you use classes with
> templates in them).
> [00:25] jerico: fujin: I think it is out of question that global
> variables are a very bad idea. They are against the most basic design
> principles.
Puppet will always have something resembling global attributes -- at
the least, client facts are global.
The key here is that these global variables aren't writable, which
completely changes whether they're such a bad idea. They're much more
like global constants than global variables.
>
> [00:25] jerico: fujin: You could use definitions instead. But they are
> not meant for singleton use and they do not let you define instance
> variables as classes do.
> [00:26] jerico: fujin: I also think that a merged type would be more
> intuitive for newcomers. (Specially the host of us who have an OO
> background).
I.e., more useful to programmers, but not necessarily so much for
sysadmins.
It's true that you're not the first person to make this request or to
find the distinction either confusing or arbitrary, but don't discount
the fact that Puppet isn't written by and for developers, it's for
sysadmins, surprisingly few of whom have much OO experience.
>
> [00:27] jerico: fujin: These are quite some benefits, don't you think
> so? And as I think that you can have all this with full backwards
> compat... I thought it would be a good idea.
> ...
> [00:34] fujin: global variables are one of the very basic design
> prinipals relied upon by many external node tools
> [00:34] fujin: you're kinda throwing some heavy OO ideas into a
> declarative, imperative manifest syntax
> ...
> [00:35] jamesturnbull: jerico: I'm thinking about it - not sure I am
> sold
> [00:35] jamesturnbull: jerico: but lak is probably the best one to
> discuss it with -- and on the -dev list
> [00:36] fujin: mm, global variables may be frowned upon in your OO
> language of choice, but here they are very useful for abstraction
> [00:36] fujin: It's top-scope, always inherited imperation
> [00:36] fujin: (imperation a word?)
>
> These were the basic arguments I think. The rest was a little
> repetitive.
--
A government that robs Peter to pay Paul can always depend on the
support of Paul. -- George Bernard Shaw
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
> So taking that fact into account means one should refrain from using
> puppet for more complex administration work?
I certainly hope not. There will always be problems that any given
tool can't handle well, and there are certainly classes of problems
that Puppet can't do well with right now, but it's my hope to always
strive to reduce that list of unaddressable problems.
>
> Isn't there a possibility to somehow please both sides?
>
> I'm having the same problem as I'm establishing a groupware setup with
> puppet and I have no reasonable solution for keeping track of all the
> variables so far.
Can you please explain in more detail what your issue is?
One of the frustrations I have as Puppet's maintainer is that too many
people are willing to accept it as it is, rather than laying out their
frustrations and ideas of improvements. I'm thick-skinned, and I'd
bet I'm a harsher critic on Puppet than *nearly* all of you. If there
are problems you can't solve well with Puppet, please start a thread
about the problem on puppet-dev.
The only way Puppet can continue to grow to solve harder problems is
if we know what problems it can't do well right now.
--
The people who are regarded as moral luminaries are those who forego
ordinary pleasures themselves and find compensation in interfering
with the pleasures of others. -- Bertrand Russell