Live data from Hacker News

If Not SPAs, What?

macwright.com

431–440 of 456 posts

Re: If Not SPAs, What?

#431
post #344

Earlier quoted context omitted.

> My experience is that LiveView is fine for all but the last use case. >> I wouldn't want to impose a 50-500ms+ delay on someone to show a menu drop down or a tooltip or most of the other things listed out. It's basically a UX standard that a tooltip only shows up after a few seconds, so that strikes me as a particularly bad example. That said, sure, if instant tooltips are important, a tiny bit of js and a specific…

If you preload, where does LV introduce latency in that tab example?

The click would be sent as an event to the server, where the state is changed (setting "active_tab" or something like that). Then the view would be re-rendered (probably only changing a few class names) and the diff sent back down to the client.

Re: If Not SPAs, What?

#432
post #396

Earlier quoted context omitted.

Agreed, but to be fair I suspect a polyglot programmer will still choose many other languages, outside of Java, over JavaScript.

You said, "I don't know any polyglot programmers who would consider javascript better than at least one of the other languages they use, and would [not] ditch js for those if they had the option." Now you do.

Ha, true. Nice to meet you!

Re: If Not SPAs, What?

#433
post #316

Earlier quoted context omitted.

> You might not want to use JS but a language “like” JS such as TS or Lua would definitely be on the table. Or just JS without the biggest warts. When you remove the warts from JS there's not much left. And I'd be pretty skeptical of someone starting a new project in Lua today. I think the mainstream choice for a "blank slate" language today would look something like Swift or Kotlin; Typescript can gets close, but it…

> When you remove the warts from JS there's not much left Modern JavaScript is pretty sweet to write compared to pre 2015. It sure is fun to join in on the "JavaScript bad" circle jerk though.

I agree that plenty has been done to improve JS in recent years. That does not make it a good language.

Re: If Not SPAs, What?

#434

Earlier quoted context omitted.

