Closures, part 2

Posted on Sat 15 February 2020 in swift • Tagged with swift

Another day of 100 Days of Swift, with more closure confusion this time. Closure syntax is complicated on its own, without even considering all of the shorthand and optional syntactic structures, from trailing closure syntax. The confusion is compounded by the way that the Xcode editor will suggest some shorthand …


Continue reading

Closures, part 1

Posted on Fri 14 February 2020 in swift • Tagged with swift

Today I'm continuing to day 6 of 100 Days of Swift. Today we're back on closures. I use closures a lot in Swift and Objective-C, but mostly by recipe. This recipe/copypasta code is exactly what I'm trying to get past with 100 Days of Swift, so let's dig in …


Continue reading

Swift Functions

Posted on Thu 13 February 2020 in swift • Tagged with swift

Onward to day 5 of 100 Days of Swift. Today was all about functions, and there were a few things that I didn't remember, mainly because I don't use them much when I code.

First up is variadic functions. I don't use these because I tend to use arrays when …


Continue reading

Swift Loops

Posted on Wed 12 February 2020 in swift • Tagged with swift

I'm stuck in a loop, doing day 4 of 100 Days of Swift again.

Only two short comments today.

First, I'd forgotten about repeat loops. Does anyone really use them?

repeat {
    print("The body of a repeat loop is always executed at least once.")
    break
} while true

Second, I also …


Continue reading

Swift Operators & Conditions

Posted on Tue 11 February 2020 in swift • Tagged with swift

Onward to day 3 of 100 Days of Swift!

Just a few tidbits today. First of all, I'd forgotten about the fallthrough keyword in a switch statement. I guess I understand the intent here, people forget to use break all the time. However, it seems like every other language's switch …


Continue reading

Swift Complex Data Types

Posted on Mon 10 February 2020 in swift • Tagged with swift

Yay, on to day 2 of 100 Days of Swift!

I'd forgotten that dictionary literals in Swift are written with square brackets, instead of with curly braces like pretty much every other language that I've used.

var languages = [
    "Alex": ["English", "Italian", "Japanese"],
    "Skyler": ["English", "German", "Latin"],
    "Hal": ["English", "German"],
]

I'd …


Continue reading

First Steps in Swift

Posted on Sun 09 February 2020 in swift • Tagged with swift

I'm tackling 100 Days of Swift again. Last time I tried it, I got sidetracked by personal stuff and bailed after a few weeks.

I've already shipped a few apps in Swift, so I'm not doing this to learn Swift from scratch. I'm trying to learn the useful patterns and …


Continue reading

Doing Things Poorly

Posted on Sun 09 February 2020 in personal

In the spirit of 2020 being a kick-ass year for me, I've decided to re-start this blog.

Expect a lot of garbage: daily posts on (re-)learning swift development, regular flailing away at machine learning stuff, and other explorations in my personal or work interests.

I recently watched Olivia Remes' …


Continue reading

"Chart Remake"

Posted on Sun 19 June 2016 in datavis • Tagged with dataviz

Since May I’ve been reading and following along with Joel Grus’ Data Science From Scratch. One of the first things we learn in this book is how to make charts in Python with matplotlib.

I’ve also been reading the Wall Street Journal daily and The Economist weekly. As …


Continue reading

"iPad Pro Initial Reaction: A Timeline"

Posted on Sun 19 June 2016 in personal

I’ve had my iPad Pro for only about a week.

I’ve wanted something like an iPad Pro for years. Ten years ago, I lusted after the Modbook, a clunky attempt to hack a MacBook by replacing the keyboard and hinge with a stylus sensitive display. The lure of …


Continue reading