![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/8140dda6-9512-4297-ac17-d303638c90a6.png)
Every day pretty much with Unix tools. Vim, awk, sed, etc.
Every day pretty much with Unix tools. Vim, awk, sed, etc.
That’s what the If-Match header is for. It prevents this problem.
That being said, I generally think PUT
s are preferable to PATCH
es for simplicity.
It’s about making APIs more flexible, permissive, and harder to misuse by clients. It’s a user-centric approach to API design. It’s not done to make it easier on backend. If anything, it can take extra effort by backend developers.
But you’d clearly prefer vitriol to civil discourse and have no interest in actually learning anything, so I think my time would be better spent elsewhere.
As I already said, it’s very simple with JSON Patch:
[
{ *op": "replace", "path": "/Name™, "value": "otherName"}
]
Good practice in API design is to permissively accept either undefined or null to represent optionality with same semantics (except when using JSON Merge Patch, but JSON Patch linked above should be preferred anyway).
The semantics of the API contract is distinct from its implementation details (lazy loading).
Treating null and undefined as distinct is never a requirement for general-purpose API design. That is, there is always an alternative design that doesn’t rely on that misfeature.
As for patches, while it might be true that JSON Merge Patch assigns different semantics to null and undefined values, JSON Merge Patch is a worse version of JSON Patch, which doesn’t have that problem, because like I originally described, the semantics are explicit in the data structure itself. This is a transformation that you can always apply.
Zalando explicitly forbids it in their RESTful API Guidelines, and I would say their argument is a very good one.
Basically, if you want to provide more fine-grained semantics, use dedicated types for that purpose, rather than hoping every API consumer is going to faithfully adhere to the subtle distinctions you’ve created.
Only if using JSON merge patch, and that’s the only time it’s acceptable. But JSON patch should be preferred over JSON merge patch anyway.
Servers should accept both null and undefined for normal request bodies, and clients should treat both as the same in responses. API designers should not give each bespoke semantics.
Confused what you mean. OpenAPI has nothing to do with JS.
There are a number of blue cities in the Midwest. What’s the lowest temp you want? I live in Lincoln, Nebraska and it’s pretty great: nice weather most of the year, low cost of living, blue city, tons of parks. Only downside is dealing with red state bullshit from the state government.
sigh
I’m so tired of repeating this ad nauseum. No, it’s not going to take your job. It’s hype train bullshit full of grifters. There is no intelligence or understanding, nor have we come anywhere close to achieving that. That is still entirely within the realm of science fiction.
Pretty dumb, honestly. If anything it just adds a Streisand effect to it as people try to figure out what’s censored.
Not that censoring it has any value whatsoever. Like if a child sees that, so fucking what?
Yeah it’s not all that uncommon in school, just increasingly uncommon in industry.
As someone that has recently taken an infant and and family CPR class for my son who started solid foods a few months ago, this is pretty similar to how they teach it today and I’m pretty sure it would have the same effect. You can’t perform a heimlich on a baby or very small child for a variety of reasons. This method or something similar to it is both safer and more effective, since it lets gravity help dislodge the food.
Visual… programming languages? Yikes.
Never do certifications for software engineering. The only certifications worth a damn are security certs and networking certs. If I saw a programming-related certification on a resume, I would completely ignore it since the only thing it tells me is that you paid some money to get a cert.
While I’m not a fan of Java, it’s most certainly not a dying language and you will be able to easily find employment into perpetuity. If I had to pick, I’d personally choose Java over .NET purely to avoid being trapped in Microsoft-land, especially with all of the bullshit they’ve been up to lately.
Sure… That"s what libraries are for. No one hand-rolls that stuff. You can do all of that just fine (and, actually, in a lot less code, mostly because Java is so fucking verbose) without using the nightmare that is Spring.
The similarities are superficial at best. The only thing similar is that it uses braces for attribute sets (objects) and square brackets for lists. And I guess quotes for strings.
But otherwise it’s a full (functional) programming language, with functions, variable bindings, etc.
Flakes aren’t perfect, but they are really good for ensuring that you have completely reproducible builds since the version used for every dependency is pinned.
It has the return type declared to be
double
.