Live data from Hacker News

HTML First

html-first.com

481–490 of 551 posts

Re: HTML First

#481

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…

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.

This is not only about big projects.

Their second principle, to use inline styling, makes it harder to create a consistent look across the entire website. Defining that in one place and referencing it everywhere is better and easier.

Re: HTML First

#482
post #452

Earlier quoted context omitted.

> a booking process with various entry points on the website, which slightly change the booking logic. Also you can book as a new user, as a logged in user, for somebody else etc. Also the logic is changing at regular intervals The more complex the business logic, and the more options there are, and the more it is expected to change, the more it benefits the development team to write that code in their language of ch…

> the more it benefits the development team to write that code in their language of choice on the backend Why? TS is maintainable and very pleasant to code in. Most people’s computers are way faster than making round trips to a server. You talk about serializing everything to/from JSON, but my phone can do that in milliseconds (if not faster). Compare that to 100-200ms of latency between a faraway server, and all of…

> Why?

A tangential answer (focusing on backend not language) is because I'm (we're) going to have to reproduce much of the fronted complexity of the business logic on the backend to validate what the frontend sends.

I'm mostly agreeing with you. I've built multiple web-platformed insurance systems and booking systems in the last decade and moved from fully server rendered pages to client rendered forms. The complexity increased with that change but as you highlight once it's done the ability to test different frontend flows is great.

But I'd like a way to share more of the business logic rather than writing it twice.

Re: HTML First

#483

Earlier quoted context omitted.

It’s hard for me not to see Tailwind as using the class attribute to reproduce the style attribute - burying your html tags under a pile of css classes doesn’t feel that much different than defining those styles inline.

The styles are already coupled to the component anyway, so what's your problem with putting them in the markup? The alternative is making up arbitrary class names and putting the styles in a separate file: now you've added an extra layer of mapping that the developer after you has to grok.

People don’t seem to mind the 7 layers of mapping between their markup and HTML, why are styles different? I find that much more of a problem when it comes to understanding what’s happening for the average dev.

Re: HTML First

#484

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…

I tried to push for an "HTML first" style frontend at my job, but we hired some run-of-the-mill frontend devs and they basically didn't get it and just wanted everything to be divs with VueJS controlling all of the logic and content. One semi-objective thing we lost was accessibility. Much of the site is impossible to navigate via keyboard due to naively re-implemented behavior like links being divs with click event…

This article had as a “good” example a div with an onclick, I think he fixed it, but it shows a lot..

Frameworks also have linters that will help a lot, it’s on you to use them

Re: HTML First

#485

Earlier quoted context omitted.

That's cute, now show me someone who's made something modern and usable with that tech. I used XSLT and XML to build a video game collection tracker. Just a page that could display things. It was a nightmare. I later spent a weekend building it in Python, added "export to JSON" and then made a tiny SPA with vanilla JS to do the job. It's very powerful and can do some neat things, but it's taught poorly and not easy t…

I'm not sure what you mean with it being a nightmare. It's my go-to for personal stuff. Most recently I used it to make a template for my photo albums. For personal stuff it works fantastically because it's easy to just use a simple text editor for everything with zero other tools required. It's out of fashion these days, sure, but you could easily make e.g. a forum or a news site or a blog or a facebook type of thin…

In my case, I needed to put together table headings that were clickable that would sort the dataset. XSLT can do that, but midway through doing the task, I realized that I was working with stuff that belonged in a database, accessible from more places via SQLite. Since I needed a multitude of different ways to sort and filter the data set, I made use of VIEWs to abstract the filtering and turned it into a CLI tool.

There's still an appreciation in me for XML (specifically SVG), so maybe I'll try something else with the tech. Care to share a link or example to more of what you're talking about?

Re: HTML First

#486
post #326

Earlier quoted context omitted.

"shift/control-clicking to get multiple things is a flat no-go from a UX perspective" - Do you mean that this is NOT how you should do multiselects? If that is what you mean, then how _do_ you do them? If I have a list of items and I want to select 10 or 15 of them in a row, I currently don't know of a better UI to do that with than shift+click.

Most normal users (aka if you read Hacker News, you're not one of those) don't and won't know about shift and control clicking. A more UX-friendly alternative is to have checkboxes; you can still have shift/control-clicking on top of that (for selecting many things quickly), but it shouldn't be the only option.

HTML has had checkboxes since at least version 2 (1995), so just use those if you want to do multi-select using checkboxes. I don't think you can do shift-clicking to select ranges though (without resorting to js) but control-click is of course redundant as that is just the default behavior for a list of checkboxes.

Re: HTML First

#487

Earlier quoted context omitted.

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…

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 somet…

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

#488

Earlier quoted context omitted.

What literature exists on UI and UX that isn't condescending or clueless in tone? Interfaces are as unique as humans are. There's a reason we have emacs, vim, and Notepad.

Refactoring UI fits those constraints. While it's by the creators of tailwind, it doesn't make assumptions about the css you use to achieve your desired UI. https://www.refactoringui.com/

Thanks for giving me something interesting to consider! This looks like an earnest product that could help me at least understand where others are coming from on design, and could probably add flavor to my own UI focus (gamedev).

I don't often have a positive reaction to something like this, will definitely revisit it when I have the spare cash.

Re: HTML First

#489
post #452

Earlier quoted context omitted.

> the more it benefits the development team to write that code in their language of choice on the backend Why? TS is maintainable and very pleasant to code in. Most people’s computers are way faster than making round trips to a server. You talk about serializing everything to/from JSON, but my phone can do that in milliseconds (if not faster). Compare that to 100-200ms of latency between a faraway server, and all of…

> Compare that to 100-200ms of latency between a faraway server A complex booking engine like an airline or Stubhub needs constant, almost real-time connectivity with a database, otherwise you risk selling product at a stale price, double-selling, selling to an unauthenticated person, getting taxes and fees wrong, missing custom post-sale add-on opportunities, and lots of other potential problems. The client has to m…

How are you going to do the updates without FE logic? Refresh the page constantly?

The client being able to fetch just updates is a lot more efficient. If you open a web socket the server can even push.

You make a great point why we use client side solutions.

Re: HTML First

#490
post #301

Earlier quoted context omitted.

Are people really struggling at that level, though? It has never been easier to write a complex page with minimal Javascript - there are more and more HTML elements that do what you expect (expandos and modals as some recent examples), Javascript is cleaner and more consistent across browsers (you really don't need jQuery anymore), and CSS is more powerful but also so much simpler (flex+grid solve so many problems).…

Find a professional front-end developer who is willing to use simple HTML, JS & CSS and I'd agree with you. It's almost impossible. The first reaction is always `npm init`

> Find a professional front-end developer who is willing to use simple HTML, JS & CSS and I'd agree with you.

> It's almost impossible. The first reaction is always `npm init`

Consider a simple case — a static website containing several pages (it's simpler than anything requiring a dynamic server, right?). If you are a professional front-end developer, you are almost certain to prefer some kind of a static-site generator over copy-pasting the html template with repeated elements (header, footer, navigation) multiple times, because you know that copy-pasting will bite you when you need to change something. You could use a static-site generator written in Ruby (but then you would gem install), or in Python (but then you would pip install); or you could use a Hugo binary (I'd love to see anyone call its templating language simple); or, if you are a front-end developer, you might npm init && npm install eleventy. Is this too complex a step?

Post reply on HN