Re:YAML: Probably not so great after all
by whatshisface on Sunday August 18, 2019 @05:58PM
(#20733193)
Your editor makes a world of difference here. Since you shouldn't be writing brace-language code without indents anyways, the biggest issue remaining is mixing tabs and spaces. Gedit makes this a big pain with it's default config (it doesn't even auto-indent) but Atom and IDLE handle it well.
[ Parent
| on HN ]
Re:YAML: Probably not so great after all
by userbinator on Sunday August 18, 2019 @06:18PM
(#20733314)
Code you write yourself is not usually the source of problems with significant whitespace; it's situations like posting code on websites and discussing it where code in a whitespace-significant language becomes next-to-useless when leading whitespace is stripped, whereas code in any other language will still survive and then easily be autoformatted without changing its meaning.
Re:YAML: Probably not so great after all
by icebraining on Sunday August 18, 2019 @08:27PM
(#20733893)
If I were to use such a shitty website, I'd rather make a pastebin and link to it, instead of forcing every reader to reformat it themselves.
Can’t remember the last time this has actually happened to me. In what websites are people posting code without code block formatting support? Like, instant messengers?
Re:YAML: Probably not so great after all
by contradictioned on Monday August 19, 2019 @09:03AM
(#20737333)
Funfact, even Facebook, Whatsapp, and Telegram support preformatted text in triple backticks.
I’ve heard this argument in a lot of contexts, and it has always struck me as saying, “if hitting yourself with this bat hurts, try wrapping this towel around it and maybe it will hurt less.”
Re:YAML: Probably not so great after all
by kevin_thibedeau on Sunday August 18, 2019 @06:09PM
(#20733249)
Python 3 rejects mixed whitespace so the problem will be caught quickly.
Re:YAML: Probably not so great after all
by bobbylarrybobby on Monday August 19, 2019 @02:25AM
(#20735371)
If I pinky promise to indent my code anyway, then why does it matter whether I also have braces or not? In fact, braces allow me to press one button in my editor and get the indentation absolutely perfect, without affecting semantics.
Braces also allow for easily copying and pasting blocks of code because the braces delimit the semantics of the copied text. Because your code is already indented, with white space indentation you have to check that a) you pasted the first line at the right indentation level b) every subsequent line is also at the right level relative to the first line. No small feat.
Re:YAML: Probably not so great after all
by otabdeveloper4 on Monday August 19, 2019 @04:21AM
(#20735909)
> If I pinky promise to indent my code anyway, then why does it matter whether I also have braces or not?
Without braces copy-pasting becomes a context-sensitive headache. That's poor usability.