> Even if you need to preserve client state between page loads (for e.g. music or video playback) you can let the browser do most of the heavy lifting by fetch()ing a new page and replacing your content container at the DOM level. Anyone knows of some easy to learn example of such DOM replacement?
Advice to Young Web Developers
81–90 of 328 posts
Re: Advice to Young Web Developers
#82There are two that stand out to me: > Always validate your data server-side; anything that comes from the client is suspect. At least sanitize in a way that won't break the server but will throw an error. For internal applications and side projects it's ok to just respond with a 40X or a 50X and move on. > To the developer, “isomorphic” code breaks down the barrier between client and server. "Breaks down the barrier"…
Re: Advice to Young Web Developers
#83Re: Advice to Young Web Developers
#84Re: Advice to Young Web Developers
#85Re: Advice to Young Web Developers
#86Earlier quoted context omitted.
The way in which we consume and deliver via internet has moved on from the early days of the web. It's no longer just text, images and links. There's much more to it now, and SPAs are a reasonable step forward to providing richer experiences online with more functionality. Not sure you could ever call them an anti-pattern.
How would the site we’re communicating on right now be improved if it were rebuilt as an SPA?
Re: Advice to Young Web Developers
#87Earlier quoted context omitted.
The way in which we consume and deliver via internet has moved on from the early days of the web. It's no longer just text, images and links. There's much more to it now, and SPAs are a reasonable step forward to providing richer experiences online with more functionality. Not sure you could ever call them an anti-pattern.
> It's no longer just text, images and links. Assuming you add video, 99% of the web is just text,images,links,forms, and video. None of these things even require Javascript.
Or is your opinion that it should only be possible to do those things in native, purpose-built apps? Because in that case, how do you justify using an operating system? Perhaps we should exclusively use purpose-built assembly code that you flash to some writable media every time you want to run a particular program!
Re: Advice to Young Web Developers
#88Earlier quoted context omitted.
You mean the specific experience when back buttons aren't working? Or when urls don't make sense? Or when you can't just share the content by copying the url because it no longer identifies the conten? Or when you can't say if something is loading, missing, or broken? This is my user experience with SPAs regarding navigation.
Use better SPAs.
That doesn't mean good SPAs don't exist - many do!
Re: Advice to Young Web Developers
#89This is my fave:
> Infinite scrolls are inhumane. People need to be able to reach “the end.” There are forms of eternal torment described in religious texts that are less mean.
Re: Advice to Young Web Developers
#90Seems like a list of every web development ideal that gets upvoted on Hacker News. Still, I think the list can pretty much condensed down to one point: Use whatever technology is appropriate for this site or web app. Because a lot of developers seem to have a 'when all you have is a hammer' attitude towards web development. They learn React/Vue/Angular/whatever, then seemingly decide everything they will ever build w…