Live data from Hacker News

If Not SPAs, What?

macwright.com

401–410 of 456 posts

Re: If Not SPAs, What?

#401
post #317

Earlier quoted context omitted.

> However the culture around complex frameworks and over-engineering is what most people really dislike about it. I think this is it. I remember back in the day being absolutely floored when I started learning J2EE by the, it seemed, unnecessary complexity (for most use cases) of EJB. It was incredibly offputting: if you were starting a project from scratch it felt like you had to do a ridiculous amount of work just…

That's true. I also used to be a .NET guy in the past, but I started doing more games (and then frontend) when the movement from Rails-ish to Java-ish MVC started. The thing about the multiple "layers" that don't do anything really bothers me too, because they are a misconception of how those complex architectures (Clean/Hexagonal/Onion) really work... Instead of having mandatory layers, those should be pluggable. Ju…

> The thing about the multiple "layers" that don't do anything really bothers me too, because they are a misconception of how those complex architectures (Clean/Hexagonal/Onion) really work...

> Instead of having mandatory layers...

C# guy here.

I don't think things were ever as bad in the dotnet world as they are in Java, but l do still come across a lot of what you're describing here. Thankfully though, a lot of devs do seem to have "awakened" - it feels like there is a lot less cargo-culting of "best practises" such as layers, interfaces and abstract classes for everything, tests so full of mocks you can't see anything being tested etc.

C# is a fantastic language, but as with any OO language there are lots of abstraction-related traps to fall into.

Re: If Not SPAs, What?

#402
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/…

No, it doesn’t take that much skill. I think this is the source of the problem. The stupidity and hostile fear of originality I detect in this these comments is a very real reflection of my professional experience. This, dependence on frameworks and inability to imagine anything beyond the common SPA, really scares the shit out of me knowing I will be coming home from a military deployment soon and returning to the c…

> No, it doesn’t take that much skill. I think this is the source of the problem.

It does take skill to make a proper SPA not to make an SPA.

Re: If Not SPAs, What?

#403
post #45

One entry in this space that doesn't get a lot of attention is ASP.NET Blazor [1]. Blazor gives you the option of writing views in C# that will actually compile to WebAssembly and run in the browser, or run on the server and send DOM updates over a SignalR connection, a lot like LiveView. [1] https://docs.microsoft.com/en-us/aspnet/core/blazor/

ASP.NET core is still all the same over-engineered enterprise baggage you see in the Java world.

It's not. You can literally have a simple "hello world" app in a handful of lines or code if you want.

I have to wonder if you actually use ASP.NET Core yourself, because ASP.NET Core 3 is, IMO, fantastic. ASP.NET used to be a bit clunky, and lacking in extensibility points, and a lot of people used alternatives like Nancy instead. Nancy officially stopped development around a year back, largely because dotnet devs just don't need it anymore. I was a long-time Nancy fan myself, ASP.NET Core 3 has all the best bits and more.

And you don't need to stick with the typical paradigm on controllers in one folder, views in another etc - feature folders work great. Hell, you don't even really need to use controllers, if Razor Pages are your thing.

Re: If Not SPAs, What?

#404
post #147

Earlier quoted context omitted.

I am quite a fan of HTMX and am using it for multiple projects now. I hope it continues to gain traction.

How do you handle things like menu pop-ups and toggling/hiding content? I keep wanting to use htmx and it's like, but there always seem to be very common tasks like having an expandable menu on mobile that don't have a great solution in these libraries and I have to write vanilla JS. I've settled on Alpine instead for the time being because it has some data management built in. I'm thinking I'm going to have to switc…

Basically, you can toggle visibility on your pop up menus or modals with standard CSS/HTML. The visibility class/attribute can be controlled declaratively or imperatively without much JS. You can even use CSS transitions to add nice smooth animation to your menu/overlay.

#UseThePlatform

Re: If Not SPAs, What?

#405
post #289

Earlier quoted context omitted.

> A developer can write code or they can't. Uhh that is not how it works. I can write code but if you tell me go and write in assembly or C, I cant because I think its outside my circle of competence. Maybe you find SPA's easy others dont.

I have been writing software for 20 years. It's exactly how it works. You can, after a necessary onboarding period, accomplish the task you were hired to accomplish or you can't.

Agreed. This is indeed how it works. Changes in company culture trends somewhat lend to the perception of newer programmers that they hold competency beyond what they do, which contributes to the overall problem of software being hard and an unstable industry.

I used to not be able to code, and now I can. By that I mean I used to not grok the purely abstract domain of encoding meaningful computation and only the concrete domain of when I type a certain sequence of keys in ${languageX} and press some other stuff, stuff happens.

Now that I better understand the abstract domain the concrete domain of programming languages translate, I am much better able to pick new tools up and understand whether or not they should be picked up.

Re: If Not SPAs, What?

#406

Earlier quoted context omitted.

Fyi return await is redundant and is just creating one additional callback you didn't need (b/c you will have to call this function with an await anyways)

Try / catch is the exception, if you don't await then your catch handler won't work. https://jakearchibald.com/2017/await-vs-return-vs-return-awa...

Semi funny that this exchange is kinda like proof of why JS catches the hate it does.

Re: If Not SPAs, What?

#407

Earlier quoted context omitted.

Name three. Because like other commenters that chimed in, I can notice most SPAs, and all SPAs I've used had annoying performance problems. By problems I don't mean a sudden request that takes half a second, but that every UI interaction feels subtly slow. I don't know where people get these performance targets of "below 100ms and users won't notice". I notice. I notice if UI responses take longer than two-three anim…

Any of the google office applications, fastmail, both are fantastic SPAs in my opinion.

i gotta agree with sibling, google apps are certainly not fantastic and fall squarely in the clunky category

Re: If Not SPAs, What?

#408
post #397

Earlier quoted context omitted.

Hi, I'm also a new JS coder, but I'd like to avoid becoming one of "those people" you're talking about. I've been struggling with exactly what you mention - how to find out the "correct" way to apply patterns/do relatively complex things, but all I get on search results are Medium articles written by bootcamp grads. Can you recommend any sources of truth/books that can guide down the right path? Of course I'll be goi…

I'd say Eloquent Javascript (available for free online, I think) is a good book to read. "You Don't Know JS" is also a good one! Basically, go for anything that teaches you non-js-specific approaches as well as as a solid understanding of the fundamentals.

Thank you! I'll check both of those out

Re: If Not SPAs, What?

#409
post #102

Earlier quoted context omitted.

Blazor is certainly a very interesting and promising piece of technology. However, Blazor Server hosting mode is prone to latency issues and requires always-on connection to run an applications (so, no offline mode). On the other hand, the alternative Blazor WebAssembly mode requires clients to download a sizeable mix of .NET runtime and other system DLLs on the first use of the application (even a lightweight demo a…

I believe the runtime is under 1 MB before compression. As you stated, they're working hard to reduce that size. At the same time, while not condoning it, I just scrolled to the bottom of Amazon's front page and downloaded over 30 MB.

I think that "under 1 MB" represents the size of .NET runtime proper. However, additional required system DLLs increase the download size of a minimal application to the numbers I cited above [1]. Anyway, your example of Amazon's front page is interesting and is a good point (even though, in my quick test out of curiosity, relevant download size resulted in 2.2 MB [not authenticated] and 9.2 MB [authenticated] - quite a bit less, but still ...).

[1] https://blog.ndepend.com/blazor-internals-you-need-to-know

Re: If Not SPAs, What?

#410
post #102

Earlier quoted context omitted.

Blazor is certainly a very interesting and promising piece of technology. However, Blazor Server hosting mode is prone to latency issues and requires always-on connection to run an applications (so, no offline mode). On the other hand, the alternative Blazor WebAssembly mode requires clients to download a sizeable mix of .NET runtime and other system DLLs on the first use of the application (even a lightweight demo a…

Is offline mode widely used? I remember it being released to great excitement and then I never heard about it again. I assumed it died out when being offline became too much of an edge-case for your average user to be worth dealing with.

I have no idea about how widely used the offline mode is, but I'm curious to find out, should people run across relevant statistics.
Post reply on HN