Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. You typical Node project

You typical Node project

Scheduled Pinned Locked Moved Programmer Humor
67 Posts 47 Posters 24 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J [email protected]

    The package comes with all the bells and whistles but the final build only contains the tarp, if you import it right and tree shake it.

    M This user is from outside of this forum
    M This user is from outside of this forum
    [email protected]
    wrote last edited by
    #32

    This person nodes…

    1 Reply Last reply
    7
    • T [email protected]

      As the guy people come to when they've spent days banging their heads against a dependency conflict problem rather than delivering value for the business, I wish the folks on my team would take the proverb "a little copying is better than a little dependency" to heart a little more.

      M This user is from outside of this forum
      M This user is from outside of this forum
      [email protected]
      wrote last edited by
      #33

      Amen.

      I have sorted out so many JS dependency tangles for my team members, both front end AND back end, that I am loathe to import anything I don’t absolutely have no choice about.

      I will rewrite some stuff before I import it…

      1 Reply Last reply
      3
      • K [email protected]

        Depends on the use case, and what you mean by “external dependencies”.

        Black box remote services you’re invoking over HTTP, or source files that are available for inspection and locked by their hash so their contents don’t change without explicit approval?

        Cuz I’ll almost entirely agree on the former, but almost entirely disagree on the latter.

        In my career:

        I’ve seen multiple vulns introduced by devs hand-writing code that doesn’t follow best practices while there were packages available that did.

        I have not yet seen a supply chain attack make it to prod.

        The nice thing about supply chain attacks though: they get publicly disclosed. Your intern’s custom OAuth endpoint that leaks the secret? Nobody’s gonna tell you about that.

        W This user is from outside of this forum
        W This user is from outside of this forum
        [email protected]
        wrote last edited by [email protected]
        #34

        I didn't think I would have to spell this out, but when I wrote "as much as possible", I was acknowledging that some libraries are either too complex or too security-sensitive to be reasonably homebrewed by the unqualified. (Perhaps "as much as reasonably possible" would have been better phrasing.) Where the line lies will depend on the person/team, of course, but the vast majority of libraries do not fall into that category. I was generalizing.

        And yes, some third-party libs might get so much public scrutiny as to be considered safer than what someone would create in-house, depending on their skills. But safety in numbers sometimes turns out to be a false assumption, and at the end of the day, choosing this approach still pushes external risks (attack surface) onto users. Good luck. It hardly matters to the general point, though, because most libs do not have this level of scrutiny.

        Let's also remember that pinning dependencies is not a silver bullet. If I didn't trust someone to follow "best practices", I don't think I would trust their certification of a third-party library hash any more than I would trust their own code.

        With all that said, let me re-state my approach for clarity:

        • I minimize dependencies first. Standard libraries are great for this.
        • When something more cannot reasonably be avoided, I choose very carefully, prioritizing the safety of my users over my own convenience.
        • Sometimes that means changing my original design, or spending my time learning or building things that I hadn't planned to. I find the results to be worth it.
        1 Reply Last reply
        3
        • dohpaz42@lemmy.worldD [email protected]

          Until those wheels contain malware and spyware.

          C This user is from outside of this forum
          C This user is from outside of this forum
          [email protected]
          wrote last edited by
          #35

          Or bugs that you only work out much later on.

          A 1 Reply Last reply
          1
          • T [email protected]

            Be the change you want to see in the world, people. Don't use any Node (or Rust or Python or Java or whatever) modules that have more dependencies than they absolutely, positively, 100%, for real have to. It's really not that hard. It doesn't have to be this way.

            C This user is from outside of this forum
            C This user is from outside of this forum
            [email protected]
            wrote last edited by [email protected]
            #36

            Too late, is_even_rs now depends on tokio

            1 Reply Last reply
            7
            • D [email protected]

              Feels like a lot of “not inventing the wheel” - which is good? There are plenty of good wheels out there.

              M This user is from outside of this forum
              M This user is from outside of this forum
              [email protected]
              wrote last edited by
              #37

              Yes, but my moon rover's wheels need to fulfill different requirements.

              1 Reply Last reply
              0
              • D [email protected]

                Feels like a lot of “not inventing the wheel” - which is good? There are plenty of good wheels out there.

                F This user is from outside of this forum
                F This user is from outside of this forum
                [email protected]
                wrote last edited by
                #38

                The problem is "I need function, library with 1000 functions has function, include." Library's 823rd function turns out to have a vulnerability.

                bleistift2@sopuli.xyzB 1 Reply Last reply
                9
                • candyman337@lemmy.worldC [email protected]

                  What is that?

                  zea_64@lemmy.blahaj.zoneZ This user is from outside of this forum
                  zea_64@lemmy.blahaj.zoneZ This user is from outside of this forum
                  [email protected]
                  wrote last edited by
                  #39

                  Dead code elimination but with a different name for some reason

                  Q 1 Reply Last reply
                  9
                  • C [email protected]
                    This post did not contain any content.
                    M This user is from outside of this forum
                    M This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #40

                    Except in the picture on the left, someone's actually reading it.

                    Something's gone wrong if you're looking in the node_modules folder.

                    I 1 Reply Last reply
                    4
                    • F [email protected]

                      And this is why tree shaking exists.

                      K This user is from outside of this forum
                      K This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #41

                      It's great when it works, yeah.

                      1 Reply Last reply
                      0
                      • C [email protected]

                        Rust as well. Seems to just be a modern language thing.

                        B This user is from outside of this forum
                        B This user is from outside of this forum
                        [email protected]
                        wrote last edited by [email protected]
                        #42

                        At least Rust compiles down to what is used. I don't know if js has any of that, but at least with rust the final program doesn't ship tons of bloat.

                        C 1 Reply Last reply
                        1
                        • B [email protected]

                          At least Rust compiles down to what is used. I don't know if js has any of that, but at least with rust the final program doesn't ship tons of bloat.

                          C This user is from outside of this forum
                          C This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #43

                          Yes and no, the linker does nicely trim a lot of the fat, but rust binaries are still pretty chonky. Its good chonky (debug etc), and static compile doesnt help, but they are quite fat.

                          Also doesnt help compile times that you have to build all this extra stuff, only to throw most of it away.

                          1 Reply Last reply
                          0
                          • L [email protected]

                            Why write code, when someone else already wrote it?

                            O This user is from outside of this forum
                            O This user is from outside of this forum
                            [email protected]
                            wrote last edited by
                            #44

                            Why not import all code ever created by human kind just in case we might need some of it.

                            S P 2 Replies Last reply
                            15
                            • C [email protected]
                              This post did not contain any content.
                              M This user is from outside of this forum
                              M This user is from outside of this forum
                              [email protected]
                              wrote last edited by
                              #45

                              Wait until OP finds out about interpreters and compilers.

                              1 Reply Last reply
                              2
                              • D [email protected]

                                Feels like a lot of “not inventing the wheel” - which is good? There are plenty of good wheels out there.

                                icastfist@programming.devI This user is from outside of this forum
                                icastfist@programming.devI This user is from outside of this forum
                                [email protected]
                                wrote last edited by
                                #46

                                "Yes, I'd like a wheel. I don't want to invent it. Why, of course, give me the full package of wheel, axis, rotor, engine, fuel tank, windshield, mirrors, tire, front panel, brakes. This wheel will be great for me manually spinning cotton!"

                                P 1 Reply Last reply
                                8
                                • zea_64@lemmy.blahaj.zoneZ [email protected]

                                  Dead code elimination but with a different name for some reason

                                  Q This user is from outside of this forum
                                  Q This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #47

                                  Because we're monkeys

                                  M 1 Reply Last reply
                                  2
                                  • T [email protected]

                                    Be the change you want to see in the world, people. Don't use any Node (or Rust or Python or Java or whatever) modules that have more dependencies than they absolutely, positively, 100%, for real have to. It's really not that hard. It doesn't have to be this way.

                                    icastfist@programming.devI This user is from outside of this forum
                                    icastfist@programming.devI This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #48

                                    cries in legacy systems

                                    1 Reply Last reply
                                    1
                                    • M [email protected]

                                      Except in the picture on the left, someone's actually reading it.

                                      Something's gone wrong if you're looking in the node_modules folder.

                                      I This user is from outside of this forum
                                      I This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #49

                                      Sometimes you gotta monkey patch that library because they won’t accept your pull requests to fix that bug.

                                      J 1 Reply Last reply
                                      2
                                      • O [email protected]

                                        Why not import all code ever created by human kind just in case we might need some of it.

                                        S This user is from outside of this forum
                                        S This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #50

                                        I want to build a kick scooter. For that I need some wheels. So I import the well-known semi-truck framework. From that framework I take some huge wheels. They are too large and too many, but I guess I can make do with them.

                                        But I need to attach the wheels to one another, so I import the bridge-building-library, because they have steel bars in there.

                                        Lastly, to attach all of that together I import the NASA space ship framework because there's a hand welder in there, that's been deprecated years ago, but it's still rotting away in there because some important products still require the hand welder class for some entirely unrelated use cases.

                                        1 Reply Last reply
                                        7
                                        • C [email protected]
                                          This post did not contain any content.
                                          J This user is from outside of this forum
                                          J This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by
                                          #51

                                          Also C programmers using glibc

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups