Live data from Hacker News

HTML First

html-first.com

161–170 of 551 posts

Re: HTML First

#161

The main feature that introduces the need of a build step is having a template engine in order to reuse blocks of code, like footer, header, menu, etc.. I think Dreamweaver MX introduced something like template files, and it would make a "build" step that would copy the files from template to actual html files. Then it started to get complex, with data sources and generating pages in the backend. (php, asp, cold fusi…

Browsers have had built-in templating engines (xslt) for decades.

Re: HTML First

#162

Earlier quoted context omitted.

I made an atomic CSS library that doesn't need a build step, if anyone wants one (spoiler, nobody does): https://casscss.github.io/cass/

Imho, bullet points on the border box seems weird to me ( https://ibb.co/d0sDsQ2 ).

Thanks for the note! The left padding and margin situation on the ul is the bane of my existence.

Re: HTML First

#163
If you're creating a web page, use HTML. If you're creating an application interface, use a UI framework like React.

Don't use React for web pages, don't use plain HTML for application interfaces. But don't pretend that web pages and application interfaces are the same thing just because they both use the browser, or because "the application runs on the web".

Re: HTML First

#164
post #8

Earlier quoted context omitted.

Isn't it much easier to know you're going to use React (or Svelte or Vue or anything else) and just start there? Starting a build in HTML-first only to bolt on a JS framework after the fact seems like a lot of wasted effort.

It might be easier to staff for. But developing a React frontend takes way more time than just server rendering HTML and layering in JS for the vast majority of use cases.

that's just speculation. I can say also anecdotally from my experience, developing a react frontend takes way less time.

Re: HTML First

#165
post #144

In theory these principles are really good concepts from an education standpoint. Where I teach, we teach students vanilla javascript and HTML as much as possible before moving on to frameworks that make things easier. Some of these points I'm a bit confused on... is the point behind "Where possible, maintain the right-click-view-source affordance" supposed to be to make the learning barrier lower? While I understand…

Have you used HTMX? I am yet to find a reason for using frameworks like React instead of HTMX.

I have used HTMX with Flask and Jinja. It makes the process much simpler to do the frontend development as a backend developer. But I can see its limitations. It's not suitable for anything bigger than a hobby project. Also, it doesn't help with keeping the frontend and the api totally separate. You have to return the html object from API which has its own set of problems.

Re: HTML First

#166
What's the opinion on re-introducing HTML attributes for style properties, eg. (possibly with additional enumerated attributes usable in short value-only syntax as in ) rather than ? I mean, introducing a secondary syntax for item-values, like CSS did, quite never made sense to me personally even though it was nevertheless thoroughly defended ([1]). I guess it doesn't make sense to me coming from an SGML background which had style sheets capable of stateful/automaton-based assignment of attributes for ages. But now with tailwind so popular and little more than inline styling with sane defaults perhaps, and this manifesto expressing a strong preference for markup attributes, isn't it time to come to the realization that, whatever point CSS had when it was new, surely is driven ad absurdum by its obscene syntax proliferation and extreme redundancy (something even W3C CSS WG's chairman/staff contact already was warning against over ten years ago [2])?

Personally, I don't care for web "apps", seeing the unique value of HTML rather as authoring format for web "docs". For mere apps where JavaScript is obligatory anyway, I think I'd actually prefer CSS-in-JS.

[1]: https://wiumlie.no/2006/phd/css.pdf

[2]: https://www.w3.org/People/Bos/CSS-variables

Re: HTML First

#167
post #160

Earlier quoted context omitted.

Why? Why does it need to be good for big projects in order to be good practice? I’m genuinely asking. I never understood this argument that people bring. In my view, the web is 95% small to medium projects. Most technologies should be focused on that - simple solutions for simple projectS. Add complexity later.

Because in practice there is little value in making easier things easier. While 95% on the web are small projects, 95% of work is done on large projects. Many developers also dislike using many different frameworks, because that would require more learning. If you have to choose one technology it's better to use one where you can do everything. Not one where you can do 95% really fast, but 5% not at all. I personally…

This. Even for basic websites you benefit from some form of templating/components for example to get the nav & footer on each page.

Re: HTML First

#168

This is fun in to theory and in simple examples, but show me a big project that applies this and how it made a difference. There are some bold objectives at the start that would be wonderful, but I’m a bit disappointed by the advice. I really don’t see how these would work in anything other than very basic scenarios, even less how they would achieve the objectives. I’m all for using the web platform to the max, and I…

Agree.

I've created my first website in 1999 with plain HTML, CSS, vanilla JS, hosted on Geocities.

Since then I've been using PHP/WordPress/Yii/Laravel, Ruby/Rails/Sinatra/Jekyll, React/Typescript, ClojureScript to create both sites and apps.

With React / TSX components / CSS-in-TS / Effects / Context I'm home. Finally a fully fledged programming language for the web / front-end. A language made explicitly for the front-end, built om modern principles like functional, reactive programming.

Now I can do software development. Before that, with HTML, CSS, plain JS, PHP it was ... just hacking, nothing else. (Rails was good for full-stack, was not shining on the front-end)

I'll skip frameworks when the web stack will be ready for the apps, too. Now it's (perhaps) good enough for sites, I should admit.

Re: HTML First

#169
The majority of web pages fall into one of two categories: long-form content where the primary interaction is reading, and applications (consoles, editors, tools). I do not think the latter benefits from an HTML-first approach as outlined in the featured article.

Re: HTML First

#170
It seems the author was trying to apply KISS to web sites here, but being unnecessarily dogmatic they added additional complexity over mundate aspects such as whether you call your CSS /dist/output.css or /styles.css. This is completely irrelevant.

HTML is a presentation layer, as such it's 99% the output of some other layer. HTML first therefore is the wrong mindset.

You can't have an HTML first CMS for example, that's a recipe for spaghetti disaster. You need to define clear, constrained models that then you can adapt for given media.

I feel almost weird arguing with this site, because in general I also prefer simple HTML where possible, and I can't stand overdesigned JS-generated framework monsters.

But going from one extreme to another is not smart. No simple rule is a substitute for "intelligence first", and intelligence has lots of subtle rules and relies on rich context to make the right decisions for that context.

Nice domain name though.

Post reply on HN