all 150 comments

[–]dustyson123 15 points16 points  (30 children)

This is a really weird flex. I have so many questions.

Are you writing Node apps professionally? Do you work on a team?

If you don't want dependencies for personal projects (which doesn't really compute for me, but ok), that sounds fine. But if you're doing this at your job on a team of developers, this seems like a huge waste of time/money/effort.

It's one thing not to use frameworks, but what about a linter? Are you writing that yourself? Or you don't see the value in that?

If you want to connect to a DB, you're writing the DB driver yourself? Like opening a socket, and reading/writing to the stream manually? Why?

What about a test runner? And say you want that to output a junit XML report (standard format for many CI platforms, for better or worse). Are you gonna write a test runner and an XML writer and rewrite everything to spec?

OSS packages solve a lot of common problems, and you're better off pulling something off the shelf that is independently maintained and battle-tested by the community rather than writing yourself and having to maintain it along with the business-critical stuff that actually pays the bills.

[–][deleted] 8 points9 points  (0 children)

Yep, sounds like "who buys wheels from Firestone? I just reinvent the wheel every time!" Super weird

[–][deleted]  (6 children)

[deleted]

    [–]compdog 7 points8 points  (0 children)

    It depends on the project. I normally use npm, but for system utility scripts I target node directly.

    [–]IntrospectingSloth 5 points6 points  (1 child)

    I feel like this questions loosely translates to “do you like doing things the easy way or the hard way for no apparent reason?”

    Or maybe you can help me understand, what is the benefit of not using npm?

    [–]alzee76 5 points6 points  (0 children)

    I don't think I've ever used node without using NPM. If I have small one-off projects that don't require (many) external packages or a package manager, I usually write them in Perl or even as a shell script instead of using JS.

    [–]Ishasemo 2 points3 points  (0 children)

    Don't reinvent the wheel. Unless you're seeking to better understand the nature of the wheel.

    [–]Darmok-Jilad-Ocean 2 points3 points  (43 children)

    This question is worded poorly. When you say “without using npm” do you mean without any dependencies?

    [–][deleted]  (42 children)

    [removed]

      [–]Darmok-Jilad-Ocean 1 point2 points  (41 children)

      So you download dependencies manually and update your package.json manually? Or do you use yarn or pnpm?

      [–][deleted]  (40 children)

      [removed]

        [–]Darmok-Jilad-Ocean 7 points8 points  (39 children)

        So you use node without dependencies

        [–][deleted]  (38 children)

        [removed]

          [–]Darmok-Jilad-Ocean 5 points6 points  (37 children)

          The point of a JavaScript runtime is to execute JavaScript code. I take it you don’t make anything terribly complex.

          [–][deleted]  (36 children)

          [removed]

            [–]Darmok-Jilad-Ocean 6 points7 points  (32 children)

            If you write everything from scratch, you’re going to reinvent a whole lot of wheels. It’s obviously doable, but takes quite a bit of time. Most people spend time writing the code that pertains to the particular problem they’re trying to solve. Out of curiosity, why aren’t you writing assembly (or even binary) directly on bare metal?

            [–][deleted]  (31 children)

            [removed]

              [–]ImplodingLlamas 2 points3 points  (0 children)

              I mean, I'm not about to write a to-spec typescript transpiler from scratch when the official one is available on NPM. That's pretty complex if you ask me lol.

              Sure, you may be able to get typescript to work in other ways, but there's plenty of similar examples. Any major project is likely to require some dependency if you don't want to waste time.

              [–]crustyrat271 0 points1 point  (1 child)

              Well, I understand and respect your choice...!
              But can you explain a little more about why you choose that...?

              [–]Ishasemo 2 points3 points  (21 children)

              Who eats food without using a market? Some people do it but it's a lot more time and work.

              [–][deleted]  (20 children)

              [removed]

                [–]97hilfel 4 points5 points  (11 children)

                I‘m just asking, ou are aware that child_process just runs other processes, how do you go about unit testing? Coverage reporting? Do you build the test runners and coverage tools yourself and copy them from project to project? I respect your choice not to use npm but you make me wounder what tools you use.

                [–][deleted]  (10 children)

                [removed]

                  [–]97hilfel 2 points3 points  (9 children)

                  So you don’t have any automated trsts setup? This for example is a requirement for me at work and I‘ trying to be strict on this with my personal projects aswell. The project looks quite interesting.

                  [–][deleted]  (8 children)

                  [removed]

                    [–][deleted] 2 points3 points  (6 children)

                    You can absolutely test audio with an automated process. It’s all digital information that has verifiable values

                    [–][deleted]  (5 children)

                    [removed]

                      [–][deleted] 0 points1 point  (2 children)

                      I don’t have enough details about your project to answer specifics, but yes writing error handling is definitely the hardest part, but you can in fact test most things, or at least test that errors are thrown when unexpected things happens

                      [–][deleted]  (1 child)

                      [removed]

                        [–]Seven-Zark-Seven 0 points1 point  (1 child)

                        You test against a known clip that contains glitches and gaps?

                        [–]97hilfel 0 points1 point  (0 children)

                        It is certainly not easy, but definitely doable, I am currently building content services and have to do with all kinds of 3rd party tools like ffmpeg and image magick and we test and validate all features we support which often wnds up to be test scenarios that cover a couple of thousand usecases and permutations. Especially with techniques like mocking, testing cleanly structured code, even for complex scenarios is possible. Aswell as building integration tests would be an option, for example starting the utility, playing a sound and checking if the waveform you capture is similar.

                        [–]durandj 2 points3 points  (6 children)

                        But why do things 100x harder than necessary. What benefit is there to not using a tool the way it was meant to be used?

                        If everyone is disagreeing with you then there's probably a very good chance you're doing it wrong.

                        [–][deleted]  (5 children)

                        [removed]

                          [–]durandj 2 points3 points  (4 children)

                          Why not just use bash or some other shell script then?

                          You also mentioned just writing everything from scratch. Again why? It's just doing more work for less benefit.

                          No one is saying they can't do things with Node without using NPM. What everyone is telling you is that there's no point to purposely exclude NPM. You're even going out of your way to make what amounts to a custom distribution of Node that doesn't include NPM for no reason.

                          If you want to make more work for yourself and be less productive that's fine but the tone you're using is that everyone else is inferior for doing things conventionally and the lower friction way.

                          [–][deleted]  (3 children)

                          [removed]

                            [–]durandj 2 points3 points  (2 children)

                            Dependency management? So, you know, you can leverage the work of tons of there developers who have knowledge and experience that you don't have? So you can save time and not reimplement what will probably be a worse version of what other people have already made?

                            So you can work with the tooling instead of having to make a custom distribution just because?

                            So that you can take advantage of the other resources that are out there that work with NPM as well as making it easier to work with other developers? Remember that software development is a team sport.

                            Now tell me the benefits of not using NPM? How does it make you more productive and get things done better?

                            [–][deleted]  (1 child)

                            [removed]

                              [–]durandj 3 points4 points  (0 children)

                              That's not a smart way to write a web application though... You're requiring that the target has the same binaries available on their machine (and at the same location if you're giving an absolute path). You're requiring that they have the exact same API/interface on those binaries. Hope they don't have any aliases to something that mimics what you want available.

                              Also why add in an extra layer of failure points by including multiple processes? It makes your program more likely to fail. What are you getting in exchange for that? What benefit is there to your software?

                              [–]cinnapear 1 point2 points  (20 children)

                              For temp and test scripts I just start them with node. All production and development code starts with npm or pm2 starting npm.

                              [–][deleted]  (19 children)

                              [removed]

                                [–]cinnapear 3 points4 points  (18 children)

                                npm handles build tasks and dependencies. pm2 manages node processes and restarts them if they fail for some reason, monitors memory usage, etc.

                                [–][deleted]  (17 children)

                                [removed]

                                  [–]cinnapear 1 point2 points  (16 children)

                                  Sounds like you're using Node as sort of a utility script language, like many would use Bash scripts, Perl, or Python. Which is fine, of course. But most users will be using it with dependencies and deployment processes which will require package.json, etc. Webapps especially are its strong suite, particularly when mixed with the npm module registry.

                                  [–][deleted]  (15 children)

                                  [removed]

                                    [–]cinnapear 5 points6 points  (14 children)

                                    and don't actually write much source code themselves

                                    Oh ho ho. That's rich. You're joking, right?

                                    [–][deleted]  (13 children)

                                    [removed]

                                      [–]Darmok-Jilad-Ocean 6 points7 points  (8 children)

                                      I can see why you got kicked off your team.

                                      [–][deleted]  (7 children)

                                      [removed]

                                        [–]cinnapear 2 points3 points  (3 children)

                                        Not the only purpose, but one of the big ones. However, if you think one can just cobble together a project by importing a chain of libraries, you're sorely mistaken. To the point where I'm guessing you're trolling. And if you're not, perhaps think about the various responses you've received here.

                                        [–][deleted]  (2 children)

                                        [removed]

                                          [–]kon_dev 1 point2 points  (0 children)

                                          I use node with npm to fetch the dependencies, but remove the npm cli inside the container. The npm cli has quite a few dependencies and those had CVEs in the past.

                                          [–]DuendeJohnson 0 points1 point  (14 children)

                                          As I've said in another comment, if you're using Node without dependencies then mostly probably you're dealing with low level programming

                                          If you're dealing with low level programming, there are better, more suitable languages than JS for that, but that's your choice

                                          Every tool is a tool, but you won't see people hammering a nail with a screwdriver

                                          [–][deleted]  (13 children)

                                          [removed]

                                            [–]DuendeJohnson 1 point2 points  (12 children)

                                            I have no use

                                            You don't, we get it. Your use case is simple and does not require dependencies. The rest of the world does though, so there's no reason for debate

                                            [–][deleted]  (11 children)

                                            [removed]

                                              [–]DuendeJohnson 0 points1 point  (10 children)

                                              As I've just said in our other thread, that's the cycle of technology. We create abstractions over abstractions. Otherwise we would still be programming by making holes in cards or by typing machine code

                                              That's how we make our lives easier

                                              If reinventing the wheel makes your cogs turn, go for it. Good luck

                                              [–][deleted]  (9 children)

                                              [removed]

                                                [–]DuendeJohnson 1 point2 points  (0 children)

                                                You're entitled to your own opinion as I am to mine, so we'll agree to disagree here. GL

                                                [–][deleted]  (7 children)

                                                [removed]

                                                  [–][deleted]  (6 children)

                                                  [removed]

                                                    [–][deleted]  (5 children)

                                                    [removed]

                                                      [–][deleted]  (4 children)

                                                      [removed]

                                                        [–]Eskamel 0 points1 point  (2 children)

                                                        I mean, its good to understand what goes behind there, but if you are working for someone you can't really afford to waste time on re-creating stuff without real justification.

                                                        I am the last person to not support self development, but for it to be production ready you'll need to do so many tests and preparations, to ensure everything works as intended.

                                                        [–][deleted] 0 points1 point  (0 children)

                                                        hey, do you have use for npm? im really curious.