[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vmdebootstrap plans

On Sun, Nov 13, 2016 at 08:58:02PM +0100, Thomas Lange wrote:
> I'm really wondering why you want to use YAML for this? Your examples
> look like things you could easily implement in shell, if you provide
> some functions, subroutines or external programs that implement your
> steps.

I don't think using the shell language to implement a DSL is
acceptable, however easy it may seem. Shell is a really, really bad
programming language and I don't want to encourage its use.

In addition, I will _not_ use shell to implement anything that
requires robustness or code clarity, for it is a lousy language for
anything beyond very simple scripts. Life is too short to write,
maintain, or debug, complicated software written in shell.

I'm too old for this sh.

> create_raw_file $size $image

I realize that you only wrote the above as part of an example, but
to me it's an example of why shell won't do. You didn't quote the
variable expansions, which may result in quite nasty bugs. Reading the
code I would need to evaluate if it's safe to not quote, or if it is
in fact correct to not quote, or if there's a possible bug there. The
rules for quoting in shell are too intricate, and it's too easy to
accidentally do the wrong thing.

> Much easier and more common for sysadmins IMO.

Having written this kind of software before, I guarantee it's not
easier in the long term. Or the medium term. It's only easier for
getting to a quick prototype. Beyond that, one runs into language

If editing a YAML file is too difficult for a sysadmin, then I don't
really care. I don't think it will be. YAML files are easy and a very
large number of sysadmins use them with, say, Ansible.

I want to build worthwhile things that might last. --joeyh

Attachment: signature.asc
Description: PGP signature

Reply to: