Typescript II - Nominal and Structural Typing

Here we look at two closely related concepts - the behaviour of Typescript’s type system, and how we can get the type of an object at runtime. We dive into structural typing, nominal typing, Typescript’s value and type spaces, classes, and enums.

Link to this section Structural Typing

Typescript is a structurally typed language. This means that types are identified by their shape rather than name or alias. We can see this …


Product Delivery Learnings 2019

One of my goals for 2019 was to improve my skills and knowledge around Product Delivery. What is Product Delivery? I’d define it as a set of practices, attitudes, and tools which can be used to improve the quality of software and the speed at which it’s delivered to customers. It’s a large field which takes in areas of Lean Product Development, Agile, Software Development, DevOps, and SRE. My approach was to read a lot of books and blogs on these topics and discuss the ideas with …


St Bathans

November 19 2019 · central-otago landscape-photography

St Bathans is an old gold mining town in Central Otago. It was established in the 1860s to support miners and is now nearly abandoned. It’s still a popular tourist spot with the blue lakes (photograph below) an iconic scene of the old sluicings.

Good morning

Good morning


Thinkpad T440s

November 17 2019 · tech laptop thinkpad

I recently picked up a second hand Thinkpad T440s laptop as a replacement for my Macbook Air. The Macbook was stuck with 4gb of RAM with no option to upgrade it. For a few hundred dollars I got a Thinkpad T440s with the following specs

  • Intel i5-4300U dual core CPU @ 1.90GHz
  • 12gb RAM (maximum for the model)
  • 128gb HDD
  • 14” 1600x900 screen

I replaced the hard drive with a new 480gb SATA SSD. There are guides on the internet for replacing the screen with a 1920x1080 panel. You can also replace the …


Typescript I - Safe Fetch with Decoders

What happens when we run this Typescript code?

type Person = {
    Name: string;
    Sport: string;
}

async function loadPerson(id: number): Promise<Person> {
    let result = await fetch(`/person/${id}.json`);

    return await result.json() as Person;
}

loadPerson(1).then(person => console.log(person.Name));

person/1.json

{
  "Name": "Ortho Stice",
  "Sport": "Tennis"
}

Exactly what you think - it logs Ortho Stice to the console. Do you think the code …