No-one would accept such a shoddy design in an OS, yet in today's web apps it is apparently standard practice...
No-one would accept such a shoddy design in an OS, yet in today's web apps it is apparently standard practice...
It has been proposed a number of times to put it all behind an API. I do not know if this has been finished yet. I remember an epic diff comment thread which only ended after the author defended her solution with a mathematical proof of correctness.
Can you share anything more about this anecdote? I feel like there's a really interesting story there.
https://www.reddit.com/r/IAmA/comments/1ydy0w/i_am_raylene_y...
That said, Facebook should have addressed this problem seriously by now.
Maybe it was too limiting (slow dev) to have change two things anytime they needed different data? Or perhaps at one point there were performance concerns?
The consequences are potentially far worse at facebook scale of course, but it's not like we as software developers generally have gone from understanding how to easily prevent these problems to an amnesiac state where we're suddenly careless.
At least they're not a bank.
So if you have an URL like /{username}/year/{year}/profile_lists you would in a declarative style, say that "username" must match an existing Facebook user ID, and that the page viewer must be able to view certain privacy related settings of the username. When your code runs, you get the current user, the username from the URL is mapped to another user object, year is mapped to an integer etc.
It's an error to declare an API which needs access to a resource without saying what type of access is required. In Facebook's case maybe I'd go one step further and create a proxy object for the user that codifies those rules. So if you ask for "view profile friend stats" access, and it's granted, the user object your function gets cannot start modifying things.