1,874 karma · joined Jun 12, 2019 (7y ago) · 701 submissions
[ my public key: https://keybase.io/thinkharder; my proof: https://keybase.io/thinkharder/sigs/Ibpz0COsvz2qYl2K8YfzrhucHf2rcZIxityh5WvYC_k ]
comment 1y ago · link · parent
comment 1y ago · link · parent
But in some situations you can be pretty confident that a field will be required always. And if you turn out to be wrong then it's not a huge deal. You add the new field as optional first (with all upgraded clients setting the value) and then once that is rolled out you make it required.
And if a field is in fact semantically required (like the API cannot process a request without the data in a field) then making it optional at the interface level doesn't really solve anything. The message will get deserialized but if the field is not set it's just an immediate error which doesn't seem much worse to me than a deserialization error.
comment 1y ago · link · parent
I think this is exactly what you end up with using protobuf. You have an IDL that describes the interface types but then protoc generates language-specific types that are horrible so you end up converting the generated types to some internal type that is easier to use.
Ideally if you have an IDL that is more expressive then the code generator can create more "natural" data structures in the target language. I haven't used it a ton, but when I have used thrift the generated code has been 100x better than what protoc generates. I've been able to actually model my domain in the thrift IDL and end up with types that look like what I would have written by hand so I don't need to create a parallel set of types as a separate domain model.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
I prefer the way Einstein said it (or at least I've heard it attributed to him, not sure if he actually said it): "Make things as simple as possible, but no simpler".
comment 1y ago · link · parent
George W Bush (also a Republican) was POTUS in 2008 and it was his administration that oversaw the bank bailouts (the program continued under the Obama administration but was designed and implemented by the Bush admin) and the nationalization of Fannie and Freddie.
comment 1y ago · link · parent
For workloads that are a mix of IO and non-trivial CPU work, it can still work but is much, much harder to get right.
comment 1y ago · link · parent
You can debate whether it is sloppy but I think an error is much better than silently corrupting data.
> The best approach is to treat data as opaque bytes unless there is a good reason not to
This doesn't seem like a good approach when dealing with strings which are not just blobs of bytes. They have an encoding and generally you want ways to, for instance, convert a string to upper/lowercase.
comment 1y ago · link · parent
comment 1y ago · link · parent
Using the word "cheating" has a very negative valence, but it's not exactly a secret that EV batteries are not designed to use their full "raw" capacity. The manufacturer is quite clear that you should avoid charging to more than 80% on a regular basis as it will degrade the battery faster. What matters is not that the batteries are capable of some theoretical "raw" capacity but that the advertised capacity is correct, just like with SSDs. It doesn't strike me as cheating that SSDs have more capacity than what is advertised on the (proverbial) box.
comment 1y ago · link · parent
comment 1y ago · link · parent
1. What to do with people apprehended entering the country illegally and who then claim asylum.
2. What to do with people already inside the country who are suspected of being here illegally.
The first thing is complicated and badly in need of a rethink because clearly our asylum laws are being gamed. I don't have any ready answers but I'm sure that there are a zillion proposals for reform.
For the second thing, yes I believe that if you are suspected of being in the US illegally then you should absolutely have the right to challenge deportation in court. Otherwise literally anyone can be scooped up off the street and deported with no recourse whether they are an American citizen or not. And honestly it is a bit maddening to see people continuously fail to grasp (or pretend to fail to grasp) this basic point.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent