Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

YAML公式「YAMLでTABを使う者は腹を切って爆発四散するべきである(意訳」

YAML形式でのTABの取り扱い

公式によると

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.

とのことです。
大雑把に訳すと、「OS依存性の強いTABは腹を切って爆発四散すべきである」というわけです。

<おまけ>何故かPythonに喧嘩を売るYAML公式

先ほどの文には続きがあり...

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.

(意訳)Python設計者のRossum=サンはTABが皆の頭痛の種である事をご存知なので、きっと再デザインの時は禁止してくれるでしょう!(暗黒微笑

仕様書の方でも

YAML’s indentation-based scoping is similar to Python’s (without the ambiguities caused by tabs).

(意訳)YAMLPythonみたいなインデント主体の設計だよ(ただしTAB由来の曖昧なトコ除く)

と、タブで入れ子構造を作るPython様に喧嘩を売りまくっています。

<おまけ2>ファイル名は".yaml"にしてくれよ、頼むぜ、兄弟?

公式ではまた、

Is there an official extension for YAML files?

Please use ".yaml" when possible.

としており、ファイル名はyamlとする事を推奨しています。
僕は今日の今日まで.ymlと書いていました(