News for hackers. Stuff that matters.
Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @10:03AM (#27996664)
I have known this for many years but found it difficult to explain to others. Backends are so much easier to build compared to frontends, and I mean decent and reliable ones. The attitude of the backend people of looking down upon frontend people is really stupid and unsubstantiated. Though scalable backends are increasingly getting their own layers of complexity these days, but still, on the backend you will never deal with frameworks with millions of entry points. If you don't believe me, UIKit alone exposes I think about half a million public symbols.

Nevertheless, I chose the path of the frontend (specifically mobile) because it fascinates me when a lot of people see on their screens something that you have built. A lot more than building a system that only the internal frontend devs are going to appreciate (or not).

Re:Low level is easy (2008) by valenterry on Thursday July 29, 2021 @10:58AM (#27997307)
> Backends are so much easier to build compared to frontends, and I mean decent and reliable ones.

That's actually true. What makes backends harder (or rather slower?) to build though is the longlivety of the data involved. Backends that don't deal with data are indeed simpler than frontends in my experience.

> The attitude of the backend people of looking down upon frontend people

That has nothing to do with the complexity. It comes from the fact that frontend is more approachable and also more hip. It attracts more "amateurs" or people who don't know what they are doing, for one reason or another. The result is that technology on the backend-side is more advanced and mature than on the frontend side - though that might be a bit subjective and not apply to specific areas.

You actually give your own example: "frameworks with millions of entry points" and a dozen new ones every year. :) However, I think frontend is in the progress of catching up - e.g. Javascript is currently replaced with Typescript, which is not being looked down upon by backend people, at least not as much.

Re:Low level is easy (2008) by vagrantJin on Thursday July 29, 2021 @03:45PM (#28000533)
> Javascript is currently replaced with Typescript, which is not being looked down upon by backend people, at least not as much.

For some reason - unbeknownst to God and his prophets, very smart, intelligent folk want to use a BMX as farming tool to plough and till the soil. Now we aren't going to ask silly questions like - why use a bmx when you have a whole barn full of tractors.

No.

We are going to ask how to get maximum output from the pedal mechanism. How to replace the human with a robot so we plough faster and how best to install solar panels for day time power source as well as highly specialized lithium ion cells made specifically for this purpose, so we can cover more ground.

A farmer, who has been farming for his whole life, really belived the tractors with billions of man hours in commercial farms, trusty, easy to fix and operate with a plethora of mechanics to fix and improve them.

But that just gives the farmer a vague existential crisis, what really gets him in the dumps is how they get the the goods to and from the farm. See he has big lumbering trailers and a few modernis rigs. Hes been using them forever, they are insured and also have possibly the highest reliability of transport. The new farmers merely smirk at the diesel autos. They have sonething better, smaller, faster and many of it. Quadbikes hooked to trailers. Hundreds and thousands of them. Apparently a central computer, bless it, controls and orchestrates the many quad bikes. The old farmer feels lost and helpless everytime he goes out to harvest. His trusty harvester looks impossibly old and slow, steady as she goes. No matter that she can haul a few hundred tons a week, it is nowhere new sophistacted than the automated quadbikes - zipping in and out with their 80kg loads at break neck speed. It's like watching a symphony.

He wonders what they actually grow there. Seeing such advanced alien technology ,to him at least, these new farmers must be planting something more delicate than rice, yield higher than wheat, and sturdier than simple corn. Surely, he reasons, his life is all but over.

But is it?

The FOMO chronicles, Afseyuk, 2020

Re:Low level is easy (2008) by tenaciousDaniel on Thursday July 29, 2021 @10:09AM (#27996739)
Something I've noticed is that when you're building a backend, your program only ever interfaces with other programs. You can establish a reasonably predictable protocol. But when you build a front-end, you're interfacing with the human brain and all the messiness that that entails. It's an incredibly difficult thing to do well.
Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @11:07AM (#27997413)
This is exactly why frontends are orders of magnitudes more difficult to build if equal quality standards are applied to both back and front ends.

A front end is a state machine that relies on a bunch of enormous framework layers. Give me an app, mobile or web, and I'll find a glitch or two in the first few minutes of using it.

Backends on the other hand, like you said, only ever talk to other programs. And that means building a 100% correct and bug free backend system is not such a fantastical goal.

Re:Low level is easy (2008) by Banana699 on Thursday July 29, 2021 @08:25PM (#28003135)
>Give me an app, mobile or web, and I'll find a glitch or two in the first few minutes of using it

I find that a very strong claim, is it rhetorical or meant literally? If the latter, what can you find in (say) whatsapp* ?

(*: aside from messages delaying or appearing out-of-write-order, which are probably backend bugs inevitably arising from its distributed nature)

Re:Low level is easy (2008) by mojuba on Friday July 30, 2021 @01:35AM (#28004802)
I deleted WhatsApp a while ago so can't say right now. It is a pretty mature app that hasn't added big features in years I think, so I wouldn't expect a lot of bugs in it, but take a look at their version history on App Store, there are plenty of purely bug fix releases only this year.
Re:Low level is easy (2008) by legulere on Thursday July 29, 2021 @04:49PM (#28001315)
I think the biggest difficulty in front ends is that they are statefull. Backends are usually stateless and pass through data from a data store or a cache.
Re:Low level is easy (2008) by valenterry on Thursday July 29, 2021 @08:00PM (#28002991)
It's the opposite. Frontends are statefull (backends are often also), but frontends don't deal with long living data. Everytime the app/site is reloaded/restarted, it starts with a fresh state. Backend however often has accumulated a lot of data tech debt over the time.
Re:Low level is easy (2008) by majormajor on Thursday July 29, 2021 @11:22AM (#27997608)
The difficulties of backends usually come from one of these areas that I don't think you're giving proper credit:

- scale - a frontend shows one user's view at once, a backend may need to be updating state for millions of users without slowing anyone's experience down. But these sorts of things are somewhat different than just "backend code", it's often closely tied to infra and data designs, which doesn't necessarily look like "backend coding" but is critical to make the rest work.

- business logic complexity - often the backend teams are tasked with working with frontend to figure out a simple, user-friendly API surface for the app and also to figure out how to make that work with the various not-written-down, not-even-fully-enumerated business logic permutations and backend-data permutations that could be going on. If they do their job right, the frontend can show different screens with values from the API ready to plug in for a particular scenario without having to worry about the combinatorial rules behind the scenes that led us to want to show the user THIS screen instead of any other one. The difficulty there isn't a mathematical or "hard" one, it's that the product team probably has no idea just how gnarly the set of business rules they sketched out actually gets. A backend has to support everything the frontend client can do today, but often ALSO support a bunch of things the public frontend apps don't yet do (whether this is for admin tasks, or for future readiness, or what).

I'm not sure I see the significance of the number of symbols in UIKit - you usually don't need all of them, I assume, and I know that there are some common patterns that get re-used a lot. Is it so different from in backend when there are dozens of databases you could choose, and a bunch of frameworks for each of a bunch of different languages you could choose, but for most problems it's not going to make a huge difference?

One thing that often hides the difficulty on backend is that the frontend team might be interacting with just one or two backend teams that then interact with a different set of teams behind them, etc. But the true "backend vs frontend" question has to include ALL of those teams, even the ones you don't directly interact with, since they're all in the critical path.

"Hard frontend problems are harder than easy backend problems" - ok, sure. But that's not a very interesting comparison.

Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @11:27AM (#27997664)
Someone else has already mentioned in this thread that backends only ever interact with other programs, not humans. This fact alone makes it easier to design, implement and scale. And like I said elsewhere it is in fact so much easier that a backend can be built to be 100% correct and bug free, while for any more or less interesting and useful frontend it is practically impossible to achieve.
Re:Low level is easy (2008) by majormajor on Thursday July 29, 2021 @11:31AM (#27997718)
That's nonsensical. User input is passed to backends all the time, and results in just as many difficulties there. From SQL injection and other "untrusted input" problems, to dealing with migrating five years worth of user data to a new system because the old backend can't keep up, to trying to keep every piece of data in a consistent state.

Look at CAP theorem: it literally says "you can't have a perfect system here, you have to choose." That's a backend problem with literally no "100% correct and bug free" answer!

(With regard to the original article here, your error is that you're assuming modern backend software is closer to "low level" than "high level" compared to frontend code. It really isn't. And in terms of running your code, it's often at a HIGHER level than an app running directly on a user's device - you're in containers on VMs on someone else's hardware in a cloud environment, say.)

Re:Low level is easy (2008) by klodolph on Thursday July 29, 2021 @01:38PM (#27999108)
I think the CAP theorem is a bit overstated. It’s not, “You can’t have a perfect system,” but “You can’t have a system which is both available and consistent during a network partition.” True, and interesting, and useful to know, but if “100% available” is in your requirements to begin with, you are doomed to fail and the CAP theorem is just more nails in the coffin.

To me, the “you can’t have a perfect system” is really just, “You can’t have 100% availability, and you can’t have 100% durability either.” The hard part is then convincing the users of your system that even though your system seems perfect, they should be prepared for it to fail.

IMO the backend API solution is somewhat easy. 503 Service Unavailable. Then the front-end needs to somehow present a meaningful error message to the user, with a plan for how the user can accomplish their desired action or at least save their state and try continuing later… which can get insanely complicated…

Re:Low level is easy (2008) by majormajor on Thursday July 29, 2021 @03:29PM (#28000371)
If your backend is frequently throwing 500 errors and "convince the users of your system that this is OK" flies with your management, sure, backend is easy!

But that's often not the requirement... 100% available isn't the requirement per se either, but "as available as possible because outages cost us $XXXX/minute" is. And pushing that number up is HARD.

And remember the context of this thread: we have a claim here that backend IS easy and that it CAN be "100% correct and bug free." Saying this allows for random-ass 500 errors whenever stuff is broken is such a huge copout as to make that original claim meaningless.

Re:Low level is easy (2008) by klodolph on Thursday July 29, 2021 @06:01PM (#28002028)
> If your backend is frequently throwing 500 errors and "convince the users of your system that this is OK" flies with your management, sure, backend is easy!

Strawman argument. I think you’re responding to something I didn’t write. The argument is kind of absurd.

> …but "as available as possible because outages cost us $XXXX/minute" is.

“As available as possible” is not a reasonable requirement. If this is your requirement, you’re in deep shit, but for different reasons. The problem is that you can generally spend more money to get more uptime. At some point, you have to say that the cost of more uptime is too dear.

You can do experiments, testing, and simulation to get a more quantitative handle on the trade-off between uptime and resources spent. If you care that much, that is. But “as available as possible” is a bad requirement because there’s no way to tell if it’s satisfied.

What ends up happening is that people unsatisfied with uptime can blame you for not having enough uptime, but they aren’t telling you how much is enough. The purpose of having a requirement is to record an agreement between different teams about “how much uptime is enough uptime”. It can be the wrong number, and it can be revisited, but if it’s not a number (with a way to measure it), you won’t be able to calculate other numbers like “how many database replicas do I need?”

> And remember the context of this thread…

I’m responding to the CAP theorem bit. You said that the CAP theorem means, “you can't have a perfect system here, you have to choose”, and I think that this is misstating the CAP theorem.

> Saying this allows for random-ass 500 errors whenever stuff is broken is such a huge copout as to make that original claim meaningless.

503 errors aren’t random. They happen when the backend is unavailable. It’s not a random “stuff is broken” error—that’s 500.

This is not a cop-out. Services will sometimes be unavailable. The 503 status is the correct way to signal this to the front-end. The fact that the back-end returns a 5xx series error code does not mean that there is a bug in the back-end.

Likewise, if the service is important enough, your front-end should be able to respond to a 503 error with some kind of reasonable workflow for the user.

Re:Low level is easy (2008) by jensensbutton on Thursday July 29, 2021 @12:19PM (#27998206)
Backends also need to design/build for their operators.
Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @12:15PM (#27998160)
A lot of the times the part of the backend that renders pages and handles user input can be assumed to be part of the frontend, I'm not talking about those. I meant backend as an API.

I honestly think you've never built a decent sized, non-trivial mobile app for example, and you probably have no idea how tedious and difficult it is to produce something that will be pleasant for the users to deal with.

Re:Low level is easy (2008) by majormajor on Thursday July 29, 2021 @03:31PM (#28000389)
I mean, if you say "parts of the backend are actually the frontend"[0] and "parts of the backend area actually the infra" and say "backend" is just a CRUD api that talks to a database: sure, that can be easy. But I've rarely seen backend jobs that don't require touching the 90% of the iceberg that's underwater...

So it's a stupid definition. I haven't built a large mobile app, but I'm not claiming frontend dev is easy.

You're claiming backend dev is easy but your argument so far reduces to "it's easy because the hard parts actually aren't part of it" which is tautological and pointless. You're not even just claiming it's easy, you're claiming it can be built 100% correct and bug free.

What's the most complicated backend system you've built? What database, what user scale, what traffic scale, what technologies, what servers, etc?

[0] the part of the backend that renders pages, if one exists, and the part that validates user input should be VERY VERY different components, anyway...

Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @05:20PM (#28001639)
Hundreds of thousands of daily active users, I built both the backend and the mobile app. I think I'm familiar with common problems on both sides. Trust me, dealing with UI platforms is orders of magnitude more pain in the arse if you set the quality standards to the highest. Even the codebases were approx. 1 to 20-25.
Re:Low level is easy (2008) by valenterry on Thursday July 29, 2021 @07:52PM (#28002948)
A big difference still stays: a frontend (and that includes SPAs, mobile apps and desktop applications) is essentially restarted all the time.

If I screw something up in the frontend, then in most cases, I can fix it and people use the new version / reload the page and that's it. In backend, if I screw up, in most cases I now have a data problem and an ongoing problem that might only be fixable through an operational update. I might even have lost/overwritten data that is not recoverable or only through backups.

Sure, this can happen on the frontend too (e.g. sending a wrong update command to the backend API or when storing some data/configuration directly in the browser) but from my experience it is much much more likely to happened in the backend and if it does, it is more severe.

This doesn't make things more difficult on the technical side per se, but it slows things down a lot. I can't count how often I wished to be able to just truncate all user data and start with a fresh plate, instead of with a long, messed up user data history that contains quirks, fixes/workarounds in the data and that I have to stay compatible with and not forget.

Re:Low level is easy (2008) by dahfizz on Thursday July 29, 2021 @01:31PM (#27998998)
A backend dev may argue that the frontend is complicated _unnecessarily_. You don't need your bloated, complicated frameworks. In most cases, website would be better for the end user if you stopped trying to over-design the frontend.

Frontend is hard so we use lots of frameworks which makes frontend hard so we use some more frameworks.....

Re:Low level is easy (2008) by gedy on Thursday July 29, 2021 @11:24AM (#27997632)
> The attitude of the backend people of looking down upon frontend people is really stupid and unsubstantiated.

Agreed, personally when I've heard this, it's frequently due to the "backend" devs really struggling with the complexity of user interface needs, especially UI state. This is the root of a lot the "JavaScript is such a trainwreck" type comments too.

Re:Low level is easy (2008) by closeparen on Thursday July 29, 2021 @08:24PM (#28003133)
One problem may be that building specific units of product functionality is considered junior-level work. Doing so quickly and with high quality can get you a nice $20,000 bonus, but not the $200,000 RSU bump associated with promotion to the next level.

A higher level engineer is meant to "scale her impact" by owning the architecture, the platform, the playground in which other engineers live. In backend world there are opportunities to do this in nearly any business domain or sufficiently complex problem. But a company only needs so many UI frameworks. As such we see very good, long tenured mobile and frontend engineers simply cranking out feature after feature. There's no career progression that way.

Re:Low level is easy (2008) by jayd16 on Thursday July 29, 2021 @12:41PM (#27998417)
>The attitude of the backend people of looking down upon frontend people is really stupid and unsubstantiated.

I think the high horse is because frontend dev is hard. The backend has more methodical tooling. Javascript is not considered a clean language even if it has improved.

It would be nice if you could use clean modern tools but the web is forced to support legacy browsers so it is what it is.

I personally like the full stack and don't look down in either direction, but I understand the sentiment.

Re:Low level is easy (2008) by spdionis on Thursday July 29, 2021 @03:17PM (#28000257)
I don't think backend people deny frontend is hard. The problem is frontend is hard for all the boring reasons.
Re:Low level is easy (2008) by api on Thursday July 29, 2021 @06:04PM (#28002046)
The most annoying thing about frontend is the shifting sands. Not only is it complex but APIs, browsers / windowing systems, OSes, and UI/UX fads are constantly shifting. You often have to rewrite the damn thing every few years or it looks "old," and when people see apps that look "old" they assume they're not maintained or are of low quality.
Re:Low level is easy (2008) by tux3 on Thursday July 29, 2021 @10:14AM (#27996806)
>If you don't believe me, UIKit alone exposes I think about half a million public symbols.

That's interesting, do you have a source for this?

For reference the Qt5 framework only has about 25k publicly documented functions and the shared libs expose ~100k symbols.

Re:Low level is easy (2008) by blacktriangle on Thursday July 29, 2021 @10:16AM (#27996830)
I think that passes the smell test. They're at the same order of magnitude and UIKit includes a ton of optional functionality that is situationally used where Qt would likely pull in a 3rd party lib.
Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @10:59AM (#27997313)
Honestly I don't remember but someone counted all the public symbols which included constants too.
Re:Low level is easy (2008) by sdevonoes on Friday July 30, 2021 @04:44PM (#28012149)
> Backends are so much easier to build compared to frontends, and I mean decent and reliable ones.

Backend:

- running a migration on a table of 100 million rows... in MySQL 5.6. Well, things can get complicated.

- building the infrastructure and monitoring of a k8s cluster

- debugging concurrency bugs

I think these topics are not really easier than their frontend counterparts. I do believe some aspects of frontend development are harder than some of backend development (and the other way around). I do not think, in general, that "backends are so much easier to build compared to frontends" though.

Re:Low level is easy (2008) by jensensbutton on Thursday July 29, 2021 @10:10AM (#27996754)
> Backends are so much easier to build compared to frontends, and I mean decent and reliable ones.

Evidence would suggest otherwise. I can build a decent and reliable frontend with a no code solution. That's not to say frontend is "easy", just that trying to say which is harder is ridiculous. They're different.

I personally don't like working on frontends because it feels like getting on a hamster wheel that spins faster than in any other domain. ymmv though.

Re:Low level is easy (2008) by thrashh on Thursday July 29, 2021 @11:27AM (#27997673)
A backend can just say ‘no’ if it gets a number in a format it doesn’t like.

If a user enters a number incorrectly on a frontend, a frontend can’t just say no. It might have to try its best to parse the number, or if it can’t, the error has to be presented in a user friendly way. A frontend can’t just throw an exception and say Bad Request.

Re:Low level is easy (2008) by kennywinker on Thursday July 29, 2021 @12:43PM (#27998437)
> If a user enters a number incorrectly on a frontend, a frontend can’t just say no.

Followed by the distant sound of enterprise, banking, and government frontend devs laughing.

Re:Low level is easy (2008) by foo_barrio on Thursday July 29, 2021 @01:19PM (#27998869)
I disagree. Have you ever worked in finance? Inconsistent or unexpected number/date formats have to be dealt with. And to add to it, the formats can be binary and not just text that you can look at it and sort of "figure it out". Often times these files are coming from other large institutions and getting them to fix their data takes days if ever. In the mean time there is daily processing that has to get done in order to trade at the next day's opening.

A system can't just reject data it doesn't like.

Re:Low level is easy (2008) by iamricks on Thursday July 29, 2021 @11:56AM (#27997981)
Or you just send the input to the backend and have the backend tell the frontend to tell the user "backend said no"
Re:Low level is easy (2008) by mojuba on Thursday July 29, 2021 @11:10AM (#27997449)
> I can build a decent and reliable frontend with a no code solution

Things that can be built that way are not interesting. Of course you can just assemble online stores without writing a single line of code, but that's not exactly programming. We are talking about frontends that have some sort of novelty or at least non-standard flows in them.

Re:Low level is easy (2008) by jensensbutton on Thursday July 29, 2021 @12:13PM (#27998136)
The parent made no such distinction. And your comment applies to just as much to backends as frontends. If a backend is "easy" to make reliable then it's probably not very interesting.
Re:Low level is easy (2008) by woah on Thursday July 29, 2021 @10:58AM (#27997305)
Seems like you don't know much about building frontends.
Re:Low level is easy (2008) by jensensbutton on Thursday July 29, 2021 @12:14PM (#27998143)
Sounds like you don't know much about building backends.