Live data from Hacker News

No longer writing my own damn HTML

claytonwramsey.com

91–98 of 98 posts

Re: No longer writing my own damn HTML

#91
post #62

Earlier quoted context omitted.

The argument is not to never use JS. The argument is that you shouldn't unnecessarily use JS in a way that breaks core functionality if it is disabled. There is no actual need solved by using client side include to load a nav bar. Doing so will break navigation on your blog for people without Javascript enabled. Even though it isn't talked about as much these days, progressive enhancement is still a really good idea.

> There is no actual need solved by using client side include to load a nav bar. I disagree: this[1] was such a dealbreaker that it caused the developer to literally switch stacks to get back the same feature. When you find yourself switching stacks to get some feature, trust me, it's really needed . > Even though it isn't talked about as much these days, progressive enhancement is still a really good idea. Sure, and…

> this was such a dealbreaker that it caused the developer to literally switch stacks to get back the same feature.

Client side includes would have solved a small part of the pain points that were listed in the article.

This is a developer who explicitly didn't want to add javascript. Compromising a design goal, especially for a hobby project, to only partially solve your pain points, doesn't seem like a good trade off.

> Once again, I am going to point out that plain HTML+CSS+JS is conformant to the relevant specifications; when a user wants to to, for whatever reason, deviate from the specification

Disabling javacript is not a deviation from any specification.

> But you responses throughout this thread is working on the assumption that megabytes of JS is required if you want client-side includes, and you coupled that with an implication that only incompetent developers would go that route.

I never said either of those those things. I said "lazy" and I never implied anything about the size of javascript required for client side includes.

I never used "SPA" in my response to you I used it in response to this:

>> Personally I think it's better to distribute the workload across clients. We'll probably see purely client driven UI's dominate the future.

This is not advocating for thin client side include. This is arguing for a world where everything is an SPA.

> If you think that the only options are a) Doing a full SPA with megabytes of JS, or b) No Javascript whatsoever, then I think that you're in no position to be calling other developers incompetent or lazy.

Not only did I never say such a thing, but it is pretty darn clear that I don't hold such a view since you quoted me in your comment as advocating for progressive enhancement, which generally isn't a SPA but uses some javascript.

You should take a breath and try reading things more than once. You've repeatedly put words in my mouth and done so with some oddly aggressive language

Re: No longer writing my own damn HTML

#92
post #62

Earlier quoted context omitted.

> However, I didn't like the idea of making the client side do work to make up for my own poorly-managed website. If you set the bar to "0% JS at all costs " then you can't very well complain about how hard it was to maintain HTML. Part of the standards, whether we like it or not, is JS. A sprinkling of JS (say, 60 lines?) to do client-side includes does not in any noticeable way increase the workload of the client,…

The argument is not to never use JS. The argument is that you shouldn't unnecessarily use JS in a way that breaks core functionality if it is disabled. There is no actual need solved by using client side include to load a nav bar. Doing so will break navigation on your blog for people without Javascript enabled. Even though it isn't talked about as much these days, progressive enhancement is still a really good idea.

There is no actual need solved by using client side include to load a nav bar.

i am maintaining a site by hand right now. i am fine with copying from a template to get the structure. styles and formatting should be CSS anyways. navigation is the only thing that is a problem. i'll either figure out if i can do navigation in CSS or i'll end up having to use javascript. client side include in html only is the very thing missing here.

Re: No longer writing my own damn HTML

#93
post #62

Earlier quoted context omitted.

The argument is not to never use JS. The argument is that you shouldn't unnecessarily use JS in a way that breaks core functionality if it is disabled. There is no actual need solved by using client side include to load a nav bar. Doing so will break navigation on your blog for people without Javascript enabled. Even though it isn't talked about as much these days, progressive enhancement is still a really good idea.

