Live data from Hacker News

REST is the new SOAP

medium.com

141–150 of 351 posts

Re: REST is the new SOAP

#141
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

[deleted]

Re: REST is the new SOAP

#142
post #131

I'll be honest and say I refuse to read this based on its title. I've used SOAP somewhat recently. It's shittier than anything I've done in programming and I've done plenty of PHP 5 stuff. There's so much inane stuff in SOAP, and it's rare that a SOAP client in one language will work properly with a SOAP server in another. Yes, it's HTTP-based APIs. But they've perverted the HTTP spec with weird extensions like SOAP…

You should read it. The title is misleading. I think the author proposes that REST is the new (failed) SOAP.

I'm remaining firmly unconvinced.

REST is an anti-standard. It doesn't tell you what to do, it just gives you some guidelines of sorts. And honestly, you don't even have to follow them - the spirit of REST is in simple JSON + HTTP-based operations.

As an example, this?

    createAccount(username, contact_email, password) -> account_id
    addSubscription(account_id, subscription_type) -> subscription_id
    sendActivationReminderEmail(account_id) -> null
    cancelSubscription(subscription_id, reason, immediate=True) -> null
    getAccountDetails(account_id) -> {full data tree}
Could be this:

    POST /accounts/ {username, contact_email, password} -> {account_id}
    POST /accounts/:account_id/subscriptions/ {subscription_type} -> {subscription_id}
    POST /accounts/:account_id/send_activation_reminder_email/ -> {}
    DELETE /accounts/:account_id/subscriptions/:subscription_id/ {reason, immediate} -> {}
    GET /accounts/:account_id/ -> {full data tree}
...Or an unending number of other interpretations. You can, for example, flatten the tree and put `/subscriptions/` at the root. Doesn't matter. It isn't that ridiculously hard to understand or formulate.

And if you want, you can make everything perfectly RESTful and make everything a resource. Kubernetes and its API objects concept are great examples. Deploying services with POST/PATCH/PUT? Just add some layers of abstraction.

Having REST bindings for many languages is not a ridiculous thing to do either. If your API is huge, autogenerate it somehow. Swagger/OpenAPI exists. Or, maybe don't make bindings at all. If I wanted to write payment handling code for Stripe, I'd feel no hesitation doing it by making the HTTP requests directly. It's not hard or scary. Them having rich, quality libraries for many languages is a marketing decision, and a damn good one in my opinion. It does things that no cross-language abstraction layer could to make life as simple as possible.

Honestly, people can do whatever they want, but I genuinely do not get why REST-based services are so bad. Honestly, if anything is difficult nowadays, it's authentication. I'm a big fan of OAuth2, but there's a thing that isn't fun to write client libraries for.

(I have. The problem isn't that it's complicated; the problem is that nobody implements it right. Google's OIDC implementation has all kinds of bugs. Losing scopes on refresh is incredibly annoying.)

Re: REST is the new SOAP

#143

Earlier quoted context omitted.

I think “hipsteresque opinions looking to sound smarter and more insightful than they actually are” is a very good definition for much of Medium’s content. It may have to do with the platform being used by individuals trying to create a brand of themselves, resulting in a high percentage of sensationalist and controversial posts. Along with the necessity to write on a regular basis.

Programming Paradigm Becomes Popular B/C it gets stuff done --> left: it gets stuff done because it's smarter right: it's bad for you, it's actually getting less done middle: didn't read all that stuff, busy getting stuff done.

me: already groaning at the thought of fixing stuff after that one who didn't "read all that stuff," the "left", and thankfully the right was too busy pontificating to do anything so there's no fixing to be done.

Read. The. Damn. Stuff.

Re: REST is the new SOAP

#144
Surprised to have scrolled this far and not see one mention of GraphQL. It has a discoverable, schema based design, strongly typed. It segments requests into three types, queries, mutations, and subscriptions. Queries are simple data fetching. Mutations can be treated like RPC calls. Subscriptions are for long lived connections to receive live updates for data queries. I think it fixes a lot of problems with REST. I think it works extremely well with microservice architecture.

Re: REST is the new SOAP

#145
I agree with almost every point of this article. REST is terrible. The only thing I don't agree is that SOAP is bad. Web services are awesome if used with some limitations. Major platforms have autogeneration, so you are spending zero time to build a robust API. I've yet to see anything as simple and fast as Web services. I think that world migrating to REST is a huge mistake.

Re: REST is the new SOAP

#146
post #17

Article reads like being from a crumpy snarky old age dev who lives in his XML-land filter bubble of the 1990s. Go back to XMLRPC and SOAP please. This site is getting more of these corporate old farts lately that don't want to adjust at all. I wish the time back when this site was about startup news, VCs, and new exiting things and not about whining and boring stuff.

We've asked you many times to please comment civilly and substantively, and yet you've continued to repeatedly violate the guidelines, so we've banned the account. We're happy to unban accounts if you email us at hn@ycombinator.com and we believe you'll start following the guidelines.

https://news.ycombinator.com/newsguidelines.html

Re: REST is the new SOAP

#147
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

Hate gets more clicks than producing.

Twist on “easier to destroy than create.”

Re: REST is the new SOAP

#148
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

> Why is REST so popular?

REST is not popular, there are only a few RESTful public API in the wild. The rest (unavoidable pun, sorry) are simple HTTP APIs with JSON serialization which maps with various degree of coupling to internal data layer.

The main cause you don't need REST limitations to achieve same goals.

OP has strong opinion about why we need to reimplement rpc over http every time for every application and write clients for every popular platform to be able to consume it.

Every time I use REST from any google cloud api, my hair is moving and you definitely will have nightmares if you look into their python client code.

Re: REST is the new SOAP

#149

I think there’s a tendency in software for people to start out without understanding all the complexities they’re going to encounter. I think this is just human nature. When you start out doing RPC you think, I don’t want to bother with schemas, I don’t want to bother with hierarchical error codes, I don’t foresee the need to set the user’s password but not retrieve it. So you don’t want to bother with a technology w…

Yup. It's the mechanism behind programming as a pop culture. Kids without a lot of experience are sick of the old way because it's too hairy and complicated, they come out with a fresh new approach that isn't nearly as broadly applicable, then it gets improved until it's fit for general purpose, at which point it's hairy and complicated and the cycle starts again. I don't think that everything is standing still, thou…

This is a self limiting mindset.

"All good solutions to existing problems have been discovered. There may be new problems which need new solutions, but no one will ever improve on what we have already done. Anyone who things they can is a child playing in the dirt."

Re: REST is the new SOAP

#150

Earlier quoted context omitted.

Xmlrpc is incredibly underappreciated.

Xmlrpc is simple and it works. Xmlrpc is soap without the bullshit. I built lots of personal apps that were flash/flex front ends that talked to python backends over xmlrpc to quickly whip up his for my python aps

btw SOAP was supposed to be "xmprpc standardized"

I remember well the meeting when things started to go off track...

Post reply on HN