I think for a simple website, especially one with spartenweb or zero JS principles, a language with an architecture like PHP or ASP/ASPX fits well, where you just write HTML and server side code in the same file, and you navigate to that file from your URL to load it. For example, wwwroot/path/to/page.php on the server corresponds to https://example.com/path/to/page.php

Problem is, both PHP and ASP are pretty terrible languages, and ASP(X) has the additional dealbreaker of not being open source and only running on Windows servers, so I don’t really want to use any of them (I’ve tried all three), so are there any better web languages or web frameworks that does something similar?

  • @electrodynamica@mander.xyz
    link
    fedilink
    32 years ago

    What’s interesting is that even though code is mixed with html by design in PHP, ultimately a lot of frameworks tend to create a whole other layer of templates, complete with pseudocode like loops and conditionals. If you’re going to do that, you might as well just do CGI methinks.

    Mixing code and page layout isn’t the solution it appears to be. Another fun approach is to use sophisticated XSL templates to generate the HTML from XML data, and CSS to style it.