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 16 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.
  • C [email protected]
    This post did not contain any content.
    D This user is from outside of this forum
    D This user is from outside of this forum
    [email protected]
    wrote last edited by
    #6

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

    S dohpaz42@lemmy.worldD M F icastfist@programming.devI 7 Replies Last reply
    35
    • C [email protected]
      This post did not contain any content.
      S This user is from outside of this forum
      S This user is from outside of this forum
      [email protected]
      wrote last edited by
      #7

      Off topic but what's the point of a book that thick other than novelty? Would make much more sense to just separate into volumes

      B D 2 Replies Last reply
      2
      • C [email protected]
        This post did not contain any content.
        T This user is from outside of this forum
        T This user is from outside of this forum
        [email protected]
        wrote last edited by
        #8

        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.

        I W C icastfist@programming.devI 4 Replies Last reply
        9
        • C [email protected]

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

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

          I sort of have a suspicion that there is some mathematical proof that, as soon as it becomes quick and easy to import an arbitrary number of dependencies into your project along with their dependencies, the size of the average project's dependencies starts to follow an exponential growth curve increasing every year, without limit.

          I notice that this stuff didn't happen with package managers + autoconf/automake. It was only once it became super-trivial to do from the programmer side, that the growth curve started. I've literally had trivial projects pull in thousands of dependencies recursively, because it's easier to do that than to take literally one hour implementing a little modified-file watcher function or something.

          C 1 Reply Last reply
          12
          • 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.

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

            Which sounds like great, practical advice in a theoretical perfect world!

            But, the reality of the situation is that professionals are usually balancing a myriad of concerns and considerations using objective and subjective evaluations of what's required of us and quite often inefficiency, whether in the form of programmatic complexity or in the form of disk storage or otherwise, has a relatively low precedent compared to everything else we need to achieve if we want happy clients and a pay check.

            T K 2 Replies Last reply
            11
            • S [email protected]

              Off topic but what's the point of a book that thick other than novelty? Would make much more sense to just separate into volumes

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

              Seems like it would break quickly with use

              1 Reply Last reply
              0
              • P [email protected]

                I sort of have a suspicion that there is some mathematical proof that, as soon as it becomes quick and easy to import an arbitrary number of dependencies into your project along with their dependencies, the size of the average project's dependencies starts to follow an exponential growth curve increasing every year, without limit.

                I notice that this stuff didn't happen with package managers + autoconf/automake. It was only once it became super-trivial to do from the programmer side, that the growth curve started. I've literally had trivial projects pull in thousands of dependencies recursively, because it's easier to do that than to take literally one hour implementing a little modified-file watcher function or something.

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

                Its certainly more painful to collect dependencies with cmake, so its not worth doing if you can hand roll your own easily enough.

                The flip side is that by using a library, it theoretically means it should be fairly battle-tested code, and should be using appropriate APIs. File watching has a bunch of different OS specific APIs that could be used, in addition to the naive "read everything periodically" approach, so while you could knock something together in an hour, the library should be the correct approach. Sadly, at least in rust land, there are a ton of badly written libraries to wade through... 🤷

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

                  And this is why tree shaking exists.

                  candyman337@lemmy.worldC K S 3 Replies Last reply
                  19
                  • I [email protected]

                    Which sounds like great, practical advice in a theoretical perfect world!

                    But, the reality of the situation is that professionals are usually balancing a myriad of concerns and considerations using objective and subjective evaluations of what's required of us and quite often inefficiency, whether in the form of programmatic complexity or in the form of disk storage or otherwise, has a relatively low precedent compared to everything else we need to achieve if we want happy clients and a pay check.

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

                    Saying "we can't in practice reduce the complexity of our dependency tree because we need happy clients and a pay check" is like saying "we can't in practice turn on the propeller because we need to get this airplane off the ground".

                    B 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.

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

                      This applies to developers, too.

                      External dependencies put end users at risk, so I avoid them as much as possible. If that means I have to rethink my design or write some boring modules myself, then so be it.

                      K 1 Reply Last reply
                      6
                      • D [email protected]

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

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

                        But I don't NEED a wheel, I just need a tarp to put over this metal frame on my patio, and for some reason the tarp manufacturer attaches wheels and plane wings to it!?

                        J 1 Reply Last reply
                        46
                        • D [email protected]

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

                          dohpaz42@lemmy.worldD This user is from outside of this forum
                          dohpaz42@lemmy.worldD This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #17

                          Until those wheels contain malware and spyware.

                          C 1 Reply Last reply
                          11
                          • F [email protected]

                            And this is why tree shaking exists.

                            candyman337@lemmy.worldC This user is from outside of this forum
                            candyman337@lemmy.worldC This user is from outside of this forum
                            [email protected]
                            wrote last edited by
                            #18

                            What is that?

                            N zea_64@lemmy.blahaj.zoneZ 2 Replies Last reply
                            7
                            • C [email protected]

                              Its certainly more painful to collect dependencies with cmake, so its not worth doing if you can hand roll your own easily enough.

                              The flip side is that by using a library, it theoretically means it should be fairly battle-tested code, and should be using appropriate APIs. File watching has a bunch of different OS specific APIs that could be used, in addition to the naive "read everything periodically" approach, so while you could knock something together in an hour, the library should be the correct approach. Sadly, at least in rust land, there are a ton of badly written libraries to wade through... 🤷

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

                              Yeah. I have no idea what the answer is, just describing the nature of the issue. I come from the days when you would maybe import like one library to do something special like .png reading or something, and you basically did all the rest yourself. The way programming gets done today is wild to me.

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

                                I should check Go's pkg folder...

                                G 1 Reply Last reply
                                1
                                • candyman337@lemmy.worldC [email protected]

                                  What is that?

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

                                  If you import 1% of your module code, you only compile the actual used code. Tree shaking is removing dead code paths that aren't used.

                                  candyman337@lemmy.worldC 1 Reply Last reply
                                  22
                                  • N [email protected]

                                    If you import 1% of your module code, you only compile the actual used code. Tree shaking is removing dead code paths that aren't used.

                                    candyman337@lemmy.worldC This user is from outside of this forum
                                    candyman337@lemmy.worldC This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #22

                                    Ah ok gotcha

                                    1 Reply Last reply
                                    3
                                    • T [email protected]

                                      Saying "we can't in practice reduce the complexity of our dependency tree because we need happy clients and a pay check" is like saying "we can't in practice turn on the propeller because we need to get this airplane off the ground".

                                      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]
                                      #23

                                      Clients don't care much about the dependency graph. They do care about delivering on time and sometimes not reinventing a bunch of wheels is crucial for that.

                                      T 1 Reply Last reply
                                      11
                                      • W [email protected]

                                        This applies to developers, too.

                                        External dependencies put end users at risk, so I avoid them as much as possible. If that means I have to rethink my design or write some boring modules myself, then so be it.

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

                                        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 1 Reply Last reply
                                        8
                                        • S [email protected]

                                          But I don't NEED a wheel, I just need a tarp to put over this metal frame on my patio, and for some reason the tarp manufacturer attaches wheels and plane wings to it!?

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

                                          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 1 Reply Last reply
                                          17
                                          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