• Feathercrown@lemmy.world
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    2 days ago

    If you care this much about JS being cringe I don’t trust you to contribute good code to a project anyways

  • Korhaka@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 days ago

    Unless you are making a HTML/CSS only site (based) what do you want to use instead?

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      2 days ago

      Invent a new internet where you can script pages directly in Python or TypeScript.

      Otherwise, you get to enjoy a silly toy language from the 90’s.

      • CarrotsHaveEars@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        I’m 100% sure I can make Rust code (not even compiled to WASM) run natively in a browser like Firefox, given I have enough will power, time, energy, and money. The problem is getting everyone else to agree to this new standard.

        • CanadaPlus@lemmy.sdf.org
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          22 hours ago

          In a scripting language, is there an advantage to no garbage collection? (I honestly don’t know)

          Someone else also pointed out to me, when I made a similar suggestion, that ability to partially fail but keep going is desirable in a web context. I don’t know, maybe there’s some way to make Rust do that more automatically than C. Python seems the be the standard for general-purpose scripting, which is why I mentioned it.

  • moseschrute@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    2 days ago

    Genuinely curious, how many of you hating on JS have done professional frontend work recently? If you have done professional work, was it part/full time, using TypeScript, how big was your eng team, did you have to worry about Server Side Rendering?  Maybe some extra context will show certain types of projects yield devs that hate the language.

    • moseschrute@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      2 days ago

      You’re not wrong, but newer version of the language have steered devs away from these quirks. The quirks remain because the JavaScript language is 100% backwards compatible. It’s fun to laugh at these quirks, but I’ve been a full time JavaScript developer for 4 years and part time since 2015, and I’ve never seen any of these quirks come up in the real world. If you tell your developers to use === instead of == in code review, you eliminate most of the problems imo.

      JavaScript tooling deserves more hate imo. The ecosystem is kinda a disaster, but Vite is making a lot of progress in fixing that. If you ignore React Native and metro bundler, I think the state of web is looking pretty optimistic right now. At least from a technology perspective. From a business/AI/enshitification perspective we’re cooked lol

    • el_abuelo@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      2 days ago

      this quirkiness doesn’t materialise in real world applications on any scale that makes it harder to deal with than the alternatives.

    • jpeps@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      I got a little under half in the first two, which I’m very happy with haha. JS certainly has some quirks, but you’ve really got to go looking for them IMO. TypeScript resolves most of these issues with comparing types, and the rest aren’t that unique to JS.

  • melfie@lemy.lol
    link
    fedilink
    arrow-up
    50
    arrow-down
    1
    ·
    3 days ago

    I worked in heavy JavaScript codebases back in the IE days and wasn’t too crazy about it. Then JIT compilers like v8 came along and made it run a lot faster and TypeScript also made it more usable for larger codebases. I now consider TypeScript among my favorite languages. I’ve also written a lot of Go lately, and while I appreciate its speed and smaller memory footprint, the missing language features kind of grate on me and I don’t mind taking a bit of a performance hit for the (IMO) superior ergonomics of TypeScript, especially for workloads where I/O is more of the bottleneck than compute.

    • sip@programming.dev
      link
      fedilink
      arrow-up
      17
      ·
      3 days ago

      agreed. typescript is excelent, especially if you make it strict and know a bit of complex types to make sure things stay put.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        3 days ago

        Chiming in as a professional TS dev. It’s really a joy to do web dev work in the post TS world.

        • biggeoff@sh.itjust.works
          link
          fedilink
          arrow-up
          4
          ·
          2 days ago

          What do you think of JSDoc? As someone who knows neither I find the idea of no required transpilation very appealing, while still getting the TS ecosystem tools.

          • Victor@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            2 days ago

            JSDoc is much more cumbersome than using TypeScript. That’s it. It clutters the code in a way that TypeScript somehow avoids. TS types are smoothly integrated in the code itself, IMO. Not as much the case with JSDoc.

            • biggeoff@sh.itjust.works
              link
              fedilink
              arrow-up
              4
              ·
              2 days ago

              Thanks! As a hardware guy it’ll be a long time before I do anything with this information. Nice to hear the opinions of actual Devs.

              • moseschrute@lemmy.world
                link
                fedilink
                arrow-up
                2
                ·
                2 days ago

                I suspect most Lemmy users hating on JS haven’t done much professional JS work. Especially these days with TypeScript and all the modern conveniences.

                I’m curious, what kinda hardware do you work on?

                • biggeoff@sh.itjust.works
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  2 days ago

                  Digital hardware, mainly top-level design in verilog and associated checks using python/perl (sad)

                  Right now working on a GPU which is fun!

              • Victor@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                2 days ago

                Ah alright 🙂 My pleasure! Yeah I wouldn’t even consider JSDoc if I had the choice of TypeScript. I even did some years of Advent Of Code in TypeScript. It’s performant enough and simple to employ some kind of quasi functional programming style with it. I think it’s great.

                • moseschrute@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  2 days ago

                  I think Rich Harris famously migrated Svelte from TypeScript to JSDoc, while still supporting TypeScript via JSDoc. I don’t use Svelte, so I have no idea how well this works in practice. However, Rick Harris seems smart to me, unlike other overly opinionated devs like DHH. I still wouldn’t use JSDoc over TS, but I guess if it works for your project, who cares. What matters is that we all remember the one true enemy, DHH

            • biggeoff@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              2 days ago

              Being honest, I’m an outsider looking in. Most likely these things are solved problems, but alternates are always interesting to hear insider opinions on.

              Sounds like it’s developer experience Vs required post processing in this case, which is a reasonable tradeoff to think about

        • sip@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          2 days ago

          i wish a more performing language would have this type system. the only other ones I know are Rust which is a bit strict and slow to dev on, and Haskell which is too much.

            • sip@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              2 days ago

              I asked chatgpt for a few languages with a good typesystem and it suggested ocaml among other (scala, rust, haskell, f#)

              Then asked for a 100 line ocaml REST API example with a popular framework and db lib… and it looks mostly like Haskell.

              edit: async is done with monads

              • Victor@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                2 days ago

                If it looks mostly like Haskell but has better tooling, I’m in. I have yet to manage to successfully set up a Haskell environment on my own PC. 😅 I am obviously missing something.

                • sip@programming.dev
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  2 days ago

                  I used it either through my distro’s package or using stack install. there’s also cabal install, but that doesn’t install the compiler, at least not in 2017 when I played with it.

    • RagingRobot@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      It’s funny because I learned to program with strongly types languages and when I moved over to JavaScript I always complained about it for the longest time but now that I use mostly typescript at work I kind of miss some of the old JavaScript patterns and their flexibility. But for working with large teams or large projects in general it’s nice to have typescript

  • Redkey@programming.dev
    link
    fedilink
    arrow-up
    57
    ·
    3 days ago

    JS has saved me many hours of mind-numbing, error-prone manual keyboard work by giving me a way to hack together a simple bit of automation as a web page.

    Even when a computer has been ham-fistedly locked-down by an overzealous IT department, I can almost always still access a text editor and a browser that will load local HTML files.

    • TeamAssimilation@infosec.pub
      link
      fedilink
      arrow-up
      56
      arrow-down
      22
      ·
      edit-2
      4 days ago

      Real programmers will write in a way that user’s resources are not being wasted because you need a full browser, a JS runtime, and DOM juggling, to show even the simplest application.

      It’s not rare for simple JS applications to consume over half a gigabyte of RAM on startup, and way more CPU than their native counterparts. That this was normalized and even defended is stupid.

      • hperrin@lemmy.ca
        link
        fedilink
        English
        arrow-up
        52
        ·
        3 days ago

        I think you’re thinking of Electron apps, but that’s not really a criticism of JavaScript, that’s a criticism of Electron. There are plenty of JS platforms that don’t require a browser/DOM. React Native is the biggest example. Also, GJS if you want native Linux apps.

        • CarrotsHaveEars@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          1 day ago

          But why Node? Node cost five seconds just to start up back when I worked on my embedded ARM v7 platform, and on modern x86_64 computers, npx anything takes just as long. Why rely on another runtime? Why not native binaries instead?

          • Azzu@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            20 hours ago

            Because you have to figure out how to build them. And with that I mean, how do you make sure that whatever you’re doing will work and work the same way not only on your “embebbed ARM v7” architecture and all the other CPU architectures, but also the operating system libraries included? How do you make it work the same way on Mac, Windows 7, Windows 11, Ubuntu, custom Arch installations, FreeBSD, etc etc?

            If you build native binaries, you personally are the one who has to make sure it runs. This means (depending on how much you want to support) a lot of development or support time. (Or you make your users build it themselves and fix errors, which means a massively reduced userbase, good luck with adoption…)

            If you use Node, (or other virtual machines) you literally don’t have to do anything, because it just works.

            You really don’t see the value in that?

            • CarrotsHaveEars@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              19 hours ago

              What you mentioned is compatibility across platforms. A program written in C is also guaranteed to run on all the systems you mentioned, given that the system has a C compiler and libc that stick to the standard. You, the programmer, does not have to anything to “make sure” your program works.

              See this insane list of platforms GCC supports.
              https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Architectures

              We’ve invented high-level programming languages like C 53 years ago, just to get away from assembly, and to avoid dealing with the “cross-platform” problem you mentioned, remember?

  • SethranKada@lemmy.ca
    link
    fedilink
    English
    arrow-up
    54
    arrow-down
    7
    ·
    4 days ago

    Feels the same whenever a project is written in python, but I uninstall it too.

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      4
      ·
      3 days ago

      The Cinnamon desktop environment found in Linux Mint uses JavaScript on the back-end. My knowledge doesn’t extend much beyond that (other DEs, and what they do, nor the full extent of JS in Cinnamon), but I did look at it at one point.

      Makes me wonder if OP was talking it about that in particular or if there’s some other project with a bundled JS interpreter they decided not to work with.

  • addie@feddit.uk
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    3 days ago

    I’m in this photo and I don’t like it.

    More specifically, my programming background is in industrial automation and I’d like to add some more ‘robust and flexible’ algorithms to CoolerControl so I can control my system fans / temperature better, but it’s written in a mix of TypeScript and Rust.

    I’ve spent 20 years programming hard real-time z80 assembly and know quite a few higher-level languages. (Although I prefer the lower-level ones.) Not those ones, however, so it’s not just a couple of hours work to raise a PR against that project. Going to need to crack some books.

    • thevoidzero@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      3 days ago

      I don’t know what you mean by supports tray but have you tried KDE connect? It has a lot more features than just sending files but I use it for a few things.

      And if you don’t care about having GUI, I love miniserve for sharing files. It’ll open a web server and you can connect to it to download/upload files.