Better HN
topnewbestaskshowjobs
Log inSign up

array_key_first

2,281 karma · joined Sep 23, 2025 (1y ago) · 1,791 submissions

Submissions

comment 11mo ago · link · parent

> No, the point of the API is to loosely couple the frontend and backend with a contract. The frontend doesn't need to model the backend, and the backend doesn't need to know what's happening on the frontend, it just needs to respect the API output. Changes/additions in the API are handled by API versioning, allowing overlap between old and new.

This is the idea, and idea which can never be fully realized.

The backend MUST understand what the frontend sees to some degree, because of efficiency, performance, and user-experience.

If we build the perfect RESTful API, where each object is an endpoint and their relationships are modeled by URLs, we have almost realized this vision. But it cost us our server catching on fire. It thrashed our user experience. Our application sucks ass, it's almost unusable. Things show up on the front-end but they're ghosts, everything takes forever to load, every button is a liar, and the quality of our application has reached new depths of hell.

And, we haven't realized the vision even. What about Authentication? User access? Routing?

> Not if the frontend isn't trying to model the internals of the backend.

The frontend does not get a choice, because the model is the model. When you go against the grain of the model and you say "everything is abstract", then you open yourself up to the worst bugs imaginable.

No - things are linked, things are coupled. When we just pretend they are not, we haven't done anything but obscure the points where failure can happen.

> Velocity increases because frontend works to a stable API, and backend doesn't need to co-ordinate changes that don't affect the API output. Also, changes involving both don't require simultaneous co-ordinated release: once the PM has approved a change, the backend implements, releases non-breaking API changes, and then frontend goes on its way.

No, this is a stark decrease in velocity.

When I need to display a new form that, say, coordinates 10 database tables in a complex way, I can just do that if the application is SSR or Livewire-type. I can just do that. I don't need the backend team to implement it in 3 months and then I make the form. I also don't need to wrangle together 15+ APIs and then recreate a database engine in JS to do it.

Realistically, those are your two options. Either you have a performant backend API interface full of one-off implementations, what we might consider spaghetti, or you have a "clean" RESTful API that falls apart as soon as you even try to go against the grain of the data model.

There are, of course, in-betweens. RPC is a great example. We don't model data, we model operations. Maybe we have a "generateForm" method on the backend and the frontend just uses this. You might notice this looks a lot like SSR with extra steps...

But this all assumes the form is generated and then done. What if the data is changing? Maybe it's not a form, maybe it's a node editor? SSR will fall apart here, and so will the clean-code frontend-backend. It will be so hellish, so evil, so convoluted.

Bearing in mind, this is something truly trivial for desktop applications to do. The models of modern web apps just cannot do this in a scalable, or reliable, way. But decades old technology like COM, dbus, and X can. We need to look at what the difference is and decide how we can utilize that.

comment 11mo ago · link · parent

Communicating over HTTP comes with pretty much as many physical boundaries as possible. The main problem, and power, of APIs is their inflexibility. By their design, and even the design of HTTP itself, they are difficult to change over time. They're interfaces, with defined inputs and outputs.

Say I want to draw a box which has many checkboxes - like a multi-select. A very, very simple, but powerful, widget. In most Web applications, this widget is incredibly hard to develop.

Why is that? Well first we need to get the data for the box, and ideally just this particular page of the box, if it's paginated. So we have to use an API. But the API is going to come with so much baggage - we only need identifiers really, since we're just checking a checkbox. But what API endpoint is going to return a list of just identifiers? Maybe some RESTful APIs, but not most.

Okay okay, so we get a bunch of data and then throw away most of it. Whatever. But oh no - we don't want this multi-select to be split by logical objects, no, we have a different categorization criteria. So then we rope in another API, or maybe a few more, and we then group all the stuff together and try to splice it up ourselves. This is a lot of code, yes, and horribly frail. The realization strikes that we're essentially doing SQL JOIN and GROUP BY in JS.

Okay, so we'll build an API. Oh no you won't. You can't just build an API, it's an interface. What, you're going to write an API for your one-off multi-select? But what if someone else needs it? What about documentation? Versioning? I mean, is this even RESTful? Sure doesn't look like it. This is spaghetti code.

Sigh. Okay, just use the 5 API endpoints and recreate a small database engine on the frontend, who cares.

