Blog

  • Write Unbreakable Python

    Write Unbreakable Python

    In this article, I’ll show you how to write Python with no runtime exceptions. This’ll get you partway to writing code that never breaks and mostly does what it’s supposed to do. We’ll do this by learning how to apply functional programming to Python. We’ll cover:

    • ensure functions always work by learning Pure Functions
    • avoid runtime errors by return Maybes
    • avoid runtime errors in deeply nested data using Lenses
    • avoid runtime errors by return Results
    • creating pure programs from pure functions by Pipeline Programming
    (more…)
  • React Redux Thunk vs Elm

    React Redux Thunk vs Elm

    Introduction

    It’s a bit easier to learn Elm if you compare it to things you know. If you know React and Redux, then comparing them can help a lot to understand Elm concepts. I’ve built the same application in React Redux Thunk and Elm so we can compare them together. The end result is a table of things you can paginate through. Comparing these 2 applications is apples to apples. They’re identical to the end user. Yet the technologies behind them are apples to oranges. Seeing those deviations using familiar tech in the same application can help your understanding.

    (more…)
  • Maybe a Default Good Idea

    Maybe a Default Good Idea

    Introduction

    You’ve learned that using Maybe‘s allows you to get rid of null pointer exceptions (i.e. “undefined is not a function”). However, now your application fails and gives no indication as to why. At least errors would leave a stack trace that may provide a hint as to where the problem originated. How does this happen and what should you be doing instead?

    (more…)
  • Code Organization in Functional Programming vs Object Oriented Programming

    Code Organization in Functional Programming vs Object Oriented Programming

    Introduction

    A co-worker asked about code organization in Functional Programming. He’s working with a bunch of Java developers in Node for a single AWS Lambda, and they’re using the same style of classes, various design patterns, and other Object Oriented Programming ways of organizing code. He wondered if they used Functional Programming via just pure functions, how would they organize it?

    (more…)