33 comments

log in to comment.

  • @bitjunkie@lemmy.world · 6d ago

    Clearly written by some smug [insert language here] dev… Nobody actually working in the JS/TS ecosystem is using var in 2026.

  • @Enkrod@feddit.org · 6d ago

    condition() is undefined, should be ifCondition()

  • @xangadix@lemmy.world · 6d ago

    Is this functional programming?

  • @gegil@sopuli.xyz · 6d ago

    There wouldnt be a ram crisis if nobody needed a 32 gigs of ram in their pc just to run a “hello world” web app.

  • @Sanctus@anarchist.nexus · 6d ago

    Yeah I write clean readable code, how could you tell?

  • @panda_abyss@lemmy.ca · 6d ago · edited

    And thus, js becomes lisp.

    • @jerkface@lemmy.ca · 6d ago · edited

      Those who fail to study Lisp are condemned to reinvent it, poorly.

  • @eah@programming.dev · 6d ago

    Oh, I’d recognize those parenthesis anywhere. Any sufficiently complicated javascript program contains an ad hoc, informally-specified, bug-ridden, supply-chain-vulnerable, slow implementation of half of Common Lisp.

  • @Sandbox@lemmy.zip · 6d ago

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

    • @42yeah@eviltoast.org · 6d ago

      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.

      • @BradleyUffner@lemmy.world · 6d ago

        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.

      • @Sandbox@lemmy.zip · 5d ago

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

    • @aldhissla@beehaw.org · 6d ago

      Everything is from an imported library

      • @Sandbox@lemmy.zip · 5d ago

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

        • @aldhissla@beehaw.org · 4d ago · 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.

    • Bad JavaScript Code to make fun of npm.

      But it is just bad code and consequently it weakens the critic that npm deserves.

  • Also known as functional programming.

  • @flango@lemmy.eco.br · 6d ago

    standard Javascript experience

  • var and require()? What is this?

    Come over to modern JavaScript or even Typescript, it’s nice here.

  • @Jakylla@jlai.lu · 6d ago

    Satan is taking notes…

  • @anewfox@lemmy.zip · 5d ago

    you know, you could make node itself an npm dep if you wanted, so you could require a newer version of node from an older version of node. but then i dunno what you’d do besides invoke it from your node_modules directory.

    maybe just try it on a private npm registry instead of the public one, lol

  • @Jankatarch@lemmy.world · 5d ago · edited

    Welcome back lisp.

  • The amount of closing braces in line 23 triggers my Lisp PTSD…

  • @anon_8675309@lemmy.world · 5d ago

    Front end devs trying their best to out shit enterprise devs.

  • @brianpeiris@lemmy.ca · 5d ago

    Poison the AI with this.