Tag: programming

  • Functional Programming Unit Testing in Node – Part 4

    Functional Programming Unit Testing in Node – Part 4

    Concurrency, Compose, and Coverage

    Welcome to Part 4 where we show how to do concurrency which is a lot easier to get “for free” using pure functions, we compose both async and synchronous functions, we and utilize a test coverage report to where next to focus our refactoring and testing efforts.
    (more…)

  • Functional Programming Unit Testing in Node – Part 3

    Functional Programming Unit Testing in Node – Part 3

    OOP, Compose, and Curry

    Welcome to Part 3 where we’ll show you how to navigate class based code using FP, go over composing all these asynchronous functions we wrote, and continuing to define our dependencies in curried functions to make them easier to test.
    (more…)

  • Functional Programming Unit Testing in Node – Part 2

    Functional Programming Unit Testing in Node – Part 2

    Predicates, Async, and Unsafe

    In part 2, we’ll validate our inputs using predicates, show how to make asynchronous pure functions, and show various techniques on how you call unsafe code from Functional Code.

    (more…)

  • Error Handling Strategies

    Error Handling Strategies

    Introduction

    There are various ways of handling errors in programming. This includes not handling it. Many languages have created more modern ways of error handling. An error is when the program, intentionally, but mostly not, breaks. Below, I’ll cover the 4 main ones I know: try/catch, explicit returns, either, and supervising crashes. We’ll compare various languages on how they approach errors: Python, JavaScript, Lua, Go, Scala, Akka, and Elixir. Once you understand how the newer ways work, hopefully this will encourage you to abandon using potentially program crashing errors via the dated throw/raise in your programs.
    (more…)