#also inevitably i will make at least one more semantic error set for i have a request
Explore tagged Tumblr posts
seokmatthewz ¡ 3 years ago
Text
love how my blog has become mostly ateez with some other random men scattered abt fnfmfnfn truly my brand
9 notes ¡ View notes
ganymedesclock ¡ 4 years ago
Text
I don’t want to say fictional robots “belong” to autistic people because any given fantastical allegory can have manifold and meaningful resonance to all manner of diversities, but something I do think is very interesting about fictional robots as an autistic person is this:
Robots as a plot element or character arc often center on this question of emotions. Do you feel emotions? Now, this is an imperfect argument about humanity/authenticity in the first place since there are plenty of Real Human Beings who experience anhedonia or alexithymia- but I think also, in my experience, a lot of these stories- sometimes in-universe, sometimes only in fandom responses- betray that maybe a lot more people than they think, are not very good at identifying emotions.
Many fictional robots- to be blunt- pour with emotion. They will often have a blunted affect (that is to say, speaking in a monotone, or limited facial expressions), they may use overly technical terminology, but they will make arbitrary decisions based on personal preference, it will be nakedly obvious they have a preference and their preference is determined at least in part by what pleases them. Data from Star Trek adores his cat and cares deeply about art and poetry.
And I won’t say any of these characters are bad people. I don’t want to suggest the goal is to create a character who’s “really” emotionless. If there is a quibble I have with this, it’s that I think we could all afford to be a little more careful and a little bit more imaginative, when considering how other people’s minds work, and how they present details. Not just as a joyless finger-wag of “you should be more responsible!” (though I will say there is some joylessness to it- I don’t really enjoy being shown a character who emotes close to how I naturally do, being fretted over by people asking if that character has a soul, is a real person, or simply an effective mimic; that hurts a little too personally to be fun!)
I was thinking of this because I was reflecting on one of my favorite little videos, My Job Is To Open And Close Doors. It’s a simple little uninterrupted 3-minute monologue about an AI who, well, see title, but has a bit of a crisis of purpose and asks themselves a bunch of critical questions about their role and purpose.
At its core, to me, the AI in My Job clearly experiences an emotion; they see something in the course of doing their job that they have no protocol or instruction to halt before, but feel an incredible misgiving about following through on. In response to this misgiving, in a very human manner, they begin to procrastinate- all the while, they point out to their own mounting confusion that this is a meaningless activity, but it buys them more time.
The voice acting given to the AI is very good, and, to me, cinches the whole piece- the actor very specifically does not leave a neutral-pleasant tonal range, and at several points, rather than asking an obviously “emotional” question, the AI simply hangs up in their own thinking talking to themselves- “because- because- because-” a very mechanical sort of stutter.
And using this flat affect and mechanical quirks, the actor establishes and fits to an emotional vernacular. The thrust of the plot- that the AI isn’t sure why they’re hesitating when their job is straightforwards and clear, that they even take note that this is being recorded as an error by another party- repeats in the sense of the stuttering- just as they procrastinate opening the doors without being sure why, they too “procrastinate” the completion of their statements when they’re unsure of them. The AI believes that the delivery of a solution, an answer, a “point”, is inevitable, so when they do not feel they have an answer they are incapable of saying “I don’t know”; instead, they stall. They procrastinate in the hope of achieving enough time to deliver an answer that meets their standards, that satisfies the parameters either set by their programming, or their own feelings.
My Job also adds in a sense of why emotions are important- in a sense that is not about enjoyment or satisfaction, although the AI ultimately does feel tremendously satisfied at the successful conclusion of their quandary- because without the ability to experience “baseless misgivings”, they would have simply responded to the initial command to open the door and been unbothered by whatever happened. In that sense, you could argue, it’s an ‘emotion’ born from ‘logic’ (that there is something amiss, though it takes the AI time to tease this out of their own thinking) but at that point we’re barking up a fool’s tree of semantics because our “logic” and our sentiments are both chemicals clattering around the same undifferentiated apparatus at the same time and thus inextricably attached to one another.
The thing that kills me about this is- with no hostility to the commenter in question- I scrolled down into the comments of My Job and immediately saw someone talking about how clearly, the AI has no emotions.
To me, this entire plot is about an AI having an emotion. Unmistakable and clear. This is about a door mechanism experiencing a profoundly human response to distress- procrastinating on the completion on a task they have every resource and in fact an active imperative to complete, based on a misgiving they are unable to articulate. This revelation is so profound to them that at the end of the video, they actually reframe their entire objective- “My job is to protect the human. My job is a great purpose.”
So I guess if there’s a tl;dr or conclusion to this sentiment, it’s that I think that while we can and should absolutely tell stories about fictional robots- because they are cool, and because they are also tremendously useful to ask certain existential questions about personhood- I think that it is actually very important to temper both our creation and consumption on these narratives on a more robust theory of neurodivergence, and, “I don’t recognize the way this emotion plays out in this particular person” does not equal “there is no emotion there at all”
208 notes ¡ View notes
Text
Late-to-the-party disorganized reflection of Jessica Jones Season 1, sue me
One of the biggest things that bugs me about Jessica Jones Season 1 is... and this isn’t me attacking the writers.. but it’s the fact that Jessica is so dismissive of other peoples’ trauma at the hands of Kilgrave when she’s asked to include herself in the group therapy sessions. It’s a deep character flaw that I dislike but I’m still somewhat glad exists. It makes her more believable, but in exchange it makes me dislike her more than if she were to say nothing. She refers to them as “whiney”, which..no offense Jessica, but if what they’re doing is whining, then what are you doing when you bring up your trauma to Kilgrave? 
To him, she’s whining just the same as them, only being far more unreasonable, and she uses that sentiment as an excuse to not go to the talks. She says to Malcolm at one point the equivalent of “Someone will always have it worse, so why should I air my dirty laundry out when I probably had it better than someone else”, as if it’s a suffering contest. The nature of victimization, the quality of it, the quantity of it, is what Kilgrave, and ultimately Jessica, are overly-fixated on.
For Kilgrave, the suffering of another person is fine by him because he doesn’t give a shit, but at the same time he thought he was being a great lover to Jessica by taking her all over the world and letting her wear fancy clothes and eating in the finest restaurants. What girl wouldn’t be happy about that? She’s just being ungrateful, she’s just being hysterical, he could have been so much worse to her. It’s a chilling thought process. “I COULD, but I won’t, and you should be thankful.” It’s the threat of a bad time that gives him power, and it is his frequent demonstration of how much of a bad time he could give someone that keeps him powerful.
The very character of Kilgrave is someone who is preoccupied with his wants and needs, like any psychopathic man-child who is desperate for a hit of serotonin that comes from having his whims met or doing what he feels like doing in the moment. His perception of things is the truth, his opinion of someone is how it actually is, and anything to the contrary is just a way for people to try to cage him in and control him. Everything is semantics, negligible, unimportant. The man can feel bad, but it’s self-pity or shallow concern. I think he does tiptoe close to feeling remorse for what he’s done to Jessica, but he stopped just at the ledge, looked down, saw the words “Accountability” and “Responsibility” emblazoned on the trampoline, and went “lol nope”. Because that would mean feeling bad, that would mean changing his self-serving behavior, and that shit is lame. Why would he make himself feel bad? He felt bad in the past, he felt tortured and traumatized by his parents (whether a psychopath or not, the experiments forced upon him would have made any child his age feel like a lab rat, I think, especially since they were so painful-looking..).
Where am I going with this...Kilgrave hits that sweet spot of 1% tragic villain and 99% horrible. He’s a nutter, he may have always been a nutter, or the experiments messed up his head. Whatever the case, his obsession with Jessica is the first time he’s ever felt infatuation for another person. He could list off all the things that fascinate him about her, and in the police station he tries to explain why he can’t stop thinking about her. She represents a challenge that half of him hopes to conquer, and the other half doesn’t. An eternal struggle between them to keep him entertained as he floats through life getting everything he wants. She can be his fiery woman, but she is his woman. She is a weapon he uses as he likes. And somewhere down the road he decided he was genuinely fond of her, but fondness does not translate to kindness and compassion when it comes to guys like Kilgrave, it just means you are too valuable to murder. Most of the time.
What strikes me the most though, is that I don’t know where the manipulation ends and where the self-delusion starts.
The manipulative explanation: Kilgrave is genre-savvy and knows what to say to make him out to be a psycho with a crush--i.e., oh he can’t comprehend what he’s doing is wrong! he didn’t choose to be crazy! He's only just now realized that this thing he feels is love and it may be the thing that he needs to help him become a better person! He wants to love someone and this is how he thinks he should go about it! Jessica, why would you give up on a chance on rehabilitating someone by teaching him the error of his ways? uwu. And he’ll pounce on those doubts and reel her in the first chance he gets. If he has to, he’ll use any innocent bystander as a way of getting her to go along with his bullshit. Maybe he’ll ease up on the criminal bullshit just to get her off his back, but...
The self-delusion explanation: He didn’t mean to hurt Jessica. Well, he did mean to hurt her on numerous occasions, but he didn’t want her to get mad or upset over it. He just wanted her to obey him and do what he said. Everything would be better if she just did what he wanted. Granted, he might have been a bit too harsh on her, but he never did it out of hatred! He has no concept of the depths of pain someone might feel; he’s quite skeptical of the idea that someone could be suffering so much under the surface while displaying the opposite sentiment on the outside. His psychopathy fuels, informs, and reinforces his powers, and vice versa. He doesn’t care about empathizing with others, so he will freely use his powers in a way that disregards them. He will go so far as to use his powers to make someone do something because he knows they don’t want to do it. With Jessica, I think he used his powers to force her to be someone he wanted her to be, but because the very nature of his powers are so pervasive, it truly is difficult for him to determine if someone is doing something against their will because he ordered them to, or if they are doing something because they were willing to do so anyway/agreed with him.
 At some point Kilgrave, for whatever reason, came to believe Jessica was following his orders but had also internalized them. He probably thought Stockholm Syndrome had set in and she was happy. He saw what he wanted to see, because the alternative was ugly--someone he was really keen on didn’t truly like him back, and that revelation would’ve broken his underdeveloped heart. Yes, she was being controlled but she wanted to be controlled, she was fine with being compelled to do things because it was him giving the order. In his sad little head, he thought he had a chance to “Win” her back, and his efforts to not be a horrible human being in her presence for a day-and-a-half should have been enough for Jessica to realize he was serious. If anything else, he would try to ape the behavior of a “normal” human being for as long as he thought he would get rewarded for it in the end. He genuinely thought he was doing what she wanted while they were living in her house. He thought that he was truly on the path to redemption in her eyes, that his crimes could be forgiven or overwritten if he did enough good things (regardless if he did them for altruistic reasons). That was why he was so distraught and felt so betrayed. He didn’t understand that that is not how it works. Even if Jessica did forgive him, that still doesn’t change the fact that he hurt scores and scores of people throughout his life. The fact that he most certainly wouldn’t care says enough about how screwed up he is.
