News for hackers. Stuff that matters.
Re:HTML First – Six principles for building simple, maintain... by pech0rin on Sunday November 12, 2023 @03:35PM (#38243851)
I’m sorry but what? This is terrible advice. I have never understood the desire to keep the web “inclusive”. Is the web not already inclusive? Can someone not already build a website with simple html/css?

The web has evolved and taken the place of desktop apps by and large. That is what SaaS has done. These websites are built to be fully functioning pieces of complex software. Using some tiny tools to markup html is never going to work for these types of applications.

I find this hand wringing over the complexity of the web so strange. Can we all just move on? The web has changed. I have been programming for over 15 years professionally. Yeah its changed. yeah frontend frameworks are a pain in the ass a lot of the time. So lets make it better, not fall backwards to a “simpler” time.

Re:HTML First – Six principles for building simple, maintain... by codeptualize on Sunday November 12, 2023 @03:55PM (#38244001)
This is a very good point. I would also look in different directions for inclusivity.

We now have Framer, Webflow and all the others, you don't have to write any code to make amazing websites.

Re:HTML First – Six principles for building simple, maintain... by tonyennis on Sunday November 12, 2023 @04:01PM (#38244034)
"fully functioning pieces of complex software" - in my experience a majority of software is simply not that complex. And the few places where it is are not on the view layer. To make sure we're not talking past each other, can you give examples of the kinds of software you're talking about? We do quite a lot of react work too, but it's ~20% of the projects we work on, when advanced frontend interactivity is needed.
Re:HTML First – Six principles for building simple, maintain... by codeptualize on Sunday November 12, 2023 @04:15PM (#38244136)
> "Not that complex"

Even if you have a fully static website you generally have a navigation bar and footer that needs to be on multiple pages.

Things don't need to get very complex to benefit from frameworks and tooling.

Re:HTML First – Six principles for building simple, maintain... by zlg_codes on Sunday November 12, 2023 @04:31PM (#38244258)
Are you really advocating for using frameworks as a glorified #include directive? Frameworks are necessary when the job you're doing is highly abstract and you're not totally picky about the result. They shine at those things, but they are overkill for a static website. Something like Pelican or Hugo would be better suited for that. Shit, you could roll your own SSG in a weekend.
Re:HTML First – Six principles for building simple, maintain... by codeptualize on Sunday November 12, 2023 @04:44PM (#38244386)
So pelican and hugo are not frameworks? How is a static site generator any different from statically exporting next.js/nuxt.js or similar?

I've used all the things mentioned, and I quite like the ergonomics of frameworks for static websites. Added benefit is that I can make static sites dynamic if necessary.

And to be clear, these static exports are incredibly fast and performant.

> you could roll your own SSG in a weekend

Sure, I could do that, or I could build my app/website in that weekend..

Re:HTML First – Six principles for building simple, maintain... by zlg_codes on Sunday November 12, 2023 @05:46PM (#38244902)
I can't speak for Hugo but no, Pelican is not a framework. It's a static site generator. I cannot make general purpose, dynamic websites with Pelican. I can fake a few things, I can hook it up to cron to mimic it, but Pelican itself is concerned primarily with your data store, your theme, and generating static files to upload directly to your webspace.

Sure, you can make plugins for Pelican to make it generate things the way you want, but it's still just a generator/builder using Jinja templates and Markdown or some other text transformation tool.

Also, there's no real indicator that I used Pelican to build my site. There's no cruft I'm including in my <head> element or anything else. It outputs regular-ass HTML.

I'm sure it's nice to be able to swap into dynamic web app mode if you decide a project's going differently than expected, but I don't run into that much with the things I design. I usually know from the beginning which tech I'll need to achieve the goal.

Frameworks force the dev into specific ways of doing things, so if a program fits into that architecture, go nuts. I'm curious what you guys need on your sites that require so much JS.

Re:HTML First – Six principles for building simple, maintain... by codeptualize on Sunday November 12, 2023 @06:17PM (#38245134)
And it's totally fine if it works you, I'm not saying one is better, I'm saying both are valid choices and if you statically export from a framework, it's not that different from what you describe.

> Frameworks force the dev into specific ways of doing things

Not really. Take Next.js, you can also use markdown (or more dynamic flavors of markdown like MDX/markdoc), you can use a headless cms, it doesn't really matter..

If you don't like Next.js you can pick a different solution, there are many! If Pelican is your jam, by all means, it's a great tool.

> I'm curious what you guys need on your sites that require so much JS.

In my day to day I work more on web apps, but lets stick to "simple" websites. Example: Using Next.js again, out of the box it does instant navigation by preloading new content on hover, and not doing full refreshes when they aren't needed. Great for the user, less bandwidth used, much faster sites. That's just one example.

Re:HTML First – Six principles for building simple, maintain... by zlg_codes on Sunday November 12, 2023 @06:25PM (#38245193)
> Example: Using Next.js again, out of the box it does instant navigation by preloading new content on hover, and not doing full refreshes when they aren't needed. Great for the user, less bandwidth used, much faster sites. That's just one example.

I don't understand what you mean here. What content is being preloaded, what is being hovered on, why do you need only partial page loads? Is this for a doomscrolling UI where units of content are presented one or a few at a time, on an infinite scroll?

When I do navigation I just build a <ul> and put <li>s in it, programmatically if need be. Click to go where you want. Takes a full page load, but that's just how the Web works because you're going to another page. Links take you to other pages.

Is this for like an image gallery?

Re:HTML First – Six principles for building simple, maintain... by codeptualize on Sunday November 12, 2023 @06:41PM (#38245307)
Could be, but also just page transitions, think a blog, documentation site, often you keep the navigation and just replace the content. If you are curious, it's quite easy to try. The results are really snappy, it's really nice.

But, I'm not trying to convince you. If you are happy with Pelican and it works for you, great.

All I'm pointing out is that we use these things because they do actually solve problems, often make things faster not slower, and allow me to make better websites and apps for my users. From simple websites, to complex applications.

Re:HTML First – Six principles for building simple, maintain... by zlg_codes on Monday November 13, 2023 @02:09AM (#38247755)
I'm not totally averse to trying things, I just often find myself unable to make much use of bespoke tools. It makes me feel uneasy to not have a strong grasp of what's going on under the hood of tools like that. Even Pelican bugs me with its extensible Generator and Renderer classes that still don't totally make sense to me.

There is a project I have in mind to build for a portfolio. An atlas of sorts. Is that something Next.js could make easier?

Re:HTML First – Six principles for building simple, maintain... by codeptualize on Monday November 13, 2023 @02:59AM (#38247999)
Could be! If it has a bunch of interactivity it will probably make your life a lot easier.

Idk if you know js/ts and React, so there might be some learning involved. (You could also check other fe frameworks if React is not your jam, some folks swear by Vue or Svelte.)

About knowing what’s going, I get that. For me I’ve wasted so much time setting up projects with webpack and all the the other stuff that I have a pretty good idea, but also I’m just thankful that I can just focus on my project haha.

Re:HTML First – Six principles for building simple, maintain... by zlg_codes on Sunday November 12, 2023 @04:29PM (#38244248)
I'm sorry, but the majority of the change has been inflicted by for-profit outfits who EEE'd the W3C to get what they wanted. None of us asked for a Javascript-dominated Web where you download megabytes of code before you see the first page.

You make it better by separating concerns or finding better ways to do the same thing.

By this point, QUIC and HTTP should fork instead of QUIC insisting on taking over HTTP.

We can make this space better by pushing out complex "web" applications to their own protocol they can fuck up on their own instead of pushing the system requirements of a browser up every year.