Or, alternative: you just draw the multi-select. When you need to lazily update it, you just update it. Like you were writing a Qt application and not a web application. Layers and layers of complexity and friction just disappear.

comment 11mo ago · link · parent

Yes, as I've stated, the big stuff is new Web stuff.

When I say traditional client-server applications, I mean the type of stuff like X or IPC - the stuff before the Web.

> A web application should either be server-generated HTML with a little JS sprinkled in, or a client-side application with traditional RPC-like calls when necessary.

There's really no reason it "should" be either one or the other because BOTH have huge drawbacks.

The problem with the first approach (SSR with JS sprinkled) is that particular interactions become very, very hard. Think, for example, a node editor. Why would we have a node editor? We're actually doing this at work right now, building out a node editor for report writing. We're 95% SSR.

Turns out, super duper hard to do with this approach. Because it's so heavily client-side interactive so you need lots and lots of sync points, and ultimately the SERVER will be the one generating the report.

But actually, the client-side approach isn't very good either. Okay, maybe we just serialize the entire node graph and sent it over the pipe once, and then save it now and again. But what if we want to preview what the output is going to look like in real-time? Now this is really, really hard - because we need to incrementally serialize the node graph and send it to the server, generate a bit of report, and get it back, OR we just redo the report generation on the front-end with some front-loaded data - in which case our "preview" isn't a preview at all, it's a recreation.

The solution here is, actually, a chatty protocol. This is the type of thing that's super common and trivial in desktop applications - it's what gives them superpowers. But it's so rare to see on the Web.

comment 11mo ago · link · parent

It's not strange, it's purposeful. It's the same logic as "well George Floyd had a counterfeit 20!"

It's an extremely effective propaganda technique whereby you discredit the person(s) who were affected by injustice, while simultaneously shifting the narrative away from said injustice. It preys on the human minds simple morality reasoning skills - bad people don't do good things, and good people don't do bad things.

Of course, that's not how it works, and it's both. George Floyd maybe did counterfeit a twenty, and that's illegal. But is the punishment for that public execution? What motivation do people have to bring that up? No good motivations, in my mind.

comment 11mo ago · link · parent

When I say this happens in mere minutes and to everyone I know, I mean it.

For the record, I don't use Instagram because it's basically always been toxic. It's one of the fastest ways to feel bad about your body and life.

comment 11mo ago · link · parent

This is how client-server applications have been done for decades, it's basically only the browser that does the whole "big ole requests" thing.

The problem with API + frontend is:

1. You have two applications you have to ensure are always in sync and consistent.

2. Code is duplicated.

3. Velocity decreases because in order to implement almost anything, you need buy-in from the backend AND frontend team(s).

The idea of Blazor Server or Phoenix live view is "the server runs the show". There's now one source of truth, and you don't have to spend time making sure it's consistent.

I would say, really, 80% of bugs in web applications come from the client and server being out of sync. Even if you think about vulnerability like unauthorized access, it's usually just this. If you can eliminate those 80% or mitigate them, then that's huge.

Oh, and thats not even touching on the performance implications. APIs can be performant, but they usually aren't. Usually adding or editing an API is treated as such a high risk activity that people just don't do it - so instead they contort, like, 10 API calls together and discard 99% of the data to get the thing they want on the frontend.

comment 11mo ago · link · parent

It's definitely a setting issue, the problem is Apple has multiple settings which all interfere with notifications. My mom gets this problem a lot and it takes entirely to long to track down which setting is overriding what.

comment 11mo ago · link · parent

I switched from iOS to Android and it's actually kind of insane how much higher quality a lot of parts of the OS are. I wasn't expecting this, I was expecting customization and the associated jank. But no, it's been pleasantly surprising.

There's still some jank. Sometimes searching for something in setting takes upwards of 5 seconds. I can only assume it's downloading a bitcoin miner or something.

comment 11mo ago · link · parent

Everyone has gotten so used to software being extremely shitty and hostile that they just think this is how it is. People work around the jank sometimes hundreds of times a day and don't look at the big picture.

I know at work I get work around windows taskbar jank at least a few dozens times a day. Granted, I can't do anything about it.

comment 11mo ago · link · parent

I swear to god Instagram is like the patriarchy speedrun.

If it finds out you're a woman, within mere minutes it's 100% "you're fat" "try this diet" "you've GOT to buy this viral dress on shein!!"

