GCC 10.1 Released
GCC 10.1 Released
Posted May 11, 2020 2:35 UTC (Mon) by NYKevin (subscriber, #129325)In reply to: GCC 10.1 Released by mathstuf
Parent article: GCC 10.1 Released
Aside: This is poor practice. You should serve a basic HTML page that works in any reasonable* browser, and then use JavaScript to progressively enable functionality that the current browser actually supports. That JavaScript should call into the server (if necessary) and pass information about the client (if necessary). At no point should the server be in a position of trying to guess a browser's capabilities based on HTTP headers alone, unless the client is not a browser and therefore not capable of executing JavaScript (at which point you are well off the beaten track and "best practices" are no longer a thing).
This does mean that users with JavaScript disabled will get a less functional website than would otherwise be possible to provide (for example, it might lack modern CSS functionality and look uglier than strictly necessary). But those differences should be mostly presentational, and should not interfere with the core functionality of the website (unless you hate your users).
* For whatever definition of "reasonable" your market research has led you to use. In practice, this is usually "Chrome plus some other ones," but whether that list includes IE, Opera, etc. may vary. A corporate intranet site has very different needs from google.com.
Posted May 11, 2020 6:38 UTC (Mon)
by flussence (guest, #85566)
[Link] (1 responses)
There seems to be a gradual movement in web development back to inert content, following a collective realisation that doing everything in Javascript is a horrendous idea for performance, security and durability.
Posted May 11, 2020 9:14 UTC (Mon)
by oldtomas (guest, #72579)
[Link]
I was under the impression that only a disruptive (possibly "external") event could derail this horror train. It just meshes too well with surveillance capitalism (and even worse "surveillance" things, with some perverse common interests).
So thanks for shining some light of hope into an otherwise gray day :-)
Posted May 11, 2020 14:38 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
I was more thinking about deciding to use whatever experimental HTTP headers browsers support these days more than serving up different code based on the user agent.
Probably should have said "HTTP servers are" rather than "server-side-only is".
GCC 10.1 Released
GCC 10.1 Released
GCC 10.1 Released