> There is no actual need solved by using client side include to load a nav bar. I disagree: this[1] was such a dealbreaker that it caused the developer to literally switch stacks to get back the same feature. When you find yourself switching stacks to get some feature, trust me, it's really needed . > Even though it isn't talked about as much these days, progressive enhancement is still a really good idea. Sure, and…

looks like you forgot to include the [1]link.

Re: No longer writing my own damn HTML

#94

Earlier quoted context omitted.

how else can I have a fullscreen overlay navigation on a phone from an accessible toggle button? almost forgot to answer the question: because I don't know any better

One (unusual) approach I like because of the simplicity is to put all your navigation links in your footer, and the hamburger/menu button in the header is just an anchor link that scrolls down to your footer. Unfortunately, accessible HTML solutions for well established UI patterns like menus and tooltips are still far too difficult to get right (anything that requires JavaScript usually).

Nice, and I agree - maybe… the desktop version gets a nav and on the phone it’s all one elder scroll. With section links if it gets too long. … but still need the entry point for lang versions

Re: No longer writing my own damn HTML

#95
> As a workaround, I shipped Highlight.js with all my blog articles, which I never really liked. My site was static, so why should I force users to do rendering work on their machines?

Doesn’t the client have to do rendering work regardless or whether the HTML is served server-side or client-side?

Re: No longer writing my own damn HTML

#96

Earlier quoted context omitted.

It's funny. Further up in this discussion is someone sharing their demo of using XSLT to dynamically assemble a page from parts. This process properly caches the fragments as well. No JS required, just the default rendering process for the browser. But XML+XSLT is the "red-headed stepchild" that everyone seems to hate. Writing a SPA just to recreate the built-in functionality of rendering a static page on the client…

Your take is getting more and more uncharitable. In what world is 60 lines of JS an SPA? Come on, enquiring minds want to know. Show us all this SPA you know off that is 60 lines or less.

So, I think perhaps you are confusing me with the person further up in the thread. They said "don't use a SPA". You replied with a counter argument about JS. Then *I* pointed out someone else in the thread demonstrating using XML+XSLT to to client-side rendering and I called out people using SPAs to dynamically render what is essentially a static website. So "Your take is getting more and more uncharitable" seem to assume that the GP and myself are the same, and we are not.

Your last line seems overly aggressive and confrontational. I have zero desire to engage with that.

All that being said, have a wonderful day.

Re: No longer writing my own damn HTML

#97

Earlier quoted context omitted.

It's funny. Further up in this discussion is someone sharing their demo of using XSLT to dynamically assemble a page from parts. This process properly caches the fragments as well. No JS required, just the default rendering process for the browser. But XML+XSLT is the "red-headed stepchild" that everyone seems to hate. Writing a SPA just to recreate the built-in functionality of rendering a static page on the client…

> XML+XSLT is the "red-headed stepchild" that everyone seems to hate One look at XSLT syntax and you learn why.

I mean, I've used XSLT plenty in my career and I honesty don't have any issues with it at a high level. It's essentially just another templating format with the added benefit of being a markup language itself and being rendered directly by browsers without adding any JS.

Re: No longer writing my own damn HTML

#98
post #18

Earlier quoted context omitted.

Hmm - what is the actual cost incurred by the users here? Mostly battery right? Is that not virtually inconsequential to each individual? I mean you could sum it all up and compare it to human-hours or something but that's not a useful metric because it's distributed. Personally I think it's better to distribute the workload across clients. We'll probably see purely client driven UI's dominate the future. Imagine use…

Please, no. Don't use a SPA to render a blog, that's awful. Browers already give users near complete ability to customize how web pages are displayed and SPAs usually make this worse not better. The actual cost is forcing users to run javascript, with all its privacy leaks and security issues, to view what should be a static HTML document. Not to mention the issues you create for battery life, network traffic, cachin…

You need to quantify before you say it's an issue. Eg. if the battery cost is 0.001% vs 0.0011% it's not actually an issue, despite technically being more expensive.
Post reply on HN