all 51 comments

sorted by: hot top controversial new old
[–] 1 point 1 year ago

Not the best with js, but that quiz was fun.

  • source
  • [–] 1 point 1 year ago

    This is just a good reminder of human nature to make bad choices (using JS) and stick with them forever.

  • source
  • [–] 37 points 1 year ago (6 children)

    I am a frontend dev. JavaScript (well, TypeScript) is my bread and butter. Even knowing its quirks I never would have thought how inconsistent Date actually is. I encourage everyone to try this quiz.

    This is what JavaScript haters should bring forth, not 0.1 + 0.2 !== 0.3!

  • source
  • hideshow 6 child comments
  • [–] 13 points 1 year ago (2 children)

    There is a reason almost everyone use some Date lib, like Luxon and not the built in. And well, having a horrible built in lib that they can't change due to legacy code breaking is nothing really new or unique to JS.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago (1 child)

    The built-in lib is fine for basic stuff unless you do some crazy shit like expecting "2" to parse as a valid date.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 4 points 1 year ago

    For very basic things maybe, but it has a lot of other weird problems and restrictions. Mutability, no real timezone support, very limited arithmetic, to name a few. As soon as you move beyond the very basic, you want someting more robust.

  • source
  • parent
  • [–] 28 points 1 year ago (1 child)

    Except for some reason "2" is interpreted as a month, and the year is set to 2001.

    Aight I'm out

  • source
  • hideshow 1 child comment
  • [–] 27 points 1 year ago (1 child)

    The quirks in this quiz aren’t even universal, and vary based on which browser you’re using. See the table at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#non-standard_date_strings

    Also I got 13/28 😑

  • source
  • hideshow 1 child comment
  • [–] 25 points 1 year ago

    I got 10/28, but I was crying after the 7th question

  • source
  • [–] 20 points 1 year ago

    I scored 13/28 on https://jsdate.wtf/ and all I got was this lousy text to share on social media.

    Oof. I’ve been a JS dev since 1998.

  • source
  • [–] 17 points 1 year ago* (last edited 1 year ago)

    Alright, enough making fun of languages that suck…let’s talk about JavaScript.

    https://www.destroyallsoftware.com/talks/wat

  • source
  • [–] 12 points 1 year ago

    Ha this is even worse than I could have imagined!

  • source
  • [–] 19 points 1 year ago* (1 child)

    If you're not very familiar with JS, watch the Wat talk before taking the quiz to know what to expect from this wonderful language.

  • source
  • hideshow 1 child comment
  • [–] 9 points 1 year ago

    Nobody understands JavaScript. It's the quantum mechanics of the software world.

  • source
  • [–] 9 points 1 year ago (1 child)

    I got a 4/28 and got told I would have scored higher if I guessed at random. Ouch. (I am not a dev)

  • source
  • hideshow 1 child comment
  • [–] 5 points 1 year ago

    I mean, for what it's worth, I'm a seasoned dev and just did a run where I tried to answer everything as it makes sense to me (which is "throws an error" or "invalid date" for all of them) and I also got a score of 4/28.

    ...and two of those points were given to me, because the quiz interpreted my answer differently than I meant it.

    In other words, this quiz exists to highlight that JavaScript's Date functions make no sense.

  • source
  • parent
  • [–] 8 points 1 year ago (4 children)

    Can we sue Oracle back for any of this?

  • source
  • hideshow 4 child comments
  • [–] 1 point 1 year ago* (last edited 1 year ago) (3 children)

    Oracle? Oracle owns Java, not JavaScript.

    Edit: mea culpa! Sun owned both!

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 1 year ago (2 children)

    They ended up with Javascript trademark (afaik, because the name was too close to Java) too. Sued node.js over something related.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 1 year ago (1 child)

    Apparently the JS name was selected and announced in partnership with Sun from the very beginning, and Sun had the copyright over both Java and JapaScript up until the acquisition by Oracle. I had no idea, but that makes perfect sense.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 year ago

    Sun, afaiu, was part of a large committee on js without any particular leadership. They got the committee to agree to giving it trademark by complaining/threatening that the name was too close to java. Sun got trademark 4 years after Netscape started support for js. ECMAscript was mostly the same committee without SUN ownership/trademark.

  • source
  • parent
  • [–] 8 points 1 year ago

    I did not do well:

    "I scored 9/28 on https://jsdate.wtf and all I got was this lousy text to share on social media."

    Ive been a dev for a long time. Im glad im not doing javascript all that much anymore.

  • source
  • [–] 7 points 1 year ago

    It only took one question for me to start wanting to flip tables.

  • source
  • [–] 6 points 1 year ago

    I scored 10/28 on https://jsdate.wtf/ and all I got was this lousy text to share on social media.

  • source
  • [–] 6 points 1 year ago

    Thank god Temporal is finally in Stage 3, and already rolled out in Firefox. I can't wait to be done with JS's Date forever.

  • source
  • [–] 11 points 1 year ago (11 children)

    Can we start a new web with a better language/platform already?

  • source
  • hideshow 11 child comments
  • [–] 2 points 1 year ago (1 child)

    There's wasm if you need to target browsers.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 6 points 1 year ago*

    Yes and no. Wasm has no "standard library" so if you wanted to use Dates, your wasm would need to have its own implemation bundled for when the user visits the page. Ditto for everything else including string support! As you can imagine having to ship all this basic functionality can bloat the wasm and slow page loads.

    You also can't fully escape JS, as the only way wasm can interact with the page & browser are through the JS functions you write and make available to your wasm. I suppose you could take advantage of this to not have to ship your own standard library & use the JS Date implementation, but at that point why not just use JS?

    Wasm has strengths but it's not suitable for replacing JS for everyday websites.

  • source
  • parent
  • [–] -2 points 1 year ago (7 children)

    Why? Why not improve JS (e.g. with Temporal), especially given how excellent Typescript is?

  • source
  • parent
  • hideshow 7 child comments
  • [–] [S] 5 points 1 year ago (2 children)

    I wouldn't call typescript excellent, if I did it would be on a very low standard.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 0 points 1 year ago (1 child)

    It unquestionably is excellent. Can you name another language in common use with a type system that's close to the expressiveness of Typescript?

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 1 year ago

    Let's not get ahead of ourselves. Typescript has a decent type system, but it's hardly state of the art. It's impressive how they've managed to mostly corral JavaScript into something much more sane, but at the end of the day it still suffers greatly from the limitations of JavaScript. They've essentially retrofitted some type theory onto JavaScript to make it possible to express JavaScript nonsense in the type system, but there's plenty of things that would have been designed differently had they been making something from scratch. Not to mention that the type system is unsound by design, which by itself puts it behind languages designed from the ground up to have sound type systems.

    There's many, many things missing from the type system, like higher-kinded types, type-driven deriving/codegen, generalized algebraic data types (aka GADTs), type families (and relatedly, associated types), existentially-quantified types, and much more.

  • source
  • parent
  • [–] 10 points 1 year ago (3 children)
  • [–] -2 points 1 year ago (2 children)

    How? It's easy not to run into the common issues by using TS. What's so bad about it that we should throw away the existing ecosystem?

    Please give arguments instead of platitudes.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 year ago (1 child)

    You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 1 year ago

    Sure, discipline can prevent some errors. But it's always possible to run into wrong type assumptions, and I'd say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it's so useful.

    Static type analysis is always a good idea if you're writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you're following common Python idioms.

  • source
  • parent
  • [–] 5 points 1 year ago (3 children)

    Great quiz. It teaches you the rules while training you to expect the unexpected, even in the rare cases that the rules are applied consistently.
    I got exactly half the questions right.

  • source
  • hideshow 3 child comments
  • [–] 5 points 1 year ago (2 children)

    I scored 8/28 on https://jsdate.wtf/ and all I got was this lousy text to share on social media.

    don't tap for spoilersThe sequence of questions about new Date("0"), new Date("1"), and new Date("2") got me good.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 1 year ago

    I scored 17/28 on https://jsdate.wtf/ and all I got was this lousy text to share on social media.

    Idk anything about Date but got pretty far with intuition of JS whackiness

  • source
  • [–] 5 points 1 year ago

    9/28. WTF'ing through 90% of the questions.

  • source
  • [–] 3 points 1 year ago

    7/28. Of course no one would ever do most of those things, they are interesting to think about but with little practical use.

  • source
  • [–] 1 point 1 year ago

    12/28

    Surprised that I got this score when I only know python

  • source