RSSAmplifier

Blog

Swiftology

Advanced Swift | Functional Programming | Software Design written by Alex Ozun

swiftology.ioRSS feed ↗9 posts

Latest posts

Swift Concurrency from Zero to Hero | Reading List

In this short post I want to recommend an ordered reading list that will get you from Zero to Hero in Swift Concurrency

Pitfalls of Parameterized Tests

In this article, I share my experience adopting Swift Testing at scale and the lessons I learned about **Parameterized Tests**, including five common pitfalls teams may encounter. I also recommend best practices for avoiding them.

Making illegal states unrepresentable

In state modeling, perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. "Making illegal states unrepresentable" is a very powerful approach to data modelling and software design in general.

Domain modeling with types

In this article we'll talk about **Software Design** and the role **types** play in this process. You'll learn how to leverage Swift's expressive type system to create accurate and robust models tailored to solve problems in your domain.

Witness pattern — type-safe access control

A common challenge in software design is ensuring that access to a certain functionality is restricted under specific preconditions. In this article, I will show you how to design bulletproof type-safe access control using the **Witness Pattern**.

Type-safe validation

Validation is a very common task in software engineering. We need to validate stuff all the time: user inputs, data formats, array bounds, external configurations, etc. In this article I will show you how to perform validation in a type-safe way, eliminating a whole class of bugs.

Fundamentals of type-driven code

With this series of articles, I have a lofty goal of shifting your Swift programming mindset. I know it sounds presumptuous, but this is exactly what happened to me a few years back when I was introduced to Type-Driven Design. I assure you, it’s not some new fad or an esoteric methodology. It’s a system of practical, well-researched, and time-tested ideas that form the basis for a powerful…

Typestate - the new Design Pattern in Swift 5.9

In this article I will introduce you to Typestate pattern, popularised by Rust language, now available in Swift 5.9. You will see how the combination of generic constraints and Swift's new memory ownership model allows you to write bulletproof code.

Greater type safety with Structural Typing in Swift

In this article I will show you how to achieve a strong compile-time guarantee that your code is correct. I will demonstrate how the internal structure of your types can hold unbreakable rules within them, known as invariants. Through real-world examples such as `NonEmptyArray`, `Zipper`, and `UUID`, I'll try to convince you to view the structure of your types through the lens of type safety,…