Give me HTML+CSS+JS any time. Sure! And Chrome is superbly tested. But HTML/CSS/JS aren't anywhere near good enough to build GUIs of any complexity by themselves, so everyone layers tons of stuff on top. And then those ... those, people have plenty of complaints about too. But if they didn't use them those complaints would migrate to the underlying framework. I mean, Swing may have had a fragile threading model (not…

I agree with you 100%, and was really just addressing the “swing is awesome” statement in the GP. I’ll take HTML etc over Swing any day, but I’m sure there are nicer alternatives if your deployment environment is native, e.g. SwiftUI (which I have no experience with) There are plenty of things wrong with HTML & friends, await/async and webpack being my personal hair removers, but if we set that aside and just talk ab…

"swing tooling" thank you, don't misrepresent my argument.

Re: If Not SPAs, What?

#435

Author seems to think the goal of SPAs was to simplify web dev, but it’s actually to allow you to build fully featured, highly interactive, apps in a browser. What the author is really getting at, I would guess, is that front end dev is awful, due to this weird combination of the Blub issue and a historical trajectory that has caused many problems. The blub issues is mostly simple enough to pin down. Experienced prog…

> not to defend the Java ecosystem, but it does get some things right, or more right than others Out of curiosity, as a Java enthusiast, I was wondering if you could give examples of what you feel is wrong? In my HN browsing I find Java is rarely actually discussed here, though often dismissed. I don't know why.

> Out of curiosity, as a Java enthusiast, I was wondering if you could give examples of what you feel is wrong?

I think there's a lot of criticism for Java's language design. It involves an awful lot of boiler plate, and is generally very verbose. It's also a language that forces you to use OO, and OO has received a lot of pushback over recent years - so that approach has become very unpopular.

Personally, I also think the use of so many design patterns is an attempt to compensate for what the language lacks, its reflection capabilities are flawed etc.

I don't hate on Java. For many years it was my main language. It has awesome tooling and the JVM is incredible. But I do agree with most of the criticism.

I've been learning Clojure recently and Rich Hickey's talks often begin with some motivation including criticism of Java and OO more generally, here's one such video: https://www.youtube.com/watch?v=VSdnJDO-xdg

Re: If Not SPAs, What?

#436
post #160

Earlier quoted context omitted.

The basic issue was that the coroutine package was segfaulty and maintained by a man so lovely to interact with that the node.js core team eventually invented libuv (to replace his ev library) primarily so they never had to talk to him again. Perl now has http://p3rl.org/Future::AsyncAwait which is (like any async/await system) a bit more restricted than a full coroutine but works beautifully. If you threw a github r…

Thanks for the suggestions! But I've found Coro highly reliable and effective, including under stressed and complex loads, for about 6 years. Never found it segfaulty. It also performed well, and the API design always impressed me with its cleanliness and good documentation. Also I make extensive use of coroutine-local variables (like `thread_local` in C11) which operate at the same speed as normal `my` lexicals. I.e…

> But I've found Coro highly reliable and effective, including under stressed and complex loads, for about 6 years.

Had that been a more universal experience things might've been different.

I did once try and see if I could get a stripped down version to try and push into core but at the point where I'd deleted 90% of the code and the entire test suite still passed I realised that getting a reliable stripped down version was going to be a problem.

> Also I make extensive use of coroutine-local variables

I've been using Syntax::Keyword::Dynamically where I need that.

> For that dual-use functionality, as far as I can tell with Future::AsyncAwait I'd need to write two separate versions of most things.

I tend to write async by default and then for blocking code I call a blocking version of the API.

> I think "reliable" is misleading. Coro is highly reliable (for me anyway), while Future::AsyncAwait has documented gotchas.

I'll take documented gotchas over undocumented weird shit and an author who refuses to use a bugtracker and has a track record of deleting features if he doesn't like how people are using them.

> With Coro all the modules just work without anything Coro-specific in them.

Or at least they used to. The author no longer supports the past five years or so of perl releases so there's no combination of supported perl and supported Coro that exists anymore :(

Re: If Not SPAs, What?

#437
post #421

Earlier quoted context omitted.

I haven't built anything that requires significant performance tweaking other than some caching and SQL optimisations. Maybe PHP 8 will bring an even better performance when it gets released > HP roles typically pay 20% less Yeah, true. Hence why I am a React dev professionally

I'm not saying any of Django, Rails or Laravel are fast compared with Node, ASP.Net or Spring but what surprised me was how PHP 7, which is a lot faster than Ruby or Python, somehow managed to fall behind when Laravel was added into the mix. It's as if PHP's performance gains only really apply to raw PHP or lightweight frameworks.

That's surprising to hear. Do you have any links that go into this (or show benchmarks)? I generally avoid PHP, but I've been thinking of looking into Laravel for when I do need to use PHP.

Re: If Not SPAs, What?

#438

Author seems to think the goal of SPAs was to simplify web dev, but it’s actually to allow you to build fully featured, highly interactive, apps in a browser. What the author is really getting at, I would guess, is that front end dev is awful, due to this weird combination of the Blub issue and a historical trajectory that has caused many problems. The blub issues is mostly simple enough to pin down. Experienced prog…

> In fact, what you’d end up with would look remarkably similar to the dev process for a Java applet! Yeah, it's increasingly clear to me that Java was just 20 years ahead of its time. Java really would make a great front end language. People lament the complexity and size of the JVM... But these days V8 is just as bad. The complexity is a trade-off for runtime performance. It's compiled into a compact easy to parse…

I feel like the mistake Java made was ceding the DOM to Javascript. It turned out that users like the browser and didn't particularly want either native widgets or a new system. The browser is familiar and good enough for a vast majority of tasks.

If the JVM had access to the DOM, you could write SPAs in Java and everybody would be happy. Instead Java sealed itself off separately from the browser, and Javascript went from little toys to full-blown UI applications. And then developers wanted to use the same code on both client and server so they made Node, working in the space where Java is so much clearly better.

So we end up with the worse language running the world. Fortunately, JS has finally become a mediocre language (or even a decent one with TS), and here we are.

Re: If Not SPAs, What?

#439
post #175
post #151

The fundamental problem is not that the SPA pattern is bad, is that it takes a lot of skill and effort to make a proper SPA. Obviously, skill and time are scarce resources and the result is that most SPAs are crap. OTOH all these component based frameworks have definitely brought us a much better way to produce interactive experiences compared to the jQuery days. This is not related to SPAs at all. You can use React/…

Recently I got to work with hybrids.js (webcomponents) which makes the hydrate part nice. Because it is normal markup with whatever data you have on your SSR-pages. It simplified quite a bit.

Very interesting! Thanks for the recommendation.

Re: If Not SPAs, What?

#440
post #4

I am going to advocate the other way: https://qbix.com/blog/2020/01/02/the-case-for-building-clien...

Server is timing out. E: Actually it might just be a really heavy page. It’s a disaster on mobile. E2: After a few refreshes, it seems to be loading normally.

It was submitted to HN at the time What do you think of the substance?
Post reply on HN