Tags

Fundamentals

  • Jun 22, 2017

    Statements, messages and reducers

    I show how to structure programs around three tiers of computational units – statements, messages and reducers – and talk about the general problem of containing and isolating state that this restructuring aims to address.

    app designfundamentals

    Read article

  • Feb 26, 2017

    The weirdest subclass I've ever written

    There's an industry-wide push for protocol-oriented programming where shared interfaces, behaviors and substitutability are provided through protocols rather than subclasses. In this article though, I'll look at a case where I chose to use a subclass, instead of a protocol, to take advantage of some specific differences between classes and protocols.

    fundamentals

    Read article

  • Sep 22, 2016

    Optimizing a copy-on-write double-ended queue in Swift

    I present an implementation of a a double-ended queue type (deque) in Swift and look at what is required to implement copy-on-write in an optimized way so that this double-ended queue is faster than Array when used as a first-in-first-out (FIFO) queue.

    Swiftfundamentals

    Read article

  • Aug 21, 2016

    Values and errors, part 1: 'Result' in Swift

    In this article, I'll discuss the Result type in Swift as well as common variations in implementation and approach used for this data type. I'll also look at *why* the type was rejected for inclusion in the standard library and what effect that rejection is likely to have.

    Swiftfundamentalserror handling

    Read article

  • Mar 17, 2016

    Errors: unexpected, composite, non-pure, external.

    Error handling is a topic I plan to visit periodically but it's difficult since 'error' is such a poorly defined term. In this article, I give a clear definition of an error and further define the most common associated complications. The intent is to establish a foundation for future discussions on the topic.

    fundamentalserror handling

    Read article

  • Jan 25, 2016

    Partial functions in Swift, Part 1: Avoidance

    Partial functions (functions with preconditions) are a risky design choice. You probably have a few in your program, even if you haven't clearly identified them. Learn how to recognize them, learn about their risks, learn to avoid them and learn why you might choose to use them anyway.

    fundamentalsmathematics

    Read article