3 ms·
Maybe I’m just full of Ruby on Rails induced trauma, but I can’t remember any particular pleasant memories. Every app would start with a reasonable and straight
by throwaway284534 5y ago
Maybe I’m just full of Ruby on Rails induced trauma, but I can’t remember any particular pleasant memories. Every app would start with a reasonable and straightforward view layer, usually ERB templates sprinkled with jQuery, and then slowly but surely be consumed by one-off JavaScript snippets.
“We need a sortable table on this route and it should support pagination without a reload, but the pagination needs to be persisted to the address bar for outside link sharing.” This feature alone can introduce all kinds of unmanaged state and be a testing nightmare. And if another part of the site uses the same functionality, you’ve just signed up for an lifetime of maintenance, usually somewhere between your server-side templates, and your asset pipeline. God help you if your bugs can be described as, “I have some local state here, but I’m not sure how to get it either up or down to the right place.”
Personally, these kind of code smells demoralize me enough to consider a job elsewhere, preferably at a company that uses something like React where there’s bound to be complexity, but at least there’s component boundaries to keep your mental facilities from being overrun by a “simple multi page architecture.”
- pjc50 5y ago> “We need a sortable table on this route and it should support pagination without a reload, but the pagination needs to be persisted to the address bar for outside link sharing.” How would you do that differently in a SPA? Or would that just preclude the link sharing, removing the requirement altogether? Are SPAs doing client-side pagination or something?
- shadowgovt 5y agoI've seen a variety of solutions used in SPAs, from a thin wrapper around server-side pagination to some extremely fancy client mirroring of server state where the client builds an increasingly larger cache of the data coming from the server, complete with eviction strategies and maximum memory usage limitations, and only has to send a request to server side when it knows it cannot satisfy the client's viewing desires with what it's gathered so far.