Sun 11 Jul 2021

Mutating and non-mutating Swift contexts

ne of the ways in which Swift helps us write more robust code is through its concept of value types, which limit the way that state can be shared across API boundaries. That’s because, when using value types, all mutations are (by default) only performed to local copies of the values that we’re working with, and APIs that actually perform mutations have to be clearly marked as mutating.

In this article, let’s explore that keyword, as well as its nonmutating counterpart, and the sort of capabilities that those language features provide.

Source: Mutating and non-mutating Swift contexts, an article by John Sundell.

Functional-ish JavaScript

Functional programming is a great discipline to learn and apply when writing JavaScript. Writing stateless, idempotent, side-effect free code really does solve a lot of problems:

  • It’s easier to test
  • It’s easier to debug
  • It’s easier to reproduce issues

Source: Functional-ish JavaScript, an article by Daniel Brain.