Skip to content

Comment on What Dynamic Typing Is Forparent

Comments

I'm fully on board with improving compilers. My issue is that you compare the current state of (some) dynamically-typed languages with a hypothetical future state of statically-typed languages.

You use `req.cookies['token']` as an example of a subtle bug in JavaScript, but this isn't necessarily an inherent bug to dynamic typing in general. You could, for example, have a key lookup function that requires you to pass in a default value, or callback to handle what occurs if the value is missing.

    req.cookies.get('token', () => {
      throw new AuthFailure("Missing token")
    })
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.