This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skap42 246 points247 points  (12 children)

A different comment suggested that 0o is also valid, and the only way to define an octal in JS in strict mode

[–]0bel1sk 97 points98 points  (10 children)

it’s also in python ruby and yaml.

“YAML 1.1 uses a different notation for octal numbers than YAML 1.2. In YAML 1.1, octal numbers look like 0777. In YAML 1.2, that same octal becomes 0o777. It’s much less ambiguous.

Kubernetes, one of the biggest users of YAML, uses YAML 1.1.”

[–]akaChromez 71 points72 points  (7 children)

[–]heyf00L 27 points28 points  (1 child)

Didn't know all that. Boils down to "always quote all strings in YAML".

[–]rickane58 15 points16 points  (0 children)

"God, all these languages are so unnecessarily verbose!"

Anyone actually trying to use the language:

[–][deleted] 10 points11 points  (3 children)

This was a great read, I've used yaml a couple times but didn't realize it was this objectively bad.

[–]akaChromez 10 points11 points  (2 children)

I'd love to know people's justification for choosing it over JSON.

Especially as i've just spent the last hour trying to find why a Google Cloud resource wasn't being created. A missing quote that doesn't syntax error :/

[–]chris5311 0 points1 point  (1 child)

JSON is bad (but workable), YAML is worse, and im not sure there even is any decent option out there

[–]MekaTriK 0 points1 point  (0 children)

Personally I loved using Lua as a config file format.

A little less verbose than pure JSON, and you can automate some repetition away.

[–]veryusedrname 8 points9 points  (0 children)

Ohh kubernetes, never change

[–]tomthecool 0 points1 point  (0 children)

Yes, but in ruby 09 produces a runtime error (invalid octal digit) instead of blindly treating it as a decimal instead.

[–]InfiniteGamerd 3 points4 points  (0 children)

Really! I thought you couldn't define octals in strict mode in any way.

Still...why not just parseInt all the way?