And if you're a man, it's boobs, ass, objectification, and products to make you feel more like a man.

The sheer velocity at which Instagram will shovel you into capitalist-patriachy++ is shocking.

comment 11mo ago · link · parent

People care because it's entirely unconscious. Even if you choose not to care, you can't, because you've already seen it.

The way advertisement works is that it's brain hacking - it's just associations. Over time your brain associates a brand with a product or products, and then simply by having this association in your brain you're more likely to buy the product.

This also works for negative advertisement.

Think about it. Suppose you did see mickey mouse saluting Hitler, or maybe you saw mickey mouse stick a jar up his little rat ass.

When you see mickey mouse, undoubtedly, even if just for a second, your mind will think about what you saw before. You might discount it immediately, but the damage is done. You still feel that emotion, even if only for a split second, and you have been influenced by it.

comment 11mo ago · link · parent

Yes, spiderman and Elsa on YouTube is a prime example. It's just slop for kids, they're not even in the same universe. But kids like spiderman, and they also like Elsa, so... here we are.

They do it because it actually works.

comment 11mo ago · link · parent

I don't think it was a misdirection, but I do think it was an obviously bad idea that should've never materialized, and it didn't. I'm arguing it wouldn't have materialized anyway, and if it did, it wouldn't have been necessary.

Things did work out for Japan in the long run, but I still believe a conditional surrender + no atomic bombs should have been the solution. The US was very greedy with its demands, and I think a large part of that is our history of militarism and our desire to use new weaponry. The atomic bomb was already made, and I think realistically we were just itching to use it.

comment 11mo ago · link · parent

The collateral damage was obvious and predictable. If you know about the potential collateral damage and do it anyway, then it's not targeted, even if you say it's targeted.

For example: say I want to kill someone. I know they live in NYC. So I target them by dropping a nuke on NYC.

Is this a targeted attack? Obviously not. But I said it was targeted! Doesn't work that way.

If you want to target people, you try your best to kill just them. If you're planting bombs in mundane places and setting them off in public, you are not doing that.

I don't know why we feel the need to defend military operatives by essentially claiming they're the stupidest people on Earth and cannot put 2 and 2 together. No no, they can. Meaning, this was intentional.

comment 11mo ago · link · parent

> https://pubmed.ncbi.nlm.nih.gov/8371731/

"Virtually all of this risk involved homicide by a family member or intimate acquaintance."

comment 11mo ago · link · parent

It's not, because most gun death are actually from the person owning the gun or people close to them.

It's much more likely that you shoot yourself or your kid shoots you or your husband/brother/other-troubled-man has a bad day and shoots you than a criminal shooting you.

The relationship between gun deaths and guns is not correlative, it's causative. Because, surprise! Guns cause gun death.

Generally, less guns = less gun death. Which might seem like such a simple understanding that it must be naive or stupid. But no, it's actually just that simple.

On a related note, less automobiles = less automobile deaths.

comment 11mo ago · link · parent

No, we should ban the technology, at least until we can somewhat verify the students understand the underlying concepts.

Like, yes, we allow calculators for highschoolers. But we'd never give a calculator to a 3rd grader learning their times tables. Because then they'd never learn that 9 * 9 is 49, and now they're permanently handicapped in math. And now, when they are in high school, the calculator doesn't even matter, because they can't do math at a basic level.

Or, consider reading. Certainly high schoolers can use audio books. But imagine if we didn't teach reading at all, and just used audio books, from kindergarten. Would anyone know how to read? I doubt it.

Learning is unique in that it builds on lower-level stuff. If you just skip that stuff, sure, it might look efficient - but it's not. You actually learn much less if you do that. It's not like me at my job, where if I use AI I finish a project in half the time and I'm better off. No, if I learn in half the time, I've learned less!

comment 11mo ago · link · parent

Maybe they were just bad at it and didn't get enough buy-in.

comment 11mo ago · link · parent

The actual paradox is that, in the US, simply having a firearm in your home increases your risk of death to gun violence.

comment 11mo ago · link · parent

> Money can buy quality of life

It actually can't, not generally at least for US labor.

One of the most important measures of quality is work-life balance. Basically, your life kinda sucks if you work all the time, and then you also get fat and sick and die young(er).

