News for hackers. Stuff that matters.
Re:That's a Lot of YAML by x3haloed on Thursday September 28, 2023 @02:01PM (#37693273)
I think I have a solution to keep the peace, if we can all universally respect one rule:

Never use YAML outside of the Python ecosystem.

That way, people who love esoteric scripting formats that prioritize legibility over correctness, durability, and maintainability can keep all their tab characters, loose typing, and cryptic syntax. And the rest of us never have to! Those of us who prefer C-style syntax can keep our sanity.

Re:That's a Lot of YAML by RockRobotRock on Thursday September 28, 2023 @02:07PM (#37693342)
It seems a little crazy that we have a TOML stdlib but not YAML. also TOML is ugly
Re:That's a Lot of YAML by x3haloed on Thursday September 28, 2023 @02:33PM (#37693722)
So what if it's ugly? Is this a serialization format or paintbrush?

Also, I think TOML stdlib gets to the heart of what I've been arguing. People who like syntactic whitespace like YAML. Everyone else (like C devs) don't. It makes quite a bit of sense to me that C devs don't want to touch YAML with a 10-ft pole.

Re:That's a Lot of YAML by bobbylarrybobby on Thursday September 28, 2023 @11:53PM (#37699101)
It's not just aesthetically ugly — including the entire path to every item is just a lot. It's the opposite of DRY.
Re:That's a Lot of YAML by bayindirh on Thursday September 28, 2023 @03:04PM (#37694126)
I think TOML is a great format. Almost self documenting, easy to understand, less foot Gün’s for the uninitiated and the best is it’s based on INI format, but it’s smarter.

If you think you need to serialize something more complex, use XML. It might look ugly, but it’s very powerful, can be verified on many levels and has a mature ecosystem.

“Cooler” doesn’t always mean better, especially for bigger data. Neither YAML, nor JSON scales to that sizes while being readable and easy to maintain.

Re:That's a Lot of YAML by deafpolygon on Friday September 29, 2023 @02:36AM (#37700048)
This. I've said it in one of the other threads re: YAML. TOML is great for simple user editable configs. Once you get into data exchange territory, use XML. Just the ability to define a schema and 'test' your XML document conforms is powerful and can tell you if something's wrong long before you end up with catastrophic failures.
Re:That's a Lot of YAML by marqueewinq on Thursday September 28, 2023 @03:45PM (#37694763)
Another purpose of code, as in software, is to be readable (aside from being executable). There's a million ways to do the formatting, and i would prefer people to use linter when they write code (hopefully, the same linter i'm using).

Those languages enforce a standard syntactic structure; there are less ways to write unreadable code, which is a good thing.

Re:That's a Lot of YAML by pkage on Thursday September 28, 2023 @07:01PM (#37697087)
Agreed, top comments smacks of gatekeeping. I work in both Python(ic) languages and in C/C++, both have their strengths and weaknesses. No need to start flame wars.
Re:That's a Lot of YAML by lolinder on Thursday September 28, 2023 @09:12PM (#37698133)
I prefer the middle ground taken by Go and others—have a standard formatter that is part of the language that everyone agrees to use, but don't make that syntactically relevant. That way you get readable code without individual coders ever having to manually fiddle with indentation levels, which is a source of endless problems when copy/pasting.
Re:That's a Lot of YAML by ryanisnan on Thursday September 28, 2023 @04:12PM (#37695160)
The Kubernetes community is looking at you with a curious look.
Re:That's a Lot of YAML by anotherevan on Thursday September 28, 2023 @07:27PM (#37697304)
Coming from a C background I had the same views as you regarding white space not being information or instruction. I'll admit I looked down my nose a bit at Python in it's early days because of it.

What changed my mind, of all things, was writing Coffeescript¹. I'm not a big fan of Javascript, and writing Coffeescript felt like a distillation of Crockford's The Good Parts book. You couldn't forget and generate the bad parts.

But additionally found the indenting as code felt quite pleasant. The only hassle is not being able to press % on an opening or closing curly brace in Vi to find the other end of the block. OTOH, with the indentation, if a piece of code looked wrong, it probably was.

Mind you, I still haven't learnt much Python.

¹ These days I use Typescript, but if they ever came out with a Coffeetypescript…

Re:That's a Lot of YAML by IlliOnato on Wednesday October 04, 2023 @11:22AM (#37766499)
Generally it's assumed that significant whitespace is a philosophical or even religious issue: some people love it, others hate it, and while both camps rationalize their preferences, it seems it's it: just a strong preference.

However, I came to think that the difference is not philosophical. It is just that some tools (text editors, e-mail programs, etc) support significant whitespace well, while other don't.

For example, the text editors I use are all set up to display space and tab characters, and to display them differently (usually as a faint dot and a faint mdash, or something). I am used to it, and this does not distract me at all.

From my point of view, code is not some random text. We use fixed-width fonts for it that we would not use in a book, we color-code it, I don't see why not make the white space visible.

I still have a "philosophical" preference for languages without significant whitespace, but I don't hate languages with it, they are not a problem for me at all.

But if the tools you use and love don't have good support for significant whitespace, or you won't make the whitespace visible, or even, you know, use vaiable-size fonts for coding... Well, then you will hate significant whitespace with a passion and consider it pure madness!

:-)