3 ms·
So, I'm reading a lot of reasoning, but not many good reasons yet. Can anyone follow through on why PATCH vs PUT is better? Assume I'm stupid. Explain to me,
by tripzilch 15y ago
So, I'm reading a lot of reasoning, but not many good reasons yet. Can anyone follow through on why PATCH vs PUT is better?
Assume I'm stupid.
Explain to me, but don't stop at "because it's more compliant to the HTTP Standard" / "because thus it has been written in the scriptures" mustn't be the fundamental reason to do something.
Similarly, "it is Good to be compliant with the HTTP Standards in this case, because in other cases it was Good also"--certainly I can understand that being compliant with the 200 and 404 status code is a Good Thing.
But is there any other, tangible reason why a Rails project would benefit from now using PATCH instead of PUT? Some interoperability with another existing framework maybe? Or interoperability with a hypothetical future framework? What other kinds of software would need to be changed and used before it'll provide a tangible benefit to a Rails project that uses PATCH vs a Rails project using PUT?
BTW I'm not arguing against standards (I know, I said you may assume I'm stupid, but no need to go all out ok?), I'm just genuinely curious if there is any other benefit, real, future, hypothetical or imaginary, other than "it's more compliant, and being compliant is good".
Actually even if that is the only reason, that's nice, it makes things neater and that's also good. But it would be kind of thin.
- rue 15y agoThey're different things, just like eating and drinking are different things. I don't really know what Rails is doing with them, but it's a really simple reason at the HTTP scope. PUT is A) idempotent (meaning that repeated operations have the same result), and B) always replaces the entire resource (and by implication should contain the entire new resource). PATCH is A) not idempotent (meaning that repeated invocations could have different results), and B) affects part or all of the resource. So, an immediately obvious benefit[1] is that PATCH requests are potentially much lighter-weight. [1] Aside from conceptual clarity which I frankly cannot fathom reasons for arguing against, yet many do…