Live data from Hacker News

There's never been a better time to build websites

simeongriggs.dev

311–320 of 337 posts

Re: There's never been a better time to build websites

#311

Earlier quoted context omitted.

> it just works. Going to push back on this line specifically, HN has a number of issues. They're not dealbreakers, but they're also not particularly hard to fix with modern HTML. HN has generally kind of bad accessibility/semantics, it's pretty frustrating to use on mobile, and it degrades kind of poorly without Javascript (collapsing thread buttons still appear even though they don't work, also, collapsing thread b…

> Ever really dug into how HN threading works? Everything is a top-level comment, and it inserts transparent images to create the illusion of indentation. It's a wildly out-of-left-field solution... Having worked on an implementation of comment indentation before, I think it's a technical design choice rather than wildly out of left field. From the backend perspective, it's more performant (and simpler from as far as…

I might be misunderstanding what you're referring to. To be clear, I'm not really talking about recursively building anything about the HTML or fetching any additional data about other comments, or storing it in the database as a tree, a flat structure and iterative builds are fine for all of this. I'm talking about, purely off the top of my head, moving away from:

  result = reduce(comments, (result, comment) => {
    return result + build_comment(comment);
  }, '');
to:

  indent_level = 0;
  result = reduce(comments, (result, comment) => {
     missing_lvls = indent_level - comment.indent_level;
     close_str = missing_lvls > 0 ? repeat_str('', missing_lvls) : '';
     indent_level = comment.indent_level;

     return result + close_str + build_comment(comment);
  }, '');
I assume you're right and there's some kind of extra complexity somewhere, but HN isn't just storing the comments with no context other than indentation as far as I can tell. It is maintaining parent-child relationships at least well enough that the buttons to minimize/maximize threads work, so I am not sure what process is being skipped here by shipping flat HTML lists.

I guess I haven't ever read through HN's clientside Javascript, maybe it's calculating how to minimize threads on the fly completely clientside by iterating over the DOM, and maybe that's why the buttons don't work with JS disabled. But.. oof, I wouldn't hold that up as an example of good, simple clientside code if that's the case.

----

But again, I'm not going to argue with your conclusion, I assume there's something I've missed, I assume you're right.

This is still a bad example to use for "see, simple HTML is better". What you're describing is a good example of why it makes sense to say, "see, convoluted table setups that are worse on the client are faster overall than clean, simple output."

Which is not a bad lesson to learn from HN. It's a great lesson, sometimes performance requires us to do hacky things. But it is a very different lesson from where this thread started. You still would never point at that and say, "this is a good example of what HTML should look like", you would say, "these are the kinds of messy sacrifices that might be necessary to maintain a performant backend."

Re: There's never been a better time to build websites

#312

Earlier quoted context omitted.

(Semi) honest question to the commenters below parent, do you all use styluses, or do you just have small fingers, or is there some predictive touch system in the default browser for your devices that isn't present in Firefox? How big are your screens, are you running phablets? Trying to understand how so many people are reaching the conclusion that HN works well on mobile. Maybe 25% of the time I try to upvote or do…

This button clicking issue certainly exists in Android Chrome. It's just that almost every designed-for-mobile website is missing functionality or behaves in unpredictable and terrible ways. Browsing not-designed-for-mobile web sites on mobile and zooming whenever I need to click on something is a big upgrade.

This is an interesting/illuminating comment, and it makes me wonder if some of this might be a personal bubble thing. I feel like I generally tend to have a better experience on mobile than other people describe, but I'm also running mobile adblockers, and more importantly, I also might just not be visiting all of the same sites as other people?

People complain about Reddit on mobile, and I totally agree, Reddit mobile is awful, but it's also a really small part of my life, I generally don't visit Reddit on a phone that often -- so it's easier for me to think about Reddit's mobile site(s) as being some kind of outlier?

