5 ms·
Programmers love to complain about Excel, but we happily use YAML, which has essentially the same footgun: certain strings (like 'on') need quoting if you don't
by takluyver 6y ago
Programmers love to complain about Excel, but we happily use YAML, which has essentially the same footgun: certain strings (like 'on') need quoting if you don't want it to interpret them as something else.
- fabian2k 6y agoWe programmers also complain a lot about YAML, though maybe not enough and not as much as about Excel. But some YAML footguns like the country code for Norway being interpreted as a boolean are reasonably famous, and I think widely regarded as a bad idea.
- takluyver 6y agoTo be fair, there are few things programmers don't complain about. But YAML still seems to be very popular as a configuration format for new tools, e.g. CI services.
- 3pt14159 6y agoI wish everyone would just switch to TOML. It's sane and readable.
- t-writescode 6y agoOr json!!! Why did we leave json???
- RcouF1uZ4gsC 6y agoNo comments in standard json.
- 3pt14159 6y agoAnd you have to choose between readability and whitespace. Doesn't matter for most usecases, but you can't blindly write it out. You have to choose ahead of time: 1. Potentially shoot yourself in the foot with tons of extra whitespace. 2. Unreadable mess. TOML is better. You can choose whitespace if you want, but you can always go back to dot notation. Though I (sadly) agree JSON is better than YAML. One of the few times I've changed my mind from A to B and then back to A in tech.
- aitchnyu 6y agoIs there a YAML linter that enforces a safe subset of YAML so that unquoted "no" never makes it?
- the_imp 6y agoThis was fixed in YAML 1.2, which was released in 2009. Don't blame the spec, blame the applications that use ancient libraries.
- DarkWiiPlayer 6y agoYAML offers a simple solution though: just quote all one-word text and, more importantly, quote all text you don't manually write into the YAML file. Also, the main problem is that excel changes your input instead of just misinterpreting it. The difference being, the original will be gone.
- takluyver 6y agoYou could also start every Excel cell with ' . But it's really convenient not to quote stuff, so that's what everyone does, both in Excel and in YAML.
- FabHK 6y agoExactly. Excel offers the same "simple" solution.
- reportgunner 6y ago> excel changes your input That's a feature though. Coincidentally it only happens when you paste the data or if you messed up the generation of the file (didn't escape the column you want to leave untouched). To me it seems like a case of you're holding it wrong. (which I don't wholeheartedly support)
- mattnewton 6y agoIf I use those words a lot I will consider changing from YAML since it might be the wrong tool.
- recursive 6y ago> we happily use YAML Don't include me in that group.
- mixmastamyk 6y agohttps://hitchdev.com/strictyaml/ https://hitchdev.com/strictyaml/
- elwell 6y ago> Programmers love to complain about Excel In Apache POI HSSF/XSSF (Java Excel API), the HSSF actually stands for "Horrible Spreadsheet Format". As a fun example, note that we need isSheetHidden() and isSheetVeryHidden() functions. (http://poi.apache.org/apidocs/4.1/org/apache/poi/ss/usermodel/Workbook.html#isSheetHidden-int- http://poi.apache.org/apidocs/4.1/org/apache/poi/ss/usermode...)
- deleted 6y ago[deleted]