[–] [S] 31 points 3 weeks ago (6 children)

React works by maintaining a virtual representation of the DOM. When you dispatch state changes into the virtual DOM react can determine which components depend on the change and which side useEffects run.

My gripe is that YouTube tutorials teach that the useState is the equivalent of a variable. This encourages average developers to problem solve solutions that end up using React's Virtual DOM for business logic. The YouTube tutorials have react devs planting 100s of useStates - some of which don't directly induce a visible-on-screen rerender - and then ⅒ as many useEffects to bind these states together. This means that for the Virtual DOM to come to the conclusion as to what html elements need to be changed and how it has already mutated 20-50-100s of times and the CTO tells me the react app is slow and they're mad.

If 2 states have the opportunity to mutate each other back and forth then the truth is that you have 2 perspectives of the same state. And React gives you solutions for that - proper solutions - the useReducer hook is for defining these complex state mutations and the Context API for communicating that state to any component.

And this has me quintuple pissed off because these same tutorial grade react devs install REDUX as compulsively as a pack-a-day smoker (that's #3). They use Redux to file variables in JavaScript memory (that's #4) like it's a global variable and rarely if ever use it for the complex state mutations they need instead I've seen react devs write components pull state out of redux into a component just so it can mount useEffect and process the state and dispatch the result back into redux. Let's not even bring up how the react-redux binding library literally uses the React Context API (that's #5).

  • source
  • parent
  • context
  • [–] 1 point 1 month ago

    Honestly sometimes I'm not even sure if I'm in a gay bar. I live in Bushwick and I'm told this is supposed to be the gay capital of Brooklyn and I don't see it, there are just !men all over the place.

  • source
  •  

    I cannot watch TikTok or YouTube shorts or Instagram reels anymore.

    When it comes to having any degree of comprehension as to why these apps insist on making me so angry I feel like I cannot characterize myself as anything better than a plank of wood.

    I don't understand who is benefiting from this relationship because clearly I'm not. Every time I stop scrolling on tiktok or YouTube I am so angry I cannot focus on my job! I can't decide what to do next! I can't do anything!! I'm not even clicking on ads, I've bought a couple of things from TikTok that are ok,, prices are sometimes better on tiktok,,

    But if I watch one more:

    • CPS worker try and fail to kidnap children
    • Any sort of religious debate though most of the ones I'm getting are about Jesus and convincing people that Islam is real or not
    • Narrated stories from Reddit
    • Ella Boyett (the hiiiiiiiii Karen with the wig)
    • Any skits about customers misbehaving at businesses
    • Instructional recipe videos formatted in discovery-speak, for example "when you add this to this and add this to this and mix and bake you get this"
    • Sheffield Jew hunt awareness videos
    • Videos about how gross immigrants might be behaving in European cities
    • NYC, Dearborn Mi, Lakewood Nj
    • Anything involving screaming
    • Video recording strangers crashing out
    • Crashouts in general actually
    • Videos of people whining about something that they're psyoped to believe they need in their life
    • Tiny accounts with less than 100 followers making lukewarm observations

    I will actually be in a state of life or death emergency. Like I'm not even being facetious or obtuse I just deleted tiktok before I started writing this and I don't feel safe.. I'll feel better in a little bit.

    I just can't remember the last time I watched something funny. I can't remember the last time I laughed on YouTube. I'm just miserable by nature and these apps aren't making it any better.

    I want to know what profit these algorithms are optimizing for. I feel like with me my algorithm might have reached a false valley way too soon and there's nothing I can do to dislocate it and have it try again, tiktok lets you reset your feed but YouTube doesn't really. But every time I reset my tiktok feed it always returns to the same exact shit, you can't even not engage with the same content you used to engage with because that's also considered engagement, swiping away too fast apparently counts as much as watching the whole thing through because you already know what it is therefore you interacted with it which is what the algorithm wants. I like algorithmically curated content sometimes, I like it when the algorithm is also really good which is something I used to say about tiktok but not now that it's trying everything it can to make me angry.

    Edit 2hrs later: all is well I'm okay. Turns out I kind of like reading horror manga. Junji Ito is pretty good, I can now say that I've read Frankenstein!

     

    I recently opened a new show and tell community for devs to share their projects but I can't see the posts when I access through community through programming.dev, but I can see when I access the community through lemmy.world. If I can't see the posts, I can't imagine that other people can see posts. I have not seen other communities with the same issue, I'm just wondering if there's anything I can do.

    Solution: if you set your account to hide read posts then the back end will not even serve the posts so it appears as though there are no posts. I'm such an idiot

     

    Just wanted to share this stupid little python script I wrote forever ago.

    I used way too much pythonic syntax just to make the caps lock and scroll lock lights on my old keyboard flash like the lights next to the network socket. I don't really use that keyboard anymore but I remember how excited I was to see for the first time when I write something to a file using vim or vs code or my own scripts to make something physical happen.

     

    inb4hope it's ok to advertise new communities here, thx!

    Hey everyone! I like writing code and I don't really have people in my circles who I can share my creations with so I opened a community for all of to beable to!

    Come share your all your git repos, hardware projects, inventions and more! We (i guess I rn) welcome all!

    https://programming.dev/c/show_and_tell

    And while you're at it, spread some stars around.

     

    inb4hope it's ok to advertise new communities here, thx!

    Hey everyone! I like writing code and I don't really have people in my circles who I can share my creations with so I opened a community for all of to beable to!

    Come share your all your git repos, hardware projects, inventions and more! We (i guess I rn) welcome all!

    https://programming.dev/c/show_and_tell

    And while you're at it, spread some stars around.

    !show_and_tell@programming.dev

    Edit: i tried to fix the link but !show_and_tell@programming.dev is not a valid url on the lemmy frontend, can't figure out what I'm doing wrong

     

    I bought this simple ass little macropad that uses real keyboard switches and for like a year I had no idea how to use it. There was no dirt simple file configed little command I can plant in my i3/config and be happy with it so I built it!

    It was my first attempt at building a production-level thing out of rust and I'm really happy with it. Now I can finally use my goddamn macropad!!

     

    Post:

    If you’re still shipping load‑bearing code in C, C++, Python, or vanilla JavaScript in 2025, you’re gambling with house money and calling it “experience.”

    As systems scale, untyped or foot‑gun‑heavy languages don’t just get harder to work with—they hit a complexity cliff. Every new feature is another chance for a runtime type error or a memory bug to land in prod. Now layer LLM‑generated glue code on top of that. More code, more surface area, less anyone truly understands. In that world, “we’ll catch it in tests” is wishful thinking, not a strategy.

    We don’t live in 1998 anymore. We have languages that:

    • Make whole classes of bugs unrepresentable (Rust, TypeScript)
    • Give you memory safety and concurrency sanity by default (Rust, Go)
    • Provide static structure that both humans and LLMs can lean on as guardrails, not red tape

    At this point, choosing C/C++ for safety‑critical paths, or dynamic languages for the core of a large system, isn’t just “old school.” It’s negligence with better marketing.

    Use Rust, Go, or TypeScript for anything that actually matters. Use Python/JS at the edges, for scripts and prototypes.

    For production, load‑bearing paths in 2025 and beyond, anything else is you saying, out loud:

    “I’m okay with avoidable runtime failures and undefined behavior in my critical systems.”

    Are you?

    Comment:

    Nonsense. If your code has reached the point of unmaintainable complexity, then blame the author, not the language.

     

    I just had a thought (*fuckup), ProgrammingHumor exists on multiple instances. I was wondering if it is possible as some part of multi-community scroll feature would it be possible to automatically fetch from the same community on as many instances as are known?

    Boost for Lemmy looks so professional and polished I kinda wish it was more of an aggregation software.

    Maybe in Boost for Lemmy Pro?

     

    Post:

    You have three switches in one room and a single light bulb in another room. You are allowed to visit the room with the light bulb only once. How do you figure out which switch controls the bulb? Write your answer in the comments before looking at other answers.


    Comment:

    If this were an interview question, the correct response would be "Do you have any relevant questions for me? Because have a long list of things that more deserving of my precious time than to think about this!

     

    I’ve noticed a pattern in my friendships that I’m struggling with, and I’d love to hear other people’s perspectives.

    Whenever I suggest something I genuinely want to do with friends, the plans always get changed around — often to fit schedules or budgets — until they no longer resemble what I originally suggested. By the time we meet up, I usually don’t enjoy the activity itself, though I still value being with my friends.

    This cycle tends to repeat:

    I suggest something → it gets reshaped into something I don’t want → we meet up but I’m bored/miserable → then we don’t talk for 6–12 months until someone breaks the silence.

    Recently, I’ve made a change: I started doing the things I enjoy on my own, without waiting for friends. For the first time, I’ve actually been happy doing what I love — but it also means I’m doing them alone.

    Part of why I’m trying this is because I’ve lost friends in the past from being visibly miserable all the time when I adapted to things I didn’t actually like. Honestly, it feels like for most of my life I never really chose my friends — I just adapted to the people around me. Now, I’d really like to choose friends who genuinely align with what I enjoy.

    So here’s my question: Is it wrong to want to choose my friends? How do you balance doing what makes you happy with maintaining friendships, especially if your happiness and your current friend group don’t line up?

    Any thoughts, advice, or personal experiences would be really helpful.

    ai disclaimerI'm going through a lot and instead of just dumping my feelings here I thought it would make more sense to have Chatgpt handle it.

    Here's the source chat but if you want to cite my words I'd prefer you just cite my post instead.

    Regardless I stand behind Chatgpt's output as my own words and am accountable for it as though I wrote it.

    view more: ‹ prev next ›