On May 14, 2012, at 9:06 AM, Robert Rothenberg wrote:


Well, while we're ranting about stupid language design desisions...

I would like to dish out a special platter of hate for Puppet.

I know this is a hate mailing list, not a "defend your baby" list, but this 
particular hate is kinda my fault, so I can't help but speak up...

Well, not a programming language per se.

But Puppet is special in that it's intended to be a *descriptive* language.
So you describe how your servers are to be configured.

Sounds nice, except... it has side effects. Which makes the whole
descriptive vs imperative thing to be worthless.

Hmm.  I don't see side effects anywhere, just stupid language stuff.

One example of my hatred for Puppet:

1. Execution order is non-deterministic. Well, not a problem, but…

Well, technically, the execution order of unrelated resources was, until 
recently, as random and inconsistent as the hashing algorithm in ruby.  It is 
now random (again, only for unrelated resources) but consistent across runs.

2. Evaluation order of parameters is also non-deterministic. Well,
  not as well documented, but is a bit more problematic because…

Hmm.  I was going to say that's not true, but that actually is true for the 
parameters in your example. (One of the stupidest parts of Puppet is the 
inconsistencies between types defined in the language, like below, and those 
defined in Ruby.)

3. Undefined values are *silently* interpolated as empty strings!

I chose this because the shell does the same thing, and I figured sysadmins 
(our target user) would find it most convenient.  I think this is being 
reconsidered, but I'm not sure it doesn't actually make the most sense.  It's 
not up to me any more, though. :)

So, let's say you create a Puppet "class" (not really classes in the OO or
mathematical sense, but that's a separate rant...):

 class foo(
   $owner  = "foo",
   $prefix = "/opt/foo",
   $config = "/etc/${prefix}",
 ) {

   file { $config:
     ensure => directory,
     owner  => $owner,
     mode   => 0600,
   }

   ...

 }

You'd expect this class to create a directory /etc/opt/foo (for storing
configuration files for your custom "foo" application).

But sometimes, Puppet might randomly set the value of config before it sets
the value of prefix.  So you'll mess up the permissions of the /etc
directory. With no warning (unless of course, you read the logs closely to
see what it did....  but the only errors you will see are when everything
else starts to fail).

Hrm.  I'd never heard of this specific issue before, but yeah, that's annoying. 
 (FTR, I'm kinda out of day to day of Puppet, I just run the company now, but 
I'm happy to try to chase this crap down with people when poked.)

--
Luke Kanies | http://about.me/lak | http://puppetlabs.com/ | +1-615-594-8199


Reply via email to