<story><title>Why are we templating YAML?</title><url>https://leebriggs.co.uk/blog/2019/02/07/why-are-we-templating-yaml.html</url></story><parent_chain><item><author>ravenstine</author><text>&amp;gt;  Syntactic whitespace kills me.&lt;p&gt;Okay, I&amp;#x27;m gonna be the asshole in the room, but how hard is it to just use consistent indentation?  I can&amp;#x27;t count how many times I&amp;#x27;ve heard people complain about significant whitespace in languages.&lt;p&gt;Not only is it not difficult to begin with, but every code editor and IDE will show you where there&amp;#x27;s a syntax error in your YAML.  People are free to dislike YAML, even for its significant whitespace, but how does it &amp;quot;kill you&amp;quot;?&lt;p&gt;Look at this example from the article:&lt;p&gt;```&lt;p&gt;something: nothing&lt;p&gt;&lt;pre&gt;&lt;code&gt;  hello: goodbye
&lt;/code&gt;&lt;/pre&gt;
```&lt;p&gt;This is pure sloppiness, and anyone who has trouble carelessly adding pointless bytes to code, no matter the language, is sloppy.  I don&amp;#x27;t understand why people criticize YAML and Python because &amp;quot;whitespace is hard&amp;quot;.&lt;p&gt;P.S.: There&amp;#x27;s a similar configuration language called ArchieML, which is similar to YAML but doesn&amp;#x27;t have significant whitespace.&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;archieml.org&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;archieml.org&lt;/a&gt;</text></item><item><author>BossingAround</author><text>I know I&amp;#x27;m in a minority, but I really dislike YAML... I recently did a lot of Ansible and boy, at the beginning, I was just struggling a lot. Syntactic whitespace kills me.&lt;p&gt;I don&amp;#x27;t like it in Python either, but for some reason, when I write Python, it&amp;#x27;s a lot easier. Maybe YAML is just a bit more complex (and Python has better IDE support..?)</text></item></parent_chain><comment><author>pjc50</author><text>Three big things that annoy me even though I&amp;#x27;m happily writing Python:&lt;p&gt;- &amp;quot;cut and paste and edit&amp;quot; is broken. You can&amp;#x27;t autoformat the pasted code into the right place, you have to go back and fix the whitespace. Since whitespace is semantically significant, this can introduce bugs.&lt;p&gt;- visually identical whitespace may not be textually identical whitespace. Unless you go around breaking the tab key off your colleague&amp;#x27;s keyboards you&amp;#x27;ll trip over this. Especially (again) if you paste. Occasionally seen in merges too.&lt;p&gt;- editors can no longer give you 100% correct indentation.</text></comment>
<story><title>Why are we templating YAML?</title><url>https://leebriggs.co.uk/blog/2019/02/07/why-are-we-templating-yaml.html</url></story><parent_chain><item><author>ravenstine</author><text>&amp;gt;  Syntactic whitespace kills me.&lt;p&gt;Okay, I&amp;#x27;m gonna be the asshole in the room, but how hard is it to just use consistent indentation?  I can&amp;#x27;t count how many times I&amp;#x27;ve heard people complain about significant whitespace in languages.&lt;p&gt;Not only is it not difficult to begin with, but every code editor and IDE will show you where there&amp;#x27;s a syntax error in your YAML.  People are free to dislike YAML, even for its significant whitespace, but how does it &amp;quot;kill you&amp;quot;?&lt;p&gt;Look at this example from the article:&lt;p&gt;```&lt;p&gt;something: nothing&lt;p&gt;&lt;pre&gt;&lt;code&gt;  hello: goodbye
&lt;/code&gt;&lt;/pre&gt;
```&lt;p&gt;This is pure sloppiness, and anyone who has trouble carelessly adding pointless bytes to code, no matter the language, is sloppy.  I don&amp;#x27;t understand why people criticize YAML and Python because &amp;quot;whitespace is hard&amp;quot;.&lt;p&gt;P.S.: There&amp;#x27;s a similar configuration language called ArchieML, which is similar to YAML but doesn&amp;#x27;t have significant whitespace.&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;archieml.org&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;archieml.org&lt;/a&gt;</text></item><item><author>BossingAround</author><text>I know I&amp;#x27;m in a minority, but I really dislike YAML... I recently did a lot of Ansible and boy, at the beginning, I was just struggling a lot. Syntactic whitespace kills me.&lt;p&gt;I don&amp;#x27;t like it in Python either, but for some reason, when I write Python, it&amp;#x27;s a lot easier. Maybe YAML is just a bit more complex (and Python has better IDE support..?)</text></item></parent_chain><comment><author>fulafel</author><text>In the YAML case: It&amp;#x27;s hard if you don&amp;#x27;t have editor support and good diagnostics. Not because you&amp;#x27;re unusually sloppy, but because you make human mistakes and because you don&amp;#x27;t know the syntax. (YAML syntax is surprisingly complex and poorly documented in the pedagogic sense). Also, the edit-debug cycle is slow with Ansible or YAML-using CI systems, so this is doubly painful.&lt;p&gt;In the Python case it&amp;#x27;s much better, because people less often casually edit .py files without editor support, and because Python has good diagnostics and it&amp;#x27;s much much harder to produce syntactically correct but semantically wrong Python by whitespace mixups.</text></comment>