Blog

  • Providing JavaScript Developers Helpful Type Errors When They Call Your ReScript Library Incorrectly

    Introduction

    You can’t use ReScript to call ReScript incorrectly because the compiler will help you make it correct. You can’t use ReScript to call JavaScript wrong because the compiler will help you make it correct.

    However, when JavaScript calls your ReScript library, it can do it incorrectly because JavaScript has no compiler; you just run it. This can ruin all the benefits of ReScript: null pointers, runtime errors, and super strange internal ReScript standard library errors that make no sense with stack traces that are not helpful.

    Instead, the better thing to do is check the types at runtime, and if wrong, provide helpful runtime errors with what the JavaScript developer needs to do to fix the error. If you’re a ReScript developer providing libraries for JavaScript developers, this article is for you.

    (more…)
  • No Consequences of Product & Technical Decisions

    Dare Obasanjo on Twitter posts this meme & writes:

    A genuine problem in tech is that we’ve created a culture where people switch jobs too often to experience the consequences of their product & technical decisions let alone have to fix them.

    (more…)
  • New Appreciation for Typed Lenses

    I have a new appreciation for Lenses in typed languages. When you learn parsing untyped data like JSON to strong/soundly typed data, Lenses seem wrong.

    When you’re presented with 1,000+ of dynamically shaped JSON data you can’t predict, typed Lenses suddenly are The Solution.

    (more…)
  • I Hate My Code Again


    Good news, I hate my code again.

    In 2005 I stopped hating the code I wrote. I felt I had reached a milestone in my career. After 5 years, I one day looked at some code I wrote 6 months ago and went “Man… I actually like this, and can understand it!” That often never happened. My gut instinct was to just rewrite. Suddenly I could start using things I wrote awhile ago in new projects, with confidence and only minor modifications.

    Yesterday, rewriting an SDK I wrote 4 years ago, and I would not write it like that today. That tells me I’ve made a lot of progress and changed in 4 years. Skill progress! 😁

    I’m glad I keep the tactic I had in 2005, and that’s just keep doing what I’ve been doing and keep improving.