Author: JesterXL

  • Respite from Conway’s Law Day

    We should have a new holiday, or at least designate 1 Saturday at year to “Respite from Fighting Conway’s Law Day”. Unclear what the goal is beyond to take a break trying to change culture, re-access why you’re even trying, for that day you’re allowed to NOT think you’re crazy.

    What a coincidence; today is World Mental Health Day 🤪.

  • Final Fantasy Legend Level Editor Update

    Progress on Final Fantasy Legend level editor.

    My biggest frustration was how to deal with multidimensional Array’s in Elm. In JavaScript, if you want to build a 2D grid, you just put Array’s in Array’s like so:

    (more…)
  • Building React Components Using Unions in TypeScript

    Update October 4th, 2023: Added an additional explanation on how you can more easily create Unions making them more readable, and compared them to other languages.

    The common theme in a lot of React examples utilizes 2 types of data to build React components around: primitives and Objects. In this article, we’re going to talk about a 3rd called Discriminated Unions. We’ll go over what problems they solve, what their future looks like in JavaScript and possibly TypeScript, and what libraries can help you now.

    Unions in TypeScript can help prevent a lot of common bugs from happening so they’re worth using, especially for UI developers where we have to visualize complicated data. While Unions help narrow what you have to draw, they also expose edge cases that your UI Designer/Product Owner may not have accounted for in their visual design. In JavaScript this would be a blank screen, a null pointer, or an error boundary that you’re confused about. Most importantly, they can help you make impossible situations impossible.

    (more…)
  • TypeScript: Interface is Not Always Recommended Over Type

    I keep seeing the type vs interface in TypeScript keep coming up, and people citing various performance reasons to keep using interface. I wanted to point out WHY those of using are choosing intentionally to use type over interface knowing the performance costs.

    (more…)