Personally, I prefer duplicate keys to be eaten by the parser but I can see how it’d be beneficial to prevent them.
Personally, I prefer duplicate keys to be eaten by the parser but I can see how it’d be beneficial to prevent them.
Yeah, I remember when I was trying to parse XML into some lua tables and it forever stumped me how to represent something like
<thing important_param=10 other_param="abracadabra"> stuff </thing>
You just have to have different ways to turn different tags into stuff in your program and that’s a huge amount of overhead to think about when all I want is a hash map and maybe an array.
It’s inconsistent and annoying. Expressive, yes. Gets it’s job done, yes. Absolute nightmare of a spec, YES.
The fact that JSON is a subset of YAML should tell you everything about how bloated the spec is. And of course there’s the “no” funny things.
Personally, my favourite way to write configs was using lua (because it was already part of the project so why not), but JSON does fine.
So they’re doing the same thing as that time they killed Edge and stretched its skin over chromium?
In slav languages, you just go with how the neologism sounds. “Computer” ends in hard r, so it’s masculine, for example.
Every once in a while there’s going to be shit like with “coffee” though. It sounds neutral-gendered and is officially neutral-gendered, but there’s been a big period when people believed it should be masculine because of the source language or some shit. Still a lot of people arguing about it.
Well, there’s a few things I personally think are a must for a config format:
Oh god, parsing complexity. I actually tried writing a YAML parser in my free time before and boy was that not worth the headache. So many little things that complicate parsing and are ignored by majority of users!
I really like python, but I can agree that it’s no-delimiters style can be… Confusing at times. I definitely had to hunt down bugs that were introduced by wrong indentation. That and the way it handles global/local variables, mostly.
I do appreciate not having to enclose every key in “”, and being able to copy values - but if we want that kind of logic making our configs, why not just switch to writing configurations in Lua? It certainly has less footguns than YAML and it has the niceties like “I can just write {key = "value"}
instead of {"key": "value"}
”.
Most comment-aware JSON parsers I’ve seen just use standard // to delineate comment lines.
Python has stricter rules about what can be cludged together and how.
Yaml is… Kind of nebulous, which is not a good thing for a data serialization format.
Fair enough, lol.
Never figured out how to start listening to podcasts, tbh.
Well, if you’re writing something the user will be looking at and clicking on, you will probably want to have some sort of state management that is global.
Or if you’re writing something that seems really simple and it’s own thing at first but then SURPRISE it is part of the system and a bunch of other programmers have incorporated it into their stuff and the business analyst is inquiring if you could make it configurable and also add a bunch of functionality.
I also had to work with a system where configurations for user space were done as libraries setting global constants. And then we changed it so everything had to be hastily redone so that suddenly every client didn’t have the same config.
Why use
const max = (x, y) => x > y ? x : y
instead of
function max(x, y) { return x > y ? x : y }
?
Oil and automotive companies literally tore most of public transport out in US way back when.
They would invest into the local tram companies, buy them out, then close and tear out the lines.
Yeah. Sidenote, I hate the trend of bike lights nowadays to come with horns.
I just want to make people in front of me aware I exist, I don’t want to alert the whole fucking street!
Yeah. The only mode of transportation that I own is an ebike. And I could probably cut the “e” part out without too much fuss.
Good panier bags make all the difference though.
Renting is exactly what we did :D Can’t very well bring a whole ass car with you on a plane. Nor should you want to.
I mean, an ebike + light rail is enough to explore a city and it’s surroundings, but I can think of a few places I’ve visited in my life that would be basically inaccessible without a car.
…or a very, very long roundtrip on train, I suppose. For like two of them.
Still, shouldn’t need a car in an urban area.
Man, the variable scoping thing is insidious. It will never not be weird to me that
if
s and loops don’t actually create a new scope.And then you try to do a closure and it tells you you didn’t import anything yet.