• hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 days ago

    JavaScript is adequate for doing everything, but should be used sparingly.

    I feel like if your web page is mostly dependent on the speed of your chosen framework, it’s probably not doing anything complicated enough to warrant a framework in the first place. In that case, JavaScript becomes unnecessary fluff.

    My email service is mainly bottlenecked by the speed of my Postgres queries, so optimizing them is much more important and impactful. Good database and query design is a must.

    Just look at Gmail. Their frontend is slow as hell, but their backend is lightning fast, and nobody really complains. Once you’re past that first couple seconds of a loading bar, you care a lot more about how quickly the next interaction takes, and the next, and the next. I believe page load times for a dynamic page don’t matter as much as the industry thinks they do.

    That being said, there’s obviously an upper limit. Five seconds to even get the HTML would be really pushing it.

    I’ve written tons of simple pages that just use plain old JS too. It’s surprisingly easy to not use a framework these days. Here’s one of my favorites, that lets you perform WebDAV functions all with plain JS:

    https://github.com/sciactive/nephele/blob/master/packages/plugin-index/src/IndexPage.svelte

    (It’s rendered on the server side with Svelte into plain HTML, and all the JS in the <script> tag at the top there is plain JS that runs in the browser.)