Software Dev

Introducing Swift Collections

Swift Collections is out with some new collection-oriented extensions on the Swift language as a companion to Swift Algorithms and Swift Numerics.

πŸ‘‰ Introducing Swift Collections | github

Swift Collections gives you hybrid collection types like Deque, which is an array with “efficient insertions and removals at both ends”, OrderedSet, which is a “powerful hybrid of an Array and a Set”, and OrderedDictionary (like the actual dictionary).

And of course, they’re efficient. Now go forth and collect in new ways!

Software Dev

The Singleton Pattern – When There Can Only Be One β˜οΈ

Like so many smart and courageous people, the Singleton design pattern is often misunderstood.

Whether it is attacked as an anti-pattern, maligned as untestable, or misused as a global convenience, singletons take a lot of πŸ’© for just being what they are: a way to enforce that there is only ever one of something. I think they should call this pattern “The One”.

A real life example of a singleton is The President of the United States. We only ever have one president at a time. That’s a key part of the concept. It’s not just a convenience.

In software terms, singletons make sense in many cases such as the one and only instance of the current app running on the current iPhone.

With all this in mind, this quick post provides some nice context about singletons (aka the President) versus just a shared instance (hey, let’s all share this one bike) in Swift.

πŸ‘‰ What’s the difference between a singleton and a shared instance in Swift?

Thanks to iOS Dev Weekly for calling out the ongoing confusion on this topic. πŸ™

Music · Songs

The Sad Moon Above (karaoke edition)

Here is a “karaoke” version of The Sad Moon Above (barking dog demo), with really basic instrumentation to sing to and potentially record a voice track remotely.

Anyone can sing to this version, and then I can go back and re-record a few differently-styled instrumentations. I’m thinking a “dreamy” version, a “noisy” version, a 50’s version, a Weezer version, and a Walkmen version.

Here’s my own take. I’m not a singer. πŸ€¦πŸ»β€β™‚οΈ

We shall see where this ends up…

Me · Music

“I Want It All” πŸŽΆ

Here is Japanese Breakfast’s perfect companion to The Walkmen singing β€œBaby, I want everything”.

I want it all.

Japanese Breakfast – Diving Woman

I’m feeling this vibe. I do want it all.

I don’t want six cars, a mansion, a helicopter, or even a fancy watch. Please, no. Just no.

I do want to travel, but not all the time. I could probably spend 1000 years happily just goofing around Central Texas.

But I do want to write a novel, make some music, raise some amazing kids, have a long and challenging career, learn to tell good stories and jokes, improve the world a bit, take care of myself, and be a good friend.

Am I asking too much? We shall see. πŸ˜†

We’re only given this one life, so you might as well at least try to make the most of it.

You’ll have it all
I’ll have it all
We’ll have it all