5 ms·
I'm not sure stateful vs stateless is even the right way to frame it. With no JavaScript at all, your application is still stateful. Even if an individual HTTP
by rpeden 8y ago
I'm not sure stateful vs stateless is even the right way to frame it.
With no JavaScript at all, your application is still stateful. Even if an individual HTTP request is stateless, your app as a whole still has state. The state just lives in the database in that case, and each request you make either gives you a view of part or all of its current state or provides data to transition the application from one valid state to another valid state.
Actually, thinking of an application as a series of transitions between valid states is why I enjoy using things like Redux. Used properly, it acts as a gatekeeper that makes it hard to move the application from a valid state to an invalid one. It adds a fair amount of boilerplate, though, which I know some people find frustrating.
Maintaining state on the front end and keeping it in sync with the back end is a pain. But I don't think it has to be. it's just an artifact of us being stuck in a certain paradigm of application development that we don't seem to be able to get out of.
It wouldn't be impossible to design a system that runs over a network, but doesn't require the front-line application developer to think about the network. It sounds like something Alan Kay might have worked on at some point. :)
I envision a Smalltalk-ish environment where, in my application running in a browser, I send a message to an object telling it to save itself. And when it receives this message, it transmits itself across the network, validates its data, and persists itself into a database. Maybe an object database like Gemstone/S. But the application developer wouldn't have to worry about all the details most of the time. Just tell the object to save itself, and it'll report back whether it was able to or not, so you can update the application accordingly.
I'm sure I'm overlooking a ton of potential pitfalls, of course. I think we can do a lot better than we're doing right now, but I'm not 100% certain what better looks like, or quite how to get there. Maybe I just need to watch a few Bret Victor talks for inspiration and then get to work trying to build something. :)
- jrochkind1 8y ago> I envision a Smalltalk-ish environment where, in my application running in a browser, I send a message to an object telling it to save itself. It sounds to me like "what if Javascript had SOAP", heh. We can envision lots of things. The beauty of software engineering/architecture is you can envision almost anything. The trick is that the more complex the thing is, the harder it is to pull of _well_, and the easier it is to end up with a monster. The complicated things take more expertise/skill/experience to design, and _also_ take more development time to produce -- and on an ongoing basis to maintain. And it's not always clear where development resources come from on 'shared commons' like platforms (unless they are proprietary and only available for a fee). The current front-end JS environment is already _pretty darn complex_ of course. How well it's pulling it off, well, is a matter of debate central to the OP. On, and then there's getting different actors to coordinate in thing that require that (like browser's supporting something). I can envision it too. But I wouldn't wager much on it happening in a way that actually results in an improved development environment (instead of a monster).
- rpeden 8y agoUsing SOAP from JS is doable if you really want to. :) But if we're comparing to crufty tech, I'd say what I was talking about in that sentence was more like DCOM or CORBA. Both of which were nice in concept but a bit of a PITA in practice.
- jrochkind1 8y agoThanks, you're right, that's what I meant. I have thankfully forgotten most of what I ever knew about these technologies.
- scroot 8y agoCheck out Lively4 [1] and see what you think. It's the fourth incarnation of dan ingalls' LivelyWeb concept. [1] https://lively-kernel.org/lively4/lively4-core/start.html https://lively-kernel.org/lively4/lively4-core/start.html [2] https://github.com/LivelyKernel/lively4-core https://github.com/LivelyKernel/lively4-core
- icebraining 8y agohttps://pouchdb.com/ https://pouchdb.com/ works more or less like that. You just save objects, and then it'll report back when it's synced with the server.