[ale] Ubuntu 18.04 release notes

Steve Litt slitt at troubleshooters.com
Sat Apr 28 02:59:57 EDT 2018


On Fri, 27 Apr 2018 10:00:46 -0700
Alex Carver via Ale <ale at ale.org> wrote:

> On 2018-04-27 09:43, Kyle Brieden via Ale wrote:
> > https://twitter.com/sadoperator/status/989895215442837504
> > 
> > But seriously, though, I appreciate YAML for what it is, and that
> > is "a human readable markup language".  It's easy to look over it
> > and suss out what is what, much like JSON.  I prefer JSON to YAML,
> > but they're both widely used and well implemented most of the
> > time.  
> 
> JSON is reasonably human readable and certainly does not depend on
> indentation to read it.
> 
> I can read and write this:
> 
> {
> "array1": {"A", "B", "C", "D"},
> "struct1": {"param1": val, "param2": val},
> "struct2": {"param3": val, "param4": val}
> "list":
>     {
> 	{"list_item_id": id, "list_item_name": "foo",
> "list_item_param": param }, {"list_item_id": id, "list_item_name":
> "foo", "list_item_param": param }, {"list_item_id": id,
> "list_item_name": "foo", "list_item_param": param } }
> }
> 
> far easier and with less likelihood of errors 

OK, but how about this:

{"array1":{"A","B","C","D"},"struct1":{"param1":val,"param2":val},
"struct2":{"param3":val,"param4":val}"list":{{"list_item_id":id,
"list_item_name":"foo","list_item_param":param},{"list_item_id":id,
"list_item_name":"foo","list_item_param":param},
{"list_item_id":id,"list_item_name":"foo","list_item_param":param}}}

Every format/language I know of that's not indentation aware has end
tags, which are ultimately readable by machines, but not so much by
humans. Which is why humans usually lay out their
indentation-independent code with strict indentation rules. There's a
name for getting rid of the spacing in C: *Obfuscated* C. You ever try
working on a large web page where they got rid of newlines to save a
few bytes? Whatamess!

Ever seen C code worked on by 4 different coders?

int square(i){
   return(i*i)
}

int cube(i)
   {
   return(i*i*i)
   }

int quad(i)
{
   return(i*i*i*i)
}

int quint(i)
   {
   return(i*i*i*i)
}


int
   sept(i)
      {
   return(i*i*i*i*i*i)
}

The preceding are only the tip of the iceberg. There are
plenty more indentation standards. Programmers go to war over this
stuff.

And what happens when a maintenance programmer misunderstands some
careless indentation, and adapts his end tags to that bogus
understanding?

The fact is, most humans need indentation context to quickly understand
a program or format. Since the indentation context is necessary, why
not make it part of the format, so we're all on the same page, and,
hooray, get rid of the end tags?

Don't get me wrong, indentation dependency doesn't work for everything.
HTML and XML without end tags would be a horror movie. But where it
works, I think indentation dependency is often an improvement.

This is just one of the reasons I like Python so much.

SteveT

Steve Litt 
April 2018 featured book: Troubleshooting Techniques
     of the Successful Technologist
http://www.troubleshooters.com/techniques


More information about the Ale mailing list