Skip to content

Comment on NPM driven development

You are viewing one comment and its replies. View all comments

Comments

  • Coding noob here. What am I looking at? I want to laugh too. :(

    0
    • npm, or node js by extension, is famous (infamous?) for having a library for however simple something is to implement. For example a whole library to trim spaces of a string, but only for the left side. Here the joke takes it to the extreme and even import numbers, if conditions, etc., features that are already available in the core language, from external npm libraries, and use that to write a code snippet.

      2
      • That’s…amazing haha thank you for your reply!

        2
      • My favorite was IsEven. An entire library to tell you if a number is even. And then IsOdd, that does the opposite, which takes IsEven as a dependenxy.

        0
    • Everything is from an imported library

      1
      • I for one support local libraries. They’re an invaluable resource for the community and I support them 100%

        1
        • @aldhissla@beehaw.org· · edited

          Hehehe, ok.

          Those require lines there, they’re importing code written elsewhere. We call that code a library. Take the first one:

          var zero = require("number-zero");

          defines a variable called zero, imports a library called number-zero (not a real library btw, just a joke), and assigns its value (assumed to be the constant 0) to the variable. Later in line 19, zero is read.

          The joke is that you wouldn’t even write line 2 and use a simple 0 instead of zero in line 19. The code is full of unnecessary imports of basic language components.

          1

Sign in to comment. Sign in