Earlier quoted context omitted.
> I don’t understand why people are still using it It's a good comaparator, there are indeed a lot of similarities, but I never understood why anyone ever used Coffeescript whereas I do think I have a solid understanding of why people use YAML. It's more like Python than Coffeescript really: it's not just about simplicity & brevity, it's about terminators. Whitespace-dependent languages are often a pain to format / p…
>by being extremely strict about indentation, both in terms of the parser & also community convention. YAML hasn't This is why I created StrictYAML. A lot of the pain of changing YAML goes away if you strictly type it with a schema but you keep the readability. Counterintuitively that also includes most indentation errors - it's much easier to zero in on the problem if the error was "expecting status code or content…
Why are we templating YAML? (2019)
391–400 of 667 posts
Re: Why are we templating YAML? (2019)
#392To me YAML seems like the CoffeeScript of JSON, and unlike CoffeeScript I don’t understand why people are still using it. I guess XML and JSON are too verbose. But YAML is so far in the opposite direction, we get the same surprise conversions we’ve had in Excel ( https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr... ). Why is “on” a boolean literal (of course so are “true”, “false”, as well as “yes”, “no”,…
The problem goes deeper. I can't remember who coined the term, but all "implerative" (imperative declarative) languages share the same issue. I don't care if it's JSON, XML, TOML, or YAML, we shouldn't be interpreting markup/data languages. GitHub actions are a good example of everything wrong with implerative languages. Use a real programming language, you can always read in JSON/YAML/whatever as configuration. Goog…
If we take it one step further though and think about portability of configuration, I think that is one of the reasons we end up with operators.
Re: Why are we templating YAML? (2019)
#393Earlier quoted context omitted.
I code practically exclusively with vim. The replacement is buggy and has many corner cases that come up constantly. As in all editors. Tab indentation has no bugs or corner cases.
When looking at the code, tab-containing files are the most inconsistent ones, especially when viewed via general tools (less, diff, even web viewers). Sure, if people would only ever use tabs for indentation and spaces for alignment, things could be good. But this almost never happens, instead: ... some lines start with spaces, some with tabs. This looks fine in someone's IDE but the moment you use "diff" or "grep"…
People using tabs for alignment can happen when you've got a tab-camp-person who hasn't yet realized how they're terrible for alignment.
But "some lines start with spaces, some with tabs" happens for precisely two reasons:
* you have a codebase with contributors from both camps
* people thought in-editor tooling was the solution (now you have two problems)
> Spaces have no corner cases whatsoever
This is tooling and (as you realized) stop preference dependent.
Re: Why are we templating YAML? (2019)
#394Earlier quoted context omitted.
> And forbidding it makes a one-keystroke action a two or four one. The majority of editors can be configured to use tab to insert the appropriate number of spaces. Many will automatically detect the correct configuration.
The majority isn't all, and in my experience you always end up having to use one in some random situation that doesn't have that. tap tap tap tap Literally 100% of editors support tabs.
There are rich-text editors that increase the margin on Tab rather than inserting a tab.
Re: Why are we templating YAML? (2019)
#395I love Helm. Helm is magic. Helm makes my life tolerable.
But I’ve templates way too many yaml files.
If it were up to me XML would be default and we would use XSLT for templates.
I’m pretty sure you can use XSLT on JSON, which is logical identical to YAML. So something could be worked out.
Maybe that should be my next open source project.
Re: Why are we templating YAML? (2019)
#396Would things like..
A great LSP with semantic autocomplete, Native cross-file imports, and conditionals based on environment make things feel different/better?
What should modern declarative systems be doing in your opinion?
Re: Why are we templating YAML? (2019)
#397To me YAML seems like the CoffeeScript of JSON, and unlike CoffeeScript I don’t understand why people are still using it. I guess XML and JSON are too verbose. But YAML is so far in the opposite direction, we get the same surprise conversions we’ve had in Excel ( https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr... ). Why is “on” a boolean literal (of course so are “true”, “false”, as well as “yes”, “no”,…
Re: Why are we templating YAML? (2019)
#398To me YAML seems like the CoffeeScript of JSON, and unlike CoffeeScript I don’t understand why people are still using it. I guess XML and JSON are too verbose. But YAML is so far in the opposite direction, we get the same surprise conversions we’ve had in Excel ( https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr... ). Why is “on” a boolean literal (of course so are “true”, “false”, as well as “yes”, “no”,…
The only thing I disagree with is that Coffeescript is still useful. I had the same reaction to Coffeescript that I had with yaml, Coffeescript _never_ had any real point outside of a segment of people preferring to write javascript in Ruby syntax. The biggest issue Coffeescript had is that debugging meant reading through the javascript anyway so you never really got away from javascript.
I'm a fan of either using a full-blown programming language or ini files, and yes I realize that seems insane to many people but at the end of the day ini files are stupidly easy to edit and if you can get away with not needing a full-blown turing complete language then convention based ini files are vastly easier on the human than yaml or json.
I'm either a greybeard that never got with the times or I'm a rebel, probably depends on who you talk to.
Re: Why are we templating YAML? (2019)
#399Earlier quoted context omitted.
The majority isn't all, and in my experience you always end up having to use one in some random situation that doesn't have that. tap tap tap tap Literally 100% of editors support tabs.
The horror
Re: Why are we templating YAML? (2019)
#400To me YAML seems like the CoffeeScript of JSON, and unlike CoffeeScript I don’t understand why people are still using it. I guess XML and JSON are too verbose. But YAML is so far in the opposite direction, we get the same surprise conversions we’ve had in Excel ( https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr... ). Why is “on” a boolean literal (of course so are “true”, “false”, as well as “yes”, “no”,…
HJson https://hjson.github.io seems a nice 'in-between' between YAML and JSON without the indentation-based syntax, so closer to the JSON side but with comments and less quotes. What I don't really get is why the cloud providers / tooling implementors have never drafted up a "YAML-light" that just throws out the rarely-used headache-inducing syntax elements.
Two YAML-light style projects are StrictYAML (a Python library), and NestedText (an alternative spec with only string, list, and dict).