Live data from Hacker News

Do we need a web API?

liaison.dev

51–60 of 107 posts

Re: Do we need a web API?

#51
post #39
post #7

Earlier quoted context omitted.

welcome to the web 2.0 cooming soon: web assemply web 3.0 which (I fear) might feel a lot like flash web pages from the early 00s. I hope I'm wrong.

Webasm doesn't enable anything new that couldn't already be done right now.

but it will improve the ability to obfuscate webpages

Re: Do we need a web API?

#52
post #21

Earlier quoted context omitted.

Even in JS, the Meteor framework was basically created to implement this. Except they actually implement things like validation, because as much as one may want to unify both environments, the reality is that exposing all your methods to the outside world may have some pitfalls, to put it mildly.

What ever happened to Meteor? It was flavour of the month a few years ago, with many a frontend dev ranting about how great it was. Now seems to be forgotten about.

I ran into a company recently that was still using Meteor (B2B with roughly 50 million USD of funding). It made me realize the consequences of choosing a technology for a major project before it's gotten widespread acceptance. Made me realize I need to be a bit more cautious, and that I've gotten very lucky.

Re: Do we need a web API?

#53

RPC - this isn't anything new. When I started doing web development in the late 90s for about ~5 years I was the designer, front-end, and backend developer all in one. Then over time things changed to allow for specializations and we now have many different functions, and that's a good thing. RPC has a place, and it's not for web apps, at least most of the time. I've noticed over the years that JavaScript developers…

I'd imagine it's probably a business thing as well. The idea that they can easily transfer people from frontend to backend tasks or have full stack devs who don't need to know two languages.

Where I work, having one language has made things simpler when doing tasks. Don't need to look things up as much because you keep forgetting which one uses push vs append, etc.

Re: Do we need a web API?

#54
The readme says: "The current state of an instance (i.e., counter's attributes) is automatically transported back and forth."

How does this work? Do you need some cross-network locking mechanism when you need to make sure the shared object's state doesn't get out of sync between client and server?

What about passing object instances between client and server? Does it do what (I think) DCOM does to handle garbage-collection of cross-machine object references – keep-alives and timeouts?

Re: Do we need a web API?

#55
Having clear API allows to have a clear boundary between trusted and untrusted environment in backend. If you don't check your arguments in REST endpoint, it's obvious bug and easy to spot. If it's just another method, well, you're not treating input in every function as a hostile.

Re: Do we need a web API?

#56
post #15

Pouchdb/firebase/backend-as-a-services were supposed to be the answer to getting rid of CRUD apis. The problem is authorization and validation becomes really difficult if you don't have a backend that you can trust.

This. If you can just trust the clients, lots of things get easier. Though even then distributed systems are not trivial -- just look at Lustre (where clients in a cluster are all trusted, and if you don't trust some client, then it must use a proxy such as an NFS server running on a cluster member client).

Re: Do we need a web API?

#57
post #4

>Sorry, this site requires JavaScript to be enabled. For a flat blog post? Like, seriously?

I’m glad that the JS world is shifting from SPAs to SSR. Using a SPA for a blog is just bad on multiple levels.

IMO SPA's aren't that bad, but loading large assets from third parties is.

Re: Do we need a web API?

#58
As someone deploying frontend apps for a large site you should not underestimate how long people have their tabs open. I can get sentry error reports for versions that have not been deployed for months.

Does this handle "API" versioning in any real way?

Re: Do we need a web API?

#59
As other have noted, someone caught on to the simplicity of RPC.

It always baffled me how so-called RESTful APIs became popular, despite virtually all of them being RPC APIs with a veneer of rather pointless HTTP semantics.

Virtually none of those APIs do anything to serve the intentions and goals behind REST[1]. Furthermore, many RESTful APIs end up being wrapped into language-specific clients anyway, because they have poor ergonomics in their raw state.

I consider RESTful APIs the most significant anti-pattern not widely recognized as such.

[1] https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc...

Re: Do we need a web API?

#60
post #6

I've used a similar concept about 10 years ago if anyone remembers Wicket[0], and personally really liked it. The challenge was the UI and state were all server side and difficult to keep memory usage down. I'd be interested in how this model works now that client side UI and state are much more capable. [0] https://wicket.apache.org/

I liked it as well. Web development had gotten way harder over the last decade.
Post reply on HN