this post was submitted on 26 Apr 2024
455 points (96.5% liked)

Programmer Humor

32568 readers
748 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] flashgnash@lemm.ee 41 points 7 months ago (3 children)

Made the mistake of using react for a mobile app and my god why is it this convoluted, why are the error messages always along the lines of "something went wrong with networking 🤷"

Unfortunately I'm stuck with it now

[–] lowleveldata@programming.dev 20 points 7 months ago (1 children)

react is better than the days when we jquery everything

[–] xthexder@l.sw0.com 8 points 7 months ago (3 children)

Am I the only one left writing pure JS webpages? I swear for the stuff I've done recently, adding React or even jQuery makes things 10x more complicated and bloated. The base JS support browsers have now is actually great. It's not like the old days trying to support every browser back to IE6

[–] bitfucker@programming.dev 4 points 7 months ago (1 children)

When you are writing some complex web app, you will wish you used a framework. Some web apps can have more than 50 pages with multiple states that depend on remote data to be locally cached and synced depending if you are online/offline. Framework can handle a lot of the heavy state management for you and even provide a nice UI component library. But I do agree that React is too much, but jQuery is being replaced by vanilla JS. That is why I usually use Vue. But for simple stuff, yes, Vanilla JS is pretty much good enough

[–] uis@lemm.ee 3 points 7 months ago* (last edited 7 months ago) (1 children)

No framework will make FSM for you. Managing state of web ui is not as hard as managing state of game.

Using TCP for networking? Loss, retransmit, lag, you're dead. Using UDP for networking? Loss, desync, you're dead. Sending full game state? Congestion, loss, lag, dead. Doing sync right, but still pushing too much data? Congestion, loss, lag, dead. Also keeping on server you need not only track game state, but what game state client confirmed to receive.

[–] bitfucker@programming.dev 1 points 7 months ago

Strictly speaking, the original commenter is talking about website but sure there is an FSM JS framework too (XState).

[–] flashgnash@lemm.ee 3 points 7 months ago (1 children)

I like base JS and I like jQuery. Only reason I'm using React is for native cross platform mobile/web but I'm beginning to regret choosing it for that

[–] Cqrd@lemmy.dbzer0.com 3 points 7 months ago (1 children)

I assume you mean react native, not react, unless you're using something like capacitor. React native is a far shot from react and is much more annoying to deal with.

[–] flashgnash@lemm.ee 1 points 7 months ago (1 children)

Yes I mean react native

Wouldn't be bothering with it if I were just working with web

[–] Cqrd@lemmy.dbzer0.com 1 points 7 months ago (1 children)

Using capacitor as a native shell for your web app can be very nice, actually. It lets you hook into native API calls and build native apps while hardly ever having to write native code, unless you want to, which presumably you don't since you're writing react native.

[–] flashgnash@lemm.ee 1 points 7 months ago* (last edited 7 months ago) (1 children)

Honestly doing it again I'd just write in xamarin or something not web orientated because as it turns out the web app is going to need to be separate anyway

I might look into capacitor but is that not basically just electron?

[–] Cqrd@lemmy.dbzer0.com 1 points 7 months ago (1 children)

I guess you could see it that way, but web views are inherent in mobile operating systems, they don't need to be bundled into your app, so capacitor apps aren't big bloated memory consuming applications like electron apps are. There's a lot of well made apps running on capacitor that you wouldn't even know, especially if you use something like ionic framework to actually have the look and feel of native mobile apps.

[–] flashgnash@lemm.ee 2 points 7 months ago (1 children)

Definitely need to look into this for future, would make dev so much easier to just write for web and not have to deal with react native's bullshit

[–] bitfucker@programming.dev 1 points 7 months ago (1 children)
[–] flashgnash@lemm.ee 1 points 7 months ago

Had a look at it, looked worse than react

[–] traches@sh.itjust.works 2 points 7 months ago

The biggest problem frameworks solve is “I need the value of this variable to be on the page and I need it to stay up-to-date.” If you don’t have this problem, or you only have it in a couple of places where hand-writing the necessary event listeners isn’t too arduous, then yeah you don’t really need a front end js framework.

[–] uis@lemm.ee 3 points 7 months ago (1 children)

Linux has better error messages. "Dazed and confused, but trying to continue".

[–] flashgnash@lemm.ee 5 points 7 months ago (2 children)

I am spoiled by dotnet and rust error messages. They tell you exactly what the problem is, where it is, and in rust's case sometimes even how to fix it

Then there's C with "segmentation fault"

[–] uis@lemm.ee 3 points 7 months ago* (last edited 7 months ago) (1 children)

and in rust's case sometimes even how to fix it

Then there's C with "segmentation fault"

  1. You are comparing compiler-generated errors and runtime errors
  2. Rust can trigger segmentation fault and bus error too.
  3. GCC's error messages are very detailed, sometimes can contain suggested solutions.

For example if I will try to compile helloworld without including stdio.h, gcc will warn implicit declaration of function ‘printf’(by default, almost everyone make it error with -Werror=) and will suggest note: include ‘<stdio.h>’ or provide a declaration of ‘printf’. And runtime error reports are as good as programmer makes them, no matter language program was written in.

I am spoiled by core dumps(although rust technically has them too).

Also in context of kernel, it will print stack trace and (if used) will kexec into another kernel that can make core dump or continue working.

[–] flashgnash@lemm.ee 1 points 7 months ago

I do not code in C it was just a throwaway meme lol

[–] onlinepersona@programming.dev 2 points 7 months ago* (last edited 7 months ago)

Then there’s C with “segmentation fault”

Successfully triggered a sea fan. (not me, another dude in the comments)

Anti Commercial-AI license

[–] sandman@lemmy.ca -3 points 7 months ago

I just have to say: designing a GUI in code in 2024 is asinine.

I feel bad for anyone who got suckered into learning convoluted bullshit like angular or react when they could've learned Godot or Qt.