On a single, tissue-paper thin level I can empathize with Kilgrave when it comes to not understanding why people are making such a big deal about things like “peoples’ feelings”. When you are not in touch with your sense of compassion, or you do not know how to empathize with people, people berating you about your insensitivity and callous nature is like being berated in a foreign language. You hear the upset tone in their voice, but the points being made don’t make sense. While anyone who disregards someone’s bodily autonomy and displays a lack of remorse for their crimes (or fails to see why something is a crime) is repugnant, it’s a testament to the writers and David Tennant’s portrayal of Kilgrave that actually made me feel bad for the bastard for a few minutes. He’s so twisted, he’s done so much wrong, but he wouldn’t have done any of these things if he hadn’t been granted powers. He terrorized his parents until they abandoned him. If he had been a normal boy there might have been hope for putting him in an institution or something, but no, not with his powers of compulsion/persuasion. If you took either one of those features away--Psychopathy or Persuasion Virus--he would have not gone down the path he had. It was a perfect storm, it was inevitable he would have become a fully-fledged criminal after being abandoned by his parents before he even hit puberty. I truly believe that. You can pull up the “well not every psychopath is a criminal” but how many psychopaths have this sort of superpower IRL? I’m not talking the glib charm and persuasion, I mean forcing people to do things they don’t want to do as if they’re robots and he has a remote control.     
 His self-entitlement is off the charts, but it’s someone who didn’t choose to be crazy or choose his power but has come to be this way for whatever reason and  I really, REALLY don’t want to use the word “gaslighting” because that word is overused to shit on the Internet to just mean “trying to lie your way out of a situation”, but I think that Kilgrave was trying to delude himself. He’s good at doing that, since it is impossible to talk to him without him being able to shut you up and make you cut your tongue out with scissors for angering him. Jessica was potentially the only person in the world who could maybe possibly get through to him, or at least deflate his bubble a bit. I know that Kilgrave would only allow it if he thought it would lead to Jessica giving him “another chance”, and when it didn’t happen he would accuse her of lying and trying to lead him on, as if she owed him forgiveness. That’s the kind of man he is. Quid pro quo and all that.
Going back to the very first paragraph, though...I don’t cite this writing as a mistake, but rather a deliberate effort to write her as someone whose response to trauma is not nearly as often seen in media. The pervasive image of a victim that has suffered what Jessica has suffered is someone blubbering in a corner and essentially wrecked, afraid of men, afraid of people, afraid of life in its entirety. ‘Someone who cries is exposing weakness.’ is the underlying message. Jessica nearly cries on many occasions after suffering a flashback or a nightmare, but she centers herself and shakes herself out of it because doing so comes more naturally to her than it may for others. I don’t really know how to explain it, but it’s not that people who “allow” their trauma to affect them are weak, but rather some people are able to mentally shake themselves out of its hold if given the proper tools to do so at a steadier clip than others. Predisposed skill level at processing trauma, and it’s a skill you learn and develop as time goes on, hopefully. Not all minds react to trauma the same way. Jessica fears Kilgrave, but she also hates him, she hates him in a way that translates to “I would lay my hands on you to remove you from my presence”, i.e. physical, verbal confrontation and rebuffs,  whereas other forms of hatred that stem from trauma seem to be “I would do everything in my power to remove myself from your presence”, i.e. avoidance, hiding. Season 1 to me felt like a war between both instincts, and ultimately Jessica chose the former. 
This isn’t to say that one must always choose to directly confront the source of their trauma and terminate it, since I think people can recover   Jessica has shades of that, and it is a battle throughout the season of “Do I avoid him or do I confront him?”  
She is a very shut-off person, really compartmentalizes everything while trying to make it seem like what happened to her doesn’t affect her, but only in front of strangers. When she is with Kilgrave she goes out of her way to remind him “Hey, you fucked me up, did you know that? YOUR CRIMES AGAINST MY PERSON FUCKED ME UP.” And he doesn’t know how to comprehend that. He expresses his disgust for the word “rape” because he believes the myth that rapists are the kind of people that hide in dark alleyways or skulk around skeevy dive bars. They’re cowardly, pathetic little men that resort to force because they can’t seduce a woman properly. But he! He is a suave well-dressed man with refined tastes! Women fall head over heels for him (until they realize he’s a horrible person, then they try to leave only to find they can’t). How many rapists attract the number of women he does? How many rapists are able to get a woman to say ‘yes’ without laying a hand on her? How many rapists shower their victims with expensive gifts and attention? How many rapists love their victims? 
Zero! So that means he’s not a rapist, obviously! To be accused of rape is a big existential threat to him. It would mean challenging the nature of the relationship that he has created in his mind between him and Jessica. He came to think there was genuine love between them and he somehow lost her, or he failed to pick up on something and she ran away. He blames her for breaking his heart, but at the same time he comes close to admitting that maybe he did something wrong and it made her angry, so he should at least try to fix it to make her happy, as if she got fed up with him coming home late from the office one too many times. You know, something objectively minor but still considered important in her overdramatic female mind. I should note that Kilgrave does not come off as a man who thinks less of women for being women, but believes they are a bit different from men ala “Women are from Venus, Men are from Mars”. Women require different handling; they don’t always say what they want because they don’t want to admit that they want things. That ties into Jessica’s statement that she doesn’t flirt, she states what she wants. But Kilgrave demonstrates that even when a woman states in plain terms what she wants, men assume the woman is lying, in denial, means the opposite, or she can be persuaded... 
It’s the discounting and downplaying of Jessica’s claims that really sell how far up his own ass Kilgrave really is. 
So in short:
Psychopathy + male chauvinism + Unfettered infatuation + Persuasion virus = The Biggest Recipe for Disaster in the History of Gender Relations Ever
10 notes ¡ View notes
tak4hir0 ¡ 6 years ago
Link
Written by Pascal Chambon, reviewed by Raphaël Gomès Update: this article mostly deals with the RESTish ecosystem, which now constitutes a major part of webservices. For more in-depth analysis of the original REST, and of HATEOAS, see my follow-up article. How come REST means so much WORK? This is both a paradox, and a shameless pun. Let’s dive further into the artificial problems born from this design philosophy. BEWARE : through this document, you’ll encounter lots of semi-rhetorical technical questions. Do not misunderstand them, they DO NOT mean that RESTish webservices can’t solve these problems. They just mean that users have an extra burden of decisions to take, of extensions to integrate, of custom workarounds to apply, and this is a problem in itself. The joy of REST verbsRest is not CRUD, its advocates will ensure that you don’t mix up these two. Yet minutes later they will rejoice that HTTP methods have well defined semantics to create (POST), retrieve (GET), update (PUT/PATCH) and delete (DELETE) resources. They’ll delight in professing that these few “verbs”are enough to express any operation. Well, of course they are; the same way that a handful of verbs would be enough to express any concept in English: “Today I updated my CarDriverSeat with my body, and created an EngineIgnition, but the FuelTank deleted itself”; being possible doesn’t make it any less awkward. Unless you’re an admirator of the Toki Pona language. If the point is to be minimalist, at least let it be done right. Do you know why PUT, PATCH, and DELETE have never been implemented in web browser forms? Because they are useless and harmful. We can just use GET for read and POST for write. Or POST exclusively, when HTTP-level caching is unwanted. Other methods will at best get in your way, at worst ruin your day. You want to use PUT to update your resource? OK, but some Holy Specifications state that the data input has to be equivalent to the representation received via a GET. So what do you do with the numerous read-only parameters returned by GET (creation time, last update time, server-generated token…)? You omit them and violate the PUT principles? You include them anyway, and expect an “HTTP 409 Conflict” if they don’t match server-side values (forcing you to then issue a GET...)? You give them random values and expect servers to ignore them (the joy of silent errors)? Pick your poison, REST clearly has no clue what a read-only attribute it, and this won’t be fixed anytime soon. Meanwhile, a GET is dangerously supposed to return the password (or credit card number) which was sent in a previous POST/PUT; good luck dealing with such write-only parameters too. Did I forget to mention that PUT also brings dangerous race conditions, where several clients will override each other’s changes, whereas they just wanted to update different fields? You want to use PATCH to update your resource? Nice, but like 99% of people using this verb, you’ll just send a subset of resource fields in your request payload, hoping that the server properly understands the operation intended (and all its possible side effects); lots of resource parameters are deeply linked or mutually exclusive(ex. it’s either credit card OR paypal token, in a user’s billing info), but RESTful design hides this important information too. Anyway, you’d violate specs once more: PATCH is not supposed to just send a bunch of fields to be overridden. Instead, you’re supposed to provide a “set of instructions” to be applied on the resources. So here you go again, take your paperboard and your coffee mug, you’ll have to decide how to express these instructions. Often with handcrafted specifications, since Not-Invented-Here Syndrome is a de-facto standard in the REST world. (Edit: REST advocates have backpedaled on this subject, with Json Merge Patch, an alternative to formats like Json Patch) You want to DELETE resources? OK, but I hope you don’t need to provide substantial context data; like a PDF scan of the termination request from the user. DELETE prohibits having a payload. A constraint that REST architects often dismiss, since most webservers don’t enforce this rule on the requests they receive. How compatible, anyway, would be a DELETE request with 2 MBs of base64 query string attached? (Edit: the RFC 2616, indicating that payloads without semantics should be ignored, is now obsolete) REST aficionados easily profess that “people are doing it wrong” and their APIs are “actually not RESTful”. For example, lots of developers use PUT to create a resource directly on its final URL (/myresourcebase/myresourceid), whereas the “good way” (edit: according to many) of doing it is to POST on a parent URL (/myresourcebase), and let the server indicate, with an HTTP “Location” header, the new resource’s URL (edit: it’s not an HTTP redirection though). The good news is: it doesn’t matter. These rigorous principles are like Big Endian vs Little Endian, they occupy philosophers for hours, but have very little impact on real life problems, i.e “getting stuff done”. By the way… handcrafting URLs is always great fun. Do you know how many implementations properly urlencode() identifiers while building REST urls? Not that many. Get ready for nasty breakages and SSRF/CSRF attacks. When you forget to urlencode usernames in 1 of your 30 handcrafted URLs.The joy of REST error handlingAbout every coder is able to make a “nominal case” work. Error handling is one of these features which will decide if your code is robust software, or a huge pile of matchsticks. HTTP provides a list of error codes out-of-the-box. Great, let’s see that. Using “HTTP 404 Not Found” to notify about an unexisting resource sounds RESTful as heck, doesn’t it? Too bad: your nginx was misconfigured for 1 hour, so your API consumers got only 404 errors and purged hundreds of accounts, thinking they were deleted…. Our customers, after we deleted their gigabytes of kitten images by error.Using “HTTP 401 Unauthorized” when a user doesn’t have access credentials to a third-party service sounds acceptable, doesn’t it? However, if an ajax call in your Safari browser gets this error code, it might startle your end customer with a very unexpected password prompt [it did, years ago, YMMV]. HTTP existed long before “RESTful webservices”, and the web ecosystem is filled with assumptions about the meaning of its error codes. Using them to transport application errors is like using milk bottles to dispose of toxic waste: inevitably, one day, there will be trouble. Some standard HTTP error codes are specific to Webdav, others to Microsoft, and the few remaining have definitions so fuzzy that they are of no help. In the end, like most REST users, you’ll probably use random HTTP codes, like “HTTP 418 I’m a teapot” or unassigned numbers, to express your application-specific exceptions. Or you’ll shamelessly return “HTTP 400 Bad Request” for all functional errors, and then invent your own clunky error format, with booleans, integer codes, slugs, and translated messages stuffed into an arbitrary payload. Or you’ll give up altogether on proper error handling; you’ll just return a plain message, in natural language, and hope that the caller will be a human able to analyze the problem, and take action. Good luck interacting with such APIs from an autonomous program. The joy of REST conceptsREST has made a career out of boasting about concepts that any service architect in his right mind already respects, or about principles that it doesn’t even follow. Here are some excerpts, grabbed from top-ranked webpages. REST is a client-server architecture. The client and the server both have a different set of concerns. What a scoop in the software world. REST provides a uniform interface between components. Well, like any other protocol does, when it’s enforced as the lingua franca of a whole ecosystem of services. REST is a layered system. Individual components cannot see beyond the immediate layer with which they are interacting. It sounds like a natural consequence of any well designed, loosely coupled architecture; amazing. Rest is awesome, because it is STATELESS. Yes there is probably a huge database behind the webservice, but it doesn’t remember the state of the client. Or, well, yes, actually it remember its authentication session, its access permissions… but it’s stateless, nonetheless. Or more precisely, just as stateless as any HTTP-based protocol, like simple RPC mentioned previously. With REST, you can leverage the power of HTTP CACHING! Well here is at last one concluding point: a GET request and its cache-control headers are indeed friendly with web caches. That being said, aren’t local caches (Memcached etc.) enough for 99% of web services? Out-of-control caches are dangerous beasts; how many people want to expose their APIs in clear text, so that a Varnish or a Proxy on the road may keep delivering outdated content, long after a resource has been updated or deleted? Maybe even delivering it “forever”, if a configuration mistake once occurred? A system must be secure by default. I perfectly admit that some heavily loaded systems want to benefit from HTTP caching, but it costs much less to expose a few GET endpoints for heavy read-only interactions, than to switch all operations to REST and its dubious error handling. Thanks to all this, REST has HIGH PERFORMANCE! Are we sure of that? Any API designer knows it: locally, we want fine-grained APIs, to be able to do whatever we want; and remotely, we want coarse-grained APIs, to limit the impact of network round-trips. Here is again a domain in which “basic” REST fails miserably. The split of data between “resources”, each instance on its own endpoint, naturally leads to the N+1 Query problem. To get a user’s full data (account, subscriptions, billing information…), you have to issue as many HTTP requests; and you can’t parallelize them, since you don’t know in advance the unique IDs of related resources. This, plus the inability to fetch only part of resource objects, naturally creates nasty bottlenecks (edit: yes, you can stuff extensions like Compound/Partial Documents into your setup to help with that). REST offers better compatibility. How so? Why do so many REST webservices have “/v2/” or “/v3/” in their base URLs then? Backwards and forward compatible APIs are not hard to achieve, with high level languages, as long as simple rules are followed when adding/deprecating parameters. As far as I know, REST doesn’t bring anything new on the subject. REST is SIMPLE, everyone knows HTTP! Well, everyone knows pebbles too, yet people are happy to have better blocks when building their house. The same way XML is a meta-language, HTTP is a meta-protocol. To have a real application protocol (like “dialects” are to XML), you’ll need to specify lots of things; and you’ll end up with Yet Another RPC Protocol, as if there were not enough already. REST is so easy, it can be queried from any shell, with CURL! OK, actually, every HTTP-based protocol can be queried with CURL. Even SOAP. Issuing a GET is particularly straightforward, for sure, but good luck writing json or xml POST payloads by hand; people usually use fixture files, or, much more handy, full-fledged API clients instantiated directly in the command line interface of their favorite language. “The client does not need any prior knowledge of the service in order to use it”. This is by far my favourite quote. I’ve found it numerous times, under different forms, especially when the buzzword HATEOAS lurked around; sometimes with some careful (but insufficient) “except” phrases following. Still, I don’t know in which fantasy world these people live, but in this one, a client program is not a colony of ants; it doesn’t browse remote APIs randomly, and then decide how to best handle them, based on pattern recognition or black magic. Quite the opposite; the client has strong expectations on what it means, to PUT this one field to this one URL with this one value, and the server had better respect the semantic which was agreed upon during integration, else all hell might break loose. When you ask how HATEOAS is supposed to work.How to do REST right and quick?Forget about the “right” part. REST is like a religion, no mere mortal will ever grasp the extent of its genius, nor “do it right”. So the real question is: if you’re forced to expose or consume webservices in a kinda-RESTful way, how to rush through this job, and switch to more constructive tasks asap? Update: it turns out that there are actually lots of “standards” and industrialization efforts for REST, although I had never encountered them personnally (maybe because few people use them?). More information in my follow-up article. How to industrialize server-side exposure?Each web framework has its own way of defining URL endpoint. So expect some big dependencies, or a good layer of handwritten boilerplate, to plug your existing API onto your favorite server as a set of REST endpoint. Libraries like Django-Rest-Framework automate the creation of REST APIs, by acting as data-centric wrappers above SQL/noSQL schemas. If you just want to make “CRUD over HTTP”, you could be fine with them. But if you want to expose common “do-this-for-me” APIs, with workflows, constraints, complex data impacts and such, you’ll have a hard time bending any REST framework to fit your needs. Be prepared to connect, one by one, each HTTP method of each endpoint, to the corresponding method call; with a fair share of handmade exception handling, to translate passing-through exceptions into corresponding error codes and payloads. How to industrialize client-side integration?From experience, my guess is: you don’t. For each API integration, you’ll have to browse lengthy docs, and follow detailed recipes on how each of the N possible operations has to be performed. You’ll have to craft URLs by hand, write serializers and deserializers, and learn how to workaround the ambiguities of the API. Expect quite some trial-and-error before you tame the beast. Do you know how webservices providers make up for this, and ease adoption? Simple, they write their own official client implementations. FOR. EVERY. MAJOR. LANGUAGE. AND. PLATFORM. I’ve recently dealt with a subscription management system. They provide clients for PHP, Ruby, Python, .NET, iOS, Android, Java… plus some external contributions for Go and NodeJS. Each client lives in its own Github repository. Each with its own big list of commits, bug tracking tickets, and pull requests. Each with its own usage examples. Each with its own awkward architecture, somewhere between ActiveRecord and RPC proxy. This is astounding. How much time is spent developing such weird wrappers, instead of improving the real, the valuable, the getting-stuff-done, webservice? Sisyphus developing Yet Another Client for his API.ConclusionFor decades, about every programming language has functioned with the same workflow: sending inputs to a callable, and getting results or errors as output. This worked well. Quite well. With Rest, this has turned into an insane work of mapping apples to oranges, and praising HTTP specifications to better violate them minutes later. In an era where MICROSERVICES are more and more common, how come such an easy task — linking libraries over networks — remains so artificially crafty and cumbersome? I don’t doubt that some smart people out there will provide cases where REST shines; they’ll showcase their homemade REST-based protocol, allowing to discover and do CRUD operation on arbitrary object trees, thanks to hyperlinks; they’ll explain how the REST design is so brilliant, that I’ve just not read enough articles and dissertations about its concepts. I don’t care. Trees are recognized by their own fruits. What took me a few hours of coding and worked very robustly, with simple RPC, now takes weeks and can’t stop inventing new ways of failing or breaking expectations. Development has been replaced by tinkering. Almost-transparent remote procedure call was what 99% people really needed, and existing protocols, as imperfect as they were, did the job just fine. This mass monomania for the lowest common denominator of the web, HTTP, has mainly resulted in a huge waste of time and grey matter. REST promised simplicity and delivered complexity. REST promised robustness and delivered fragility. REST promised interoperability and delivered heterogeneity. REST is the new SOAP. EpilogueThe future could be bright. There are still tons of excellent protocols available, in binary or text format, with or without schema, some leveraging the new abilities of HTTP2… so let’s move on, people. We can’t forever remain in the Stone Age of Webservices. Edit: many people asked for these alternative protocols, the subject would deserve its own story, but one could have a look at XMLRPC and JSONRPC (simple but quite relevant), or JSONWSP (includes schemas), or language-specific layers like Pyro or RMI when for internal use, or new kids in the block like GraphQL and gRPC for public APIs… “Always finish a rant on a positive note”, momma said.Edited on December 12, 2017: normalize section titlesremove some typosrectify improper “HTTP redirection” wording after POST operationsadd suggestions of alternative protocolsEdited on December 28, 2017: fix mixup between “HTTP methods” and “REST verbs”Edited on January 7, 2018 Edited on January 19, 2018 fix wrong wording on “PUT vs GET” remarksprecise the notion of “real APIs” (non-CRUD)mention risk of overrides with PUTupdate paragraphs on PATCH and DELETE troublesEdited on January 19, 2018 fix wording around Not-Invented-Here SyndromeEdited on February 2, 2018 add links to follow-up article on The Original REST, in “introduction” and “how to industrialize” chaptersEdited on April 14, 2019 add clarification about “semi-rhetorical question”, and hints about extensions like compound/partial documentsEdited on July 6, 2019 fix typos and French links
0 notes