• JPAKx4@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      Backend code, basically what is ran on the server and manages user requests, database interactions, etc… Frontend is the user end, so managing input, displaying information from server requests, etc. and is in the form of an app or website page.

    • JasonDJ@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      As a network guy…open up your favorite web-managed application and open the developer console. Inspect the transactions you see and compare it to the applications REST API reference, and you’ll likely find a lot of commonality (and maybe some undocumented endpoints!).

      Backend made the API and everything that is performed by it. Front end is doing the GUI based off the response and promoting for input.

  • toastal@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    You can write a stateless server. You can’t do stateless front-end since you have to deal with user interaction.

    • areyouevenreal@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I would not be so sure. Maybe for a static web page this is possible. Outside of that I think people are kidding themselves. Writing code that might be stateless in isolation but relies on a database isn’t a stateless server imo, it’s just outsourcing state to another service.

      • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        With the SPA approach, you can have remarkably little state on the server because all the state associated with the user session lives on the frontend. The value of doing this obviously depends on the type application you’re making, but it can be a sensible approach in some cases.

        • uis@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          In many pages application url already bears part of state.

          • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            Sure, but that only gets you so far. I think it’s important to distinguish between document sites where the users mostly just views content, and actual applications like an email client or a calendar. The former can be easily handled with little to no frontend code, however the latter tend to need non trivial amount of UI state management.

        • areyouevenreal@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          Doesn’t SPA require polling the web server for more information? I feel like any website which retains information outside of the client device (like anything with a login page) would require state to be stored somewhere on the backend.

          • bitfucker@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            What kind of polling are we talking about? If you are talking about realtime data, SSE doesn’t solve that either. You need SSE or WebSocket for that (maybe even WebRTC). If what you mean is that every time the page is refreshed then the data is reloaded, it is no different than polling.

          • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            Typically, you just have a session cookie, and that doesn’t even need to be part of the app as auth can be handled by a separate proxy. The server just provides dumb data pull operations to the client in this setup, with all the session state living clientside.

            • areyouevenreal@lemm.ee
              link
              fedilink
              arrow-up
              0
              ·
              5 months ago

              That data has to be stored somewhere though. So you would still need some kind of database server to store it all or some other solution. That’s what I mean by outsourcing state. Data is still stored in the backend, just in a database rather than a web server.

              • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
                link
                fedilink
                arrow-up
                0
                ·
                5 months ago

                There is data that gets persisted and needs to be stored somewhere, and then there’s the UI state that’s ephemeral. The amount of data that gets persisted tends to be small, and the logic around it is often trivial.

      • sandman@lemmy.ca
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        Yes! Let the user resize the window if they want it take up half their screen!

  • flashgnash@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    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

    • sandman@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      5 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.

      • xthexder@l.sw0.com
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        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

        • traches@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          5 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.

        • bitfucker@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          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
            link
            fedilink
            arrow-up
            0
            ·
            edit-2
            5 months ago

            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.

        • flashgnash@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          5 months ago

          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

          • body_by_make@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            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
              link
              fedilink
              arrow-up
              0
              ·
              5 months ago

              Yes I mean react native

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

              • body_by_make@lemmy.dbzer0.com
                link
                fedilink
                arrow-up
                0
                ·
                5 months ago

                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
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  edit-2
                  5 months ago

                  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?

    • uis@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

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

      • flashgnash@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        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
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          5 months ago

          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 functionprintf(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.

  • Cysioland@lemmygrad.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I feel (as a fullstack developer) that letting websites run arbitrary code in your browser was a mistake.

  • Seigest@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months ago

    Often me. I make tools/interactions for learning management systems. So the back end is a thid party I have no controll over. Just take the api and make the magic happen.

    You need me to save data somewhere but don’t want to buy server space? Sure we can cram that into places it’s not ment to go within the system. It will slow things down and likly cause issues but it’s free.

  • Hugh_Jeggs@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    I didn’t read the community name and wondered who tf thought the back end of a goose requires more attention than the front end

  • lorty@lemmygrad.ml
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Backend developer: “The new functionality is done!” PO: Looks at tests “Seems good, ship it!”

    Frontend developer: “The new functionality is done!” PO: Looks at his screen “This spacing could be a little to the right, also I think I didn’t really like this text, also it should probably auto-scroll to the top and this button should change colors when I click it and also don’t forget to change the error messages I was happy with before and also I think it should…”

  • Honytawk@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    If that were true, you’d have more front end devs being able to do backend instead of the other way around.

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      These are completely different types of skills. Front end is complex because there’s an explosion of different states driven by how the user interacts with the UI. On the other hand, backend workflows tend to be a lot more structured. You get a request, do some processing, fetch some data, and return a response.

          • CanadaPlus@lemmy.sdf.org
            link
            fedilink
            arrow-up
            0
            ·
            5 months ago

            I’ve made UIs, and at least one I’d say was complex, but it was also really ugly. What am I missing?

            This wasn’t a put-down, BTW. I couldn’t be a graphic designer either.

            • Grandwolf319@sh.itjust.works
              link
              fedilink
              arrow-up
              0
              ·
              edit-2
              5 months ago

              How about UIs that are essentially web apps. I’m talking about needing to handle drag and drop, graphs and the like.

              There is also the mess that is responsive design, multi browser support and proper accessibility.

            • Ethan@programming.dev
              link
              fedilink
              English
              arrow-up
              0
              ·
              5 months ago

              Making good UX is fucking hard. I say UX because making it good is really about the user’s experience, not graphic design. An ugly front end can be good if it’s intuitive and easy to use. But a visually gorgeous front end will still be garbage if it’s clunky and confusing.

              It’s really something you have to experience to fully understand. Ultimately it comes down to this: front ends have to deal with people, backends only have to deal with computers. So backends can be cleanly organized and well structured. Applying backend design principles to a front end will get you a CRUD interface - something that’s usable but no one really wants to use.

              • hglman@lemmy.ml
                link
                fedilink
                English
                arrow-up
                0
                ·
                5 months ago

                You need to be able to do layout design to do good ux. The visual presentation is a critical aspect of usability. Also backend code needs to be consumable future readers (including the author). That’s something that is very often lost and you get terrible unorganized backed code.

            • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
              link
              fedilink
              arrow-up
              0
              ·
              5 months ago

              The complexity of dealing with different states a UI can be in. The user can navigate the interface of an app in many different ways. The US has to be able to handle all the different combinations of actions the users takes. This means maintaining a consistent state, loading data that’s needed, keeping track of navigation, etc. The logic in an interface of an app like an email client is far more complex than most backend workflows.

              • xmunk@sh.itjust.works
                link
                fedilink
                arrow-up
                0
                ·
                5 months ago

                I mean… the browser can do all that shit itself, just give it some HTML and stylesheets. It’s incredibly important to realize that nearly all this complexity is optional - it may make sense for Facebook to invest this much in a UI but most companies could get away with plain ol’ html with a bit of styling.

                As a front end developer you should know when things like infinite loading dynamic tables with a search bar add significant value and when <table> is good enough. Maintaining complex systems costs money and developers should always advocate for the simplest most sustainable solution to a problem. I think we have a real issue with pursuing shiny new technologies.

                • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  5 months ago

                  I mean… the database does all the shit itself, just give it some SQL queries. It’s incredibly important to realize that nearly all this complexity is optional - it may make sense for Facebook to invest this much in their backend infrastructure but most companies could get away with plain ol’ script that on top of Postgres.

                  As a backend developer you should know when things like load balancing and and complex db schemas add little value, a single table is good enough. Maintaining complex systems costs money and developers should always advocate for the simplest most sustainable solution to a problem. I think we have a real issue with pursuing shiny new technologies.

                • pingveno@lemmy.ml
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  5 months ago

                  A simple web app will be okay with some HTML forms, sure. But something like a multi step wizard will lead you down the path of storing a huge amount of state on the server side, which turns into a mess. We have a wizard that uses Django’s forms and django-formtools’s wizard. You have to put the state and complexity somewhere. We put it in the backend and I can’t say I like how it turned out. The code is spaghetti and we get a stream of errors from people not acting how they’re expected to act.