My experience has been I read a lot of blogs on my phone, I do searches (that go through duckduckgo, which I don't really have a ton of complaints about as a mobile site), I look up quick pieces of information on the fly from random sites, I look at MDN documentation, trying to think what else...

I also spent a long time turning off Javascript entirely on my phone browser and I've only very recently started changing that practice (largely because of Gorhill deprecating uMatrix), which probably biases things even more, because a lot of the browsing I do on my phone works without Javascript, and that gets rid of a nontrivial number of annoying behaviors from more aggressive sites, and so I wonder if I'm just not giving the same amount of "credit" for HN not doing the Reddit bullcrap where it pops up a notification asking me to install an app, and that makes it easier to stare at the flaws.

If I was doing a lot of Reddit browsing on my phone, I would appreciate HN more on mobile, I will give people that HN is much better on mobile than Reddit.

Re: There's never been a better time to build websites

#313
Remix uses Server Side Rendering (SSR) done at run-time. As any other technology, it has not only advantages but also drawbacks: https://github.com/winwiz1/crisp-react/blob/master/docs/benc...

Tailwind is powerful, consistent and comprehensive but again the advantages come not without a drawback: In order to use it effectively one needs to learn/memorise yet another CSS. I have better things to do and think it's more efficient to use a set of CSS management approaches: https://github.com/winwiz1/crisp-react#css

Again, each approach has its advantages and drawbacks so one can try to minimise the latter and utilise the former. While leveraging the knowledge of only one CSS: W3C CSS.

Re: There's never been a better time to build websites

#314

Earlier quoted context omitted.

> Ever really dug into how HN threading works? Everything is a top-level comment, and it inserts transparent images to create the illusion of indentation. It's a wildly out-of-left-field solution... Having worked on an implementation of comment indentation before, I think it's a technical design choice rather than wildly out of left field. From the backend perspective, it's more performant (and simpler from as far as…

I might be misunderstanding what you're referring to. To be clear, I'm not really talking about recursively building anything about the HTML or fetching any additional data about other comments, or storing it in the database as a tree, a flat structure and iterative builds are fine for all of this. I'm talking about, purely off the top of my head, moving away from: result = reduce(comments, (result, comment) => { ret…

> maybe it's calculating how to minimize threads on the fly completely clientside by iterating over the DOM, and maybe that's why the buttons don't work with JS disabled

Holy crud, I just opened the JS up and this is actually what it's doing. Heck me and my little 'not going to contradict you' statements, you might just be completely entirely right about what's going on I guess.

  function kidvis (tr, hide) {
    var n0 = ind(tr), n = ind(kid1(tr)), coll = false;
    if (n > n0) {
      while (tr = kid1(tr)) {
        if (ind(tr) 
I'm still going to reassert that any architecture that leads to someone doing this kind of logic every time a button is pressed is neither simple nor elegant, and at best this is an example of making architectural sacrifices and introducing complexity for the sake of performance; there's no way that this kind of page logic is easier to maintain or to understand than something built around a more semantic structure.

It's also definitely not easier on the client, I've seen some comments on here argue that HN might use all this weird stuff to save client battery life, and I feel more confident now saying that's not the reason, because if someone is somehow, someway legitimately in some incredible situation where they're actually worried about the battery drain of a browser rendering a table vs a some extra CSS, then this is not the code you would want to run every single time you press a button on the page.

But yeah, the "we just base everything off of an indentation integer and comment order" theory does seem a lot more plausible to me now, because I'm having a somewhat difficult time thinking why else collapsing comments would work this way.

Re: There's never been a better time to build websites

#315
post #306

Earlier quoted context omitted.

If you're trying to figure out CORS errors, it means you're either loading fonts or making XMLHttpRequests across domains. Neither of those were available in the 90s era OP is rhapsodizing about. You don't have to use the additional features/complexity of the past 15–20 years… but if you do , it's not surprising that things get a little more complex!

You actually do have to use HTTPS nowadays, and that's a non-trivial amount of complexity compared to just serving up a static page over HTTP.

Eh, most static site hosting provider offer it out of the box nowadays

Re: There's never been a better time to build websites

#316
post #278

Earlier quoted context omitted.

I am positively confident that I could teach a bunch of art students (so definitively non tech people) how to create their basic website only using html and css (without any framework/library etc) in 2 to 3 days including the domain and hosting part.

Weird flex, but okay.

What I wanted to hint at with this was, that good old HTML and CSS is both enough and probably trivially simple to get started with for the HN crowd if they don't know how to use it yet. A lot of simple websites don't need more than that. And if you sprinkle a bit of js on top you can also dig into the land of not so simple websites.

Re: There's never been a better time to build websites

#317
post #231

Earlier quoted context omitted.

Welcome to CORS errors, so sorry you made the trip. :) CORS will eventually click for you and then it will always make sense. Until then, sorry you’re going through the muck.

I honestly feel like CORS was invented just to get people to use reverse proxies more.

CORS enables site operators to prevent third-party sites from offloading requests for them onto clients, and conveniently reduces XSS exposure as a side-effect.

Re: There's never been a better time to build websites

#318

Earlier quoted context omitted.

The problem is that expectations changed, so now you're "required" to do more in certain contexts. I absolutely loath frontend developments in companies with more than 5 engineers. In the past you may have found some spaghetti code and various abuses of jQuery but you could probably grasp the codebase in an afternoon. Nowadays every mid company codebase is a spaceship. For sure, you'll find a pseudo technical VP of e…

> In the past you may have found some spaghetti code and various abuses of jQuery but you could probably grasp the codebase in an afternoon. My first job out of college involved a Rails codebase littered with conditionally rendered jQuery snippets. It was a nightmare to figure out what code was even loaded on any given page. Give me a modern JS codebase over that any day.

Yeah, as someone who started out in JS with procedural jQuery, moved onto prototype overloading shenanigans with classes, and now React with functional components - the JS ecosystem and tooling is still a huge mess, but I wouldn't want to go back to jQuery or prototype class hacks. At least a modern React codebase has a whiff of engineering to it. No matter how carefully we did stuff the old way at the companies I worked for, it sooner or later became an unmaintainable mess of hacks and overrides.

Re: There's never been a better time to build websites

#319

The technology is far more advanced and bordering on magical in some cases, but most front-end web-development is far more painful and less fun to me than it once was. Say about 15 years ago or so, if you had a creative inspiration for a personal site, you could whip out a text editor and start building top-notch stuff very easily. About the most complicated thing you had to do to start building something was adding…

> Today you have to research a pile of unnecessarily complicated (for most personal projects) frontend frameworks, libraries, and build systems, figure out the compiling and development environments, figure out a complex mess of containers and virtualization, etc, etc, etc.

Well yeah, but once you've learned the modern paradigms, you can get right back into hacking away in your text editor. I've been doing web development stuff for longer than 15 years or so, and it's no more difficult to start a project now than it was back then. I can run a single command to create a template nextjs project and be hacking away in no time at all. Yeah there's a learning curve initially, and for certain use cases you may not want or need these modern tools, but it's no different than when all that time ago I finally, after much foot-dragging and moaning, I finally learned CSS and transitioned away from "tables for everything" HTML I'd learned on Geocities, which seemed like the pinnacle of productivity at the time.

Re: There's never been a better time to build websites

#320

Earlier quoted context omitted.

> I like writing code, not plumbing together bits of other people's code with bizarre config files I don't like reinventing the wheel every time I build something

> I don't like reinventing the wheel every time I build something This is the crux of the difference, I think. I see open-source libraries as (mostly) mediocre code, usually massively bloated with features I don't need. Using them is like using an 18-wheeler to nip to the shops. I have found in my experience that it saves time in the long run to just write the minimal amount of code I need for the job, rather than de…

I think that's an over generalisation, for every "world changing, do everything" trendy OSS library there's also a much simpler alternative maintained by a fellow grognard who just wants to write the bare minimum so you don't have to.

The alternative is adding my own mediocre code, with all the maintenance costs that incurs.

Post reply on HN