3 ms·
> If you’re an Advent of Code kind of person and you haven’t already written a parser for this format, you’re probably starting to feel a twitch in your left ey
by tantalor 5y ago
> If you’re an Advent of Code kind of person and you haven’t already written a parser for this format, you’re probably starting to feel a twitch in your left eyelid. Go ahead and write the parser; it’ll take you 15 minutes and the world can’t have too many implementations of this exposition format. There's a lesson about virality among programmers buried in here somewhere.
Huh? Who gets excited about writing a parser?
What was wrong with "${key} ${value}" on separate lines?
- tptacek 5y agoIs "excited" the word? I don't know. I think "obsessively compelled" is more what I was going for. It's one of those formats where --- despite apparently being originally intended for human consumption --- you can immediately see the rule of construction for, like you're not just reading the data, but also the pseudocode for how it's formatted.
- chris_st 5y agoHaving written a lot of parsers, I really loved how you put a newline in a "keyword"-type thing, just to keep it interesting :-)
- mdoms 5y agoWell I suppose what's wrong with it is that these metrics are more complicated than key=>value. The metric referred to in your quote contains a metric name, multiple attributes (status, app ID etc) and a value.
- devoutsalsa 5y agoI love writing one liner parsers in Elixir when I’m bored. Pipes and pattern matching for the win!!