People in the US work a lot, and often the more wealthy, but not most wealthy, work A TON. In programming, it's not atypical to have "superstar" staff engineers putting in easily 60-70 hours a week. Of course, not including the commute.

But then there's the time off. Oh, where to begin. We're at a point where 10 days of PTO accrued a year is considered decent. It's work work work, and you can put in 20 years of service... and get, like, an extra couple days. Maybe.

None of this scales down. For example, I'm supposed to be working 40 hours a week. I'm not of course, the baseline is 45 because 9-5 is actually 9-6. And I haven't left at 6 in at least a year, so even that is underestimating it. But suppose I do work 40 hours a week.

Would I take a 50% pay cut to work 20 hours? Fuck. Yes. Yes. In a heart beat. But I can't, I'd actually be taking an 80% pay cut if I do that, so I couldn't live. And it's like this for literally ALL jobs. I can't just "move up", because the work-life balance doesn't get better, it actually just gets worse! And at no point can I take a "step down" and work less, because then I'm flipping burgers.

comment 11mo ago · link · parent

I live in the suburbs, and it's not like this. The entire place smells like feet (???), all the tables are sticky, and there's a constant stream of "beep boop beep boop... bebebebeb"

comment 11mo ago · link · parent

You have to turn your monitor on, silly!

comment 11mo ago · link · parent

> if the calculus is how to win the war with the lowest number of additional lives lost, the atomic bombs dropped on Japan were quite likely significantly less deadly

This is just US propaganda. These numbers come from the fact that the US was "anticipating" a ground invasion of Japan or vice versa.

Which, to be clear, was always a made-up alternative. By the time the atomic bomb was dropped, Japan had already tried to surrender multiple times, both to us and the soviets. The reality is we just wanted to drop an atomic bomb.

comment 11mo ago · link · parent

Conflating transport-layer encryption with authenticity is the problem. The former should always be standard, the latter is unrelated and IMO needs a different mechanism.

comment 11mo ago · link · parent

I think it does - playing wack-a-mole with apps using frail heuristics is just not a reliable approach.

comment 11mo ago · link · parent

Good doesn't mean moral in this case, it means valuable. Capitalism, or whatever the fuck we have right now, doesn't create much real value, but instead it creates a lot of fake value that we just proxy.

And I say "or whatever the fuck" because, as you point out, it's not really capitalism. And maybe it never was - after all, the US Golden Era was when we had the most central planning, the most social services, and the highest taxes.

But everybody right now is exploiting one teensy little flaw of the economy - humans don't live very long. There's no reason to make stuff good for later when you can take a cash advance and get rich now. Everything is always someone else's problem.

I think one fun case study is superstar CEOs. They're so highly desirable, and they work 5 years at a company and "turn it around" before moving onto the next. But if you look at the company after they leave, it's in shambles. And yet, they are the most sought after CEOs. You don't want the Arizona Green Tea guy, no, you want the guy who ran Chipotle into the ground. But hey, at least he increased their stock price for, like, a little bit.

comment 11mo ago · link · parent

The main benefit of Google Docs is that, at least, Google is a better steward. Not good, but better.

And also, their software is exceedingly simple, which is great for breaking vendor lock-in. Microsoft got away with murder because none of their shit works like it should and every single product they make is the "black sheep" in the category it's in.

comment 11mo ago · link · parent

This is a problem at a wide array of tech companies. Everyone wants to Meta, everyone wants to be Google.

Guys, we're building B2B enterprise software. The most important things our clients care about is this hunk of junk working. Changing it is probably bad, actually, because the users are using it 8 hours a day and they don't want to deal with annoying popups about new features and UI churn for the sake of churn.

comment 11mo ago · link · parent

Apple is somewhat privacy focused, allegedly. I would imagine that letting an unpredictable LLM read whatever system data it wants is not something they want to partake in.

comment 11mo ago · link · parent

I think it's a symptom of our work culture and lifestyle. When people are spending anywhere between 1-2 hours a day in a car going to a job that sucks the life out of them, I'm not surprised they don't have the energy to get food for themselves.

Convenience services thrive in America because it's the only way the working class can claw back a teensy bit of time and energy. We could have had hybrid or even remote work, but that dream is dead. Traffic sucks, outside is loud and stinky, and you're in the office minimum 9 hours a day, 5 days a week. Minimum. I actually don't know anyone who works that little.

1
323334
60