Blog

  • Five Levels of Error Handling in Both Python and JavaScript

    Five Levels of Error Handling in Both Python and JavaScript

    Introduction

    I spoke at OpenSlava 2020 a few weeks back, specifically around the levels of error handling you should apply to coding. However, I wanted a written article to refer to for those who don’t want to watch the video.

    The below covers the 5 levels of error handling. I call them “levels” because the idea is to start with the lowest level, learn how it works, and then level up to the next. The ideal is that you utilize level 5 error handling, pattern matching, in all types of coding you do regardless of language. If you’re operating at that level, you’ll have more predictable code. There are other types of error handling, these are just the most common I’ve seen.

    The error handling skill tree is as follows:

    🏎 lvl 1: ignore ’em, dynamic languages have fast iteration
    ⚾️ lvl 2: try/catch/throw
    🏭 lvl 3: Go/Lua style, function return values, pass back up
    ⛓ lvl 4: pipeline style, like JavaScript Promise
    🌯 lvl 5: pattern match on returned types

    (more…)
  • Domain Driven Design Translated to Functional Programming

    Attempting again to learn Domain Driven Design, and it’s clear if you’re an Object Oriented Programmer trying to learn Functional Programming, no wonder you’re confused. Here’s a paragraph summary of the 500 page book I’ve translated each sentence into typed FP.

    (more…)
  • OpenSlava 2020: Using Serverless & Functional Programming for Ingestion Asteroid Price Data

    I spoke at OpenSlava 2020 last Thursday. Specifically, I go over the 5 levels of error handling you can use to have more predictable code for Lambda’s and Step Functions.

    My preso starts at 2:44:25

    Slides – Google Preso | PDF

  • React Developer’s Crash Course into Elm

    React Developer’s Crash Course into Elm

    Learning Functional Programming has a high learning curve. However, if you have something familiar to base it off of, it helps a lot. If you know React & Redux, this gives you a huge head start. Below, we’ll cover the basics of Elm using React & Redux/Context as a basis to help make it easier to learn.

    The below deviates a bit from the Elm guide, both in recommendations and in attitude. Elm development philosophy is about mathematical correctness, learning & comprehending the fundamentals, and keeping things as brutally simple as possible. I’m impatient, don’t mind trying and failing things 3 times to learn, and immersing myself in complexity to learn why people call it complex and don’t like it. I’m also more about getting things done quickly, so some of the build recommendations follow more familiar toolchains React, Angular, and Vue developers are used too which is pretty anti-elm simplicity.

    (more…)