Live data from Hacker News

Ask HN: Why did Frontend development explode in complexity?

news.ycombinator.com

301–310 of 398 posts

Re: Ask HN: Why did Frontend development explode in complexity?

#301
post #174
post #80

Earlier quoted context omitted.

Exactly, those patterns may be good if you know exactly what you're doing. But in all the other cases, they just make everything more complicated and harder to understand. I've once worked with a messy codebase, it was written in a very "naive" way, but that was also the strength of that code. Every view was in one file, every action was just one method, so you exactly knew what code was executed when. We tried to re…

I find that in larger GUI apps the best thing to have is a layered architecture where visual and non-visual parts are separated globally, not on a view-by-view basis. One advantage of this is that you can slice off your visual part and have something like a "headless browser" variant of your app. Among other things this is good for writing integration tests if you also have a backend. Same trick is impossible or very…

> visual and non-visual parts are separated globally, not on a view-by-view basis

Yes, yes, and YES!

This is something that confused me greatly over the last years: teams/companies I was in contact with were really struggling getting MVC to work (never mind MV*) and I wasn't...but I wasn't doing anything special, at least not that I could tell.

I would implement my model, TDD-style, put minimal views on top, possible add a view-model here and there if there was some display-specific logic that was complex enough to warrant more extensive testing, voilà.

It was only recently, partly when working with some teams that were doing modularity for modularity's sake (and MVVM for MVVM's sake), and partly when writing down Blackbird[1] that I really noticed the per-view thing.

Don't do that.

>"headless browser" variant of your app

Exactly. Do this.

The app is an object. It has an API. It knows how to coordinate its pieces. The local I/O, the remote I/O, any timing stuff. All of it. Then you plonk the UI on top of that. You can have sub-parts, but you need one piece that ties it all together, on the model side.

> Same trick is impossible or very difficult to do with MVVM.

Well, it's impossible with the misapplication of MVVM that is common today. A view model is a perfectly fine addition if you have some complex but fairly presentation-specific logic. And you put that in a testable model that is fairly tied to one view.

Instead, people have used MVVM to double down on their view-centric misunderstanding of MVC, with anemic models that know just enough to service a specific view.

Meaning any kind of cross-app logic can't go in the model. Meaning it is going to go into the view parts (or rather: the misnamed and misapplied controllers). Which is exactly where it has absolutely no business whatsoever being.

Sigh.

[1] https://blog.metaobject.com/2022/06/blackbird-simple-referen...

Re: Ask HN: Why did Frontend development explode in complexity?

#302
post #191

Earlier quoted context omitted.

Agreed on that controllers are often misunderstood. I saw them to become both: a view and a model at the same time. :(

What's important to realise is that the elements in MVC are roles not entities. So for example Views in Cocoa actually fulfil both the View and (largely) the Controller role. Which is why ViewControllers confused me greatly when they came out. Like they confuse most of the Apple-ecosystem code out there these days. While I do understand how they got there, that doesn't make it better...

agree again.

offtopic: love your blog!

Re: Ask HN: Why did Frontend development explode in complexity?

#303

Unpopular biased opinion. Frontend development is mostly done by people who are into visual things and less into logic. Unlike backend engineering, where people working are primarily choosing technology based on logic/merit and less by visual appearance. This leads to the adaptation of large number of garbage frameworks in frontend primarily because their landing pages look visually appealing. After some time fronten…

> Unlike backend engineering …

Ha you could not be more wrong. Front end is all about velocity and trying to not end up with a ball of mud at the end of the year. State management is where a lot of the complexity and logic exist.

Whereas within backend, our current state of affairs is “oh, need some new functionality? Let us spin up microservice #214 for that one thing”.

This is changing, and across all area’s experienced engineers can avoid these problems, but the thought of front end developers coding with their hearts instead of their minds is a funny one.

Re: Ask HN: Why did Frontend development explode in complexity?

#304
post #47
post #22

Earlier quoted context omitted.

One of the best examples of this complexity inflation problem I always see is the Redux pattern in frontends. This pattern comes with a lot of overhead, a lot of things that need to line up (Actions, Reducers, Actioncreators, Selectors, ...). And most of the time the applications that use it are completely trivial. If you remove Redux, half of the code is gone, it's faster and easier to understand and extend.

To be fair most front-end projects have abandoned redux now. It was for sure boilerplate hell.

What's interesting is why was it so widely accepted in the first place. It's not like boilerplate reveals itself at later stages, it's right there from the beginning. I think it tells a lot about the state of the industry.

Re: Ask HN: Why did Frontend development explode in complexity?

#305
post #249
post #226

Earlier quoted context omitted.

/me remembers MFC/QT/BCGsoft and C++ codebase and gently smiles on thought that maybe the issue are everywhere else except the UI complexity. We are where we are, but it is interesting that GUI libraries from 20 years back are still running circles around latest and the greatest UI web front-end, even if it is also client rendered. Maybe, just maybe, we should search for an issue somewhere else?

As much as I hate modern frontend code, I question this narrative. What 20 year old GUI library is running circles around... anything?

Cocoa (macOS) for example

Re: Ask HN: Why did Frontend development explode in complexity?

#306

The lack of objectivity around this is absolutely astonishing from a community such as this. It exploded with complexity because frontend complexity exploded. Simple. Absolutely no people expected an "API call" from a frontend application 20 years ago, now people expect loading indicators on buttons (that make API calls) after pressing them. Just have a look at the comments on the recent Standard Notes / React Native…

A slight caricature of your take:

It took us 20 years and immense complexity to start displaying loading indicators on buttons.

Re: Ask HN: Why did Frontend development explode in complexity?

#307
NPM is the Instagram for developers. They produce mostly wrapper packages around standard APIs in order to get some fame. It would be much better if they teach people how to achieve basic stuff without already-baked-in APIs.

I'd assume that 80% of the available packages are completely unnecessary, i.e. "I need to set a cookie ... let's download this NPM package" or "I need to make two AJAX requests in order to fetch some JSON ... there are two more NPM packages"

I'm writing happily spaghetti code, use PHP, SQLite, Vanilla JS, HTML5, server-send-events, cron jobs and bash scripts to create fast and useful web applications.

Last note from today: I saw a tutorial on YouTube how to auto-generate a .m3u playlist for a folder containing hundreds of MP3. It involved of course downloading NPM packages, create a NodeJS cli script etc.

My 3-second solution was this (built in tools coming with almost every OS)

#!/bin/bash ls -1 *.mp3 > playlist.m3u

Re: Ask HN: Why did Frontend development explode in complexity?

#309
post #288

Earlier quoted context omitted.

I haven't used QT or BCGSoft, but I for one have very negative memories of MFC. Sure the performance was much better than anything you get on the web, but the UIs were far less complex, didn't handle window resizing well/at all, handled text overflow poorly, and had much less aggressive design requirements than we have today. There was also a ton of imperative glue code and lots of hard-to-read generated code.

Less complex UI, interesting: https://bcgsoft.com/galleries.htm (psst, a secret, BCG is just a library on top of MFC) Please DO open Word 97 (and this is 26 years old UI) and compare it with the best done web UI you are aware of, regardless of framework, as long it is not QT compiled into webasm (as this is the only thing on web that comes close). Now why is that, I don't know. But I can tell you what I can see as a…

My understanding is that none of the core Microsoft apps like Office were built on MFC. In MFC projects I worked on, generally the simple stuff was built with MFC and anything more complex was built with the win32 API.

Re: Ask HN: Why did Frontend development explode in complexity?

#310

Early react team member here. The popular react/webpack/npm stack is probably what the OP is talking about. It was popularized because the Instagram web team used webpack and npm in 2013 so we recommended it alongside react in the early days. I was TLM of the team when we made these decisions. There are three main points I want to add to the conversation. 1. UIs actually have a lot of complexity. The number of states…

> Modern backend eng is a morass of kubernetes configuration, needless microservices and overuse of async queues, for example

That's certainly the trend. At my org, we "partnered" with AWS to help us figure out what the tech stack should look like. Sure enough, everything should be in an SQS queue, triggered off S3 running in AWS Step that's triggered through SNS notifications. All this requires countless lambdas which means deployments can last hours.

It's a mess to debug (meaning you can't), track logs, track status, etc.. Does all that "work"? It can, sometimes. Does it scale? For sure, theoretically, if you can get it all running.

In my team we use a trick to just run everything in AWS Batch containers, it's much easier, deploys quickly, and we can run the whole stack locally and debug it.

Post reply on HN