Highly annoying for configuration files.
Highly annoying for configuration files.
Are you serious? Would you put tabs in source code too?
> and most yaml parses if they see a tab don't warn you or anything
If they warned you, you still can't use tabs it's just that you're more aware that you can't use them.
It's not entirely clear to me what your point is. Perhaps it's that tabs is your preference. Unfortunately, spaces are the preferred whitespace marker for 99% of programmers.
Also, pulled directly from the YAML FAQ [1]:
Why does YAML forbid tabs?
Tabs have been outlawed since they are treated differently by different editors and tools.
And since indentation is so critical to proper interpretation of YAML, this issue is just too
tricky to even attempt. Indeed Guido van Rossum of Python has acknowledged that allowing TABs
in Python source is a headache for many people and that were he to design Python again, he
would forbid them.
[1]: http://www.yaml.org/faq.htmlOf course. Why the fuck wouldn't I put tabs in source code?
We INDENT the code pressing tab. We don't press 4 spaces. Why shouldn't the code reflect that? And tabs are symbolic (logical entities), so they are customizable.
You suggest we'd rather use the elaborate kludges to handle spaces as tabs in the editor? What year is this? 1978?
Most editors have a "tab button prints spaces" option that isn't too difficult to find. (Plenty of them have a format code option as well, so it isn't such a big deal, but overall I find it easier just to switch everything to spaces.)
I never had that experience, and I've used Vim, Eclipse, ST3, TextMate and BBEdit. How does that ever happen?
A tab is a tab, no matter the editor. One might be set to show it as 8 chars wide or 4 chars wide etc (since it's a logical unit), but no indentation gets "messed up".
If by identation you mean: "variables arranged to start at the same point because the programmer has OCD", maybe. But no declarations or indentation that matters, like braces etc ever changes.
>Most editors have a "tab button prints spaces" option
Yes. The back-to-the-seventies elaborate kludge I've already mentioned. It's 2014.
In that case you would have to set your editor to display 8 spaces per tab, or 4 or whatever the code editor where the code was written was using. I don't see that being any less of a kludge than changing it to do spaces when a tab is pressed.
I have given you a reason why I prefer spaces over tabs. Your reasoning seems to be "because I can". Then start harping back to the 70's despite that part of your comment being irrelevant.
Is there an actual reason you prefer tabs over spaces, given that you can't visually tell the difference most of the time?
99% of which programmers?
The Linux Kernel uses tabs for indenting
But I am glad that YAML made any choice at all. Allowing mixing is absolutely the worst possible option.
[1] Think in particular of when code moves around. Sometimes it moves to a place where the indent level is different but the total number of expanded spaces is the same. This looks fine until you look in another editor.
This is exactly why Smart Tabs is the only intelligent way to do it - if you change the width of a tab, everything resizes instantly to match the current user's aesthetics, but things that need to be aligned stay aligned. The only case in which it breaks is if you switch to a non-monospaced font, and in that case, God help you.
No thanks, YAML is a terrible choice for configuration files.
Look at the database.yml files that come with Rails applications, or look at the +MANIFEST file that pkgng requires on FreeBSD.
Those are yaml files, no triple dashes.
Calling me incompetent isn't helping your case either.
Spaces just get out of my way.
P.S. I'm undoubtly biased by Python. The community's agreement on spaces and specifically 4 spaces has been a pure blessing.
They stick the damn tab in, then the program that is parsing said YAML file does the wrong thing and I am confused, annoyed, and most times really pissed off because I will spend hours trying to figure out what went wrong.
YAML is stupid for configuration files.
I for one am looking forward to the time when neural implants will translate my high level programming thoughts into microcode sent directly to the CPU for execution.