Author Archives: Lou Franco

Review of Quantum Country

Yesterday, I wrote about how Quantum Country is helping me understand what books are for. As a recap, QC is a series of essays about quantum computing. You should think of it like a text book—they are not trying to write a pop-sci, hand-wavy, high-level overview, but a serious science/math book suitable for a college level class. Basic linear algebra is a pre-requisite to understanding it.

The book is also an exercise in a new form they call the “mnemonic medium”. Embedded throughout the text are interactive flash cards that test you on the material you just read. Depending on how you rate your own memory, they will used spaced-repetition algorithms to show you cards more or less often—the aim is to show you a card just before you will forget the answer. Using this system, you should be able to remember the content indefinitely (and need to visit and test yourself less often over time).

Does this work? I was tempted to review the book by just listing out the facts I remember, but honestly I think that would be boring to read. I did do that exercise, and I can remember quite a bit right now, but I just finished the book last week. I read it fairly slowly over six weeks and did the cards as prompted. I also did a few of the proposed exercises (which involve linear algebra), but not all of them.

In addition to the mechanics of quantum computing, I do think I also understand the higher level “point” of it. I don’t think I could make my own circuit to do something, but I could do the math to analyze a circuit. I have also gone on youtube and watched the more challenging presentations on quantum computing (the similarly math-y ones) and was able to follow them quite easily. If the “What is it for?” for Quantum Country is to teach the reader quantum computing, I can say that it was successful at that for me.

Here is a motivating example of why you’d want to know about quantum computing. In quantum computing, the fundamental unit of computation is a qubit (or quantum bit). They are quite a bit harder to make than our classical bits, but a system of N of them can represent 2^N states, and a state change on that system (affecting every qubit) can be done in constant time.

We are currently extremely limited in the number of qubits we can make and keep stable. Reading the result of the system is noisy and imperfect. However, we have still been able to do computations that are impossible on classical computers (just because of sheer size). This feat is called quantum supremacy, and has been achieved by a few research groups.

The essays include a description of a quantum computing search algorithm that can (probabilistically) find a value in an unordered list in O(π/4*(sqrt(n))) time (instead of O(n)). Just knowing that that is possible and the basics of how it is done was worth the read to me (even though I can’t say I fully understand it).

So, if you can multiply matrices, I would say to read Quantum Country enough to see if it interests you. I would at least try to get through some of the embedded flash cards to experience the mnemonic medium.

What are books for?

Questions are places in your mind where answers fit. If you haven’t asked the question, the answer has nowhere to go.

– Clayton Christensen

Clayton Christensen said that he came up with the disruptive innovation theory by asking the question “why do well-run companies go out of business” when he entered business school. He attributed having a unifying question to guiding his research and being open to answers.

I am similarly thinking about the question “what are books for?” I don’t have a lot of good answers yet, but I have seen something that I think is part of my answer.

I just finished “reading” Quantum Country, which is a series of essays about quantum computing. The material is very challenging, but they have a novel technique for helping you process and remember the content. They embedded flash cards in the text, and the site uses spaced repetition algorithms like I described yesterday in my post about Anki.

So, their answer to what books are for is something like “to transfer knowledge from the writer to the reader”, which is an obvious answer, but I have rarely read a book that tries to do this so thoroughly.

There is another answer in this text, somewhat meta, which is “to advance the idea of mnemonic media”, which is what they call this style of book. It’s not surprising that a new form of media would need to explain itself—it’s like how music in new genres needs to explain the genre they are in (see “Rock and Roll is Here to Stay” and “Rapper’s Delight”)

In the world of publishing, there are other possible answers such as “to increase the reputation of the author”, “to entertain while reading”, “to sell related services”.

It’s not so much that I want to know what books are for generally, but more about what I think they should be for. And once I know what they are for, to question whether books are even the right way to deliver on that.

Playing Non-programming Books

Yesterday, I wrote about how to play a programming book by adding bosses to chapters so that you can’t move on until you beat the chapter.

I think it’s clear how you can do this with programming books. I published “bosses” for (as of now) the first ten chapters of The Swift Programming Language. I have more coming.

But, this basic concept can be applied to other books as well, and I am using two tools, Anki and Obsidian to do this for myself. Anki is where I put the facts of the books, Obsidian is where I manage my own thinking.

Anki

Anki is a flash card system that uses spaced-repetition algorithms to aid memorization. You make flash cards while you read to help remember the facts you want to keep top of mind, and then you just “study” them once a day. All the cards you ever make are in one pile, mixed together.

You tell Anki how confidently you remembered the answer, and it will show it to you less often the more confident you are. Over time, when you have made hundreds or thousands of cards, you will still only study 10-15 per day, but Anki will have chosen the ones you were most likely to forget.

Obsidian

Obsidian is just a personal system to manage your own writing. There are many apps in this category, but I use Obsidian because it creates simple markdown files in a folder on my computer, and has all of the features I need (tags, links, search). I like that it is an app on my laptop, not a website.

I am following the note taking system outlined in How to Take Smart Notes, by Sönke Ahrens. I recommend this book for the full details. The high-level summary is that you write notes while you read to develop your own thinking.

Your notes are not quotes from the book. A simple note might be your original restatement of the ideas of the book. My favorite kind of note is applying the ideas of the book to a problem I am working on. If you want to remember a quote from the book, put it in Anki or in a research note in Obsidian (a folder you create just to hold the source material notes). Most of your note taking should be original writing.

Once you have written a note, you link it to related notes, and over time you develop an interconnected web of short bits of writing. Each note is short and represents a single idea—it should be developed as finished, polished paragraphs.

When you want to publish something—a blog post, an article, a podcast script—you can draw on your notes with pre-made bits of writing that you can simply assemble, and then write the connective bits to develop it as an argument.

Playing the book

I have only been following this system for a few weeks, and I have written over 14k words in 81 individual notes. This post draws from some of my notes.

To get back to how to play books, I make writing notes and cards a gate to moving on in a book. If I literally have no original thoughts or nothing in the book is worth remembering, I give serious thought to whether I should continue reading it.

Playing a Book

I’ve been thinking a lot about what books are for. Specifically, non-fiction books, and more specifically programming books. I’ve finally figured out how to describe what I’ve been thinking: You don’t read a programming book, you play one.

I mean play, like playing a game. In a game, you progress through levels by learning and applying skills. At the end of the level, you play against a boss that you have to beat to progress.

In books, you progress through chapters. But, there is nothing that stops you from just reading and reading and reading and well, not learning or applying anything. At the end of a chapter, you can just turn the page and keep going.

Over on App-o-Mat, an iOS content site I maintain, I’ve been working off and on a companion to the The Swift Programming Language book by Apple. I started the companion on Dev.to with a short section on how to read the book, where I said you should it read it side-by-side with an Xcode Playground page open. That you should not copy any code into it, but type code as you learn it. Get used to typing code.

Then, for each chapter, I offer some simple exercises that let you know that you understood the chapter.

I now realize that I was turning chapters into levels with bosses, which make The Swift Programming Language a book you can play.

Tech Jobs Are Not Performances, So Why Do We Audition?

I went to see an orchestra perform Beethoven’s Fifth last night, and it reminded me about what bothers me about typical tech interviews. If you want to be in an orchestra, you need to audition. That makes sense because an audition is close to what the job actually is—a performance. This also makes sense for actors, comedians, dancers, etc.

Programming is not a performance

A typical tech job is not a performance. For one, there is no audience. And, unlike a performance, we make tons of small mistakes and corrections along the way. Imagine a band performing a song like we usually program—it’d be a mess and not very entertaining (or very entertaining if you think of it as avant-garde).

I’ve known this for a while. In fact, when I get asked for interview advice, I usually say this directly: “Treat it like you are a violinist trying out for the orchestra. Practice, practice, practice. Ask your recruiter what kind of code you’d typically have to write during the interview (algorithmic, UI, a full-stack app), and practice that. Practice the tools/IDE, frameworks, language, etc. Think of it more like performing a piece.”

Now, to be clear, I’m not a big fan of this kind of interview. But, often as job-seekers, we don’t have the ability to change this—especially if there’s a specific job we want. I had a 22+ year career, wrote a book about iOS development, and had many public artifacts of my work, but I got my last job by passing several “auditions” that I practiced for. I personally don’t intend to ever do that again, but I wanted this specific job, and this was the only way to get it.

Instead, let’s try portfolio review

What I think would be better is a portfolio review. This is what you’d do if you hired an artist, craftsperson, or other professional where the job is to produce works. Portfolios give us insight into what the person could make given typical conditions and not under time constraints with every mistyped keystroke interpreted as a short-coming.

We already know this. When hiring consultants to do tech work, it’s the norm to look at portfolios, and not to do a tech screen. When I was consulting, I prepared a website with a description of my credentials and links to my work. I was never asked to live-code to get a consulting gig.

The problem is that not everyone has a job that produces public works. Even if the product is public, we need to see the code, since that’s the part a programmer makes. There is some privilege in being able to have time to create these works.

But, I don’t think it needs to be a huge piece—it’s likely that an interviewer could only spend 20-30 minutes looking at it. The important thing is that the work conveys a positive answer to the question: “can this person do the job?”.

I wrote about portfolio-based interviews back in 2011.

If you don’t have a public project, and are thinking of preparing a portfolio piece, it doesn’t have to be a giant project. I think something with a dozen or so code files is about the right size to review. If you are showing me something much larger, then point out a part that I should focus on.

I’m kind of surprised that this hasn’t become more common by now, as it did seem like it was happening organically. GitHub links have been common for a while. StackOverflow introduced Developer Stories in 2016, which are focussed on showcasing your work. I have never seen one as part of an application.

Bonus: They could be blind

When orchestras started using blind auditions, gender balance improved:

Using a screen to conceal candidates from the jury during preliminary auditions increased the likelihood that a female musician would advance to the next round by 11 percentage points. During the final round, “blind” auditions increased the likelihood of female musicians being selected by 30%.

We could probably do our current tech interviews blind using a voice changer over a screen sharing service, but it would be awkward. A portfolio review is easy to do blind.

In fact, tech conferences that use anonymized proposals, often result in a more balanced speaker group. See !!Con:

Proposals will be anonymized to avoid bias. Although we ask for your name, email address, and so on in the proposal submission form, only one or two organizers who serve as anonymizers will actually see this information, and they won’t review your proposal. The rest of the organizing team will review your proposal without knowing who you are.

Here are the speakers that resulted from that process.

A blind process won’t guarantee a balanced result, but I believe we have enough evidence to believe it would improve balance.

What Employers Could Do

If an employer wanted to move to a portfolio review, I’d suggest something like the following

  1. Explain it clearly in the job posting
  2. Make it clear that the piece does not have to be big
  3. Ask for code and writing samples (blogs, StackOverflow answers, etc)
  4. Give some idea of the judging criteria
  5. Offer to pay applicants to create the portfolio piece if they don’t have one. I would say to do this on self-reported need. Perhaps after passing a resume screen
  6. Do it blind
  7. Create a rubric that takes many attributes into account (not just “algorithm implementation”). Examples: documentation, tests, consistent code style, reasonable abstractions, correct use of language/framework idioms.
  8. Train the judges and have each portfolio scored by many people

And for their current employees—give them time to create public works (open-source, blogs, etc).

I’d love to hear any any experiences on both sides of a code portfolio review. What worked, what didn’t. If you have something like a code portfolio prepared, I’d love to see a link.

WWDC 2020 Wishlist – Xcode / Swift

Yesterday I posted my watchOS WWDC wishlist, which is driven by what I am seeing in building Sprint-o-Mat.

I recently started working with Typescript and VSCode on an open-source project that needs a Swift and TypeScript version of the same functionality. I wrote a Swift version, and then did a very faithful (almost line-by-line) port to Typescript, which I did not know at all before starting. I never used VSCode (or Atom) before starting.

Microsoft makes excellent developer tools.

My project is admittedly very small, but luckily I can see how it works with with a large project because a minimal React site with Typescript has 48k files of dependencies. VSCode has nearly instantaneous code-completion and real-time error reporting. A minimal app in Xcode isn’t nearly as fast or reliable.

The combination of VSCode and Typescript makes Xcode and Swift look a decade behind. It’s comparable to Apple’s lead in chip design and the advantage that gives to its products — that’s the kind of lead Microsoft has in developer tools. Luckily for Apple, that advantage mainly flows to in-browser and server-side development, where Swift has effectively no usage.

Xcode / Swift Wishlist

  1. Make Xcode reliable and fast
  2. Make Swift compilation reliable and fast
  3. Make Swift type inference flow knowledge about values into conditionals. Here’s a simple example:

    let x = (anOptional != nil) ? funcExpectingNonNil(anOptional) : fallback

    We (and Typescript) know that anOptional is not nil in the call to funcExpectingNonNil, but Swift does not.

WWDC 2020 Wishlist – watchOS

Like previous years, my wishlist is highly influenced by what I’m working on and is not a prediction — just stuff I have needed in the past year.

I Just released a new watchOS app, Sprint-o-Mat that helps me in outdoor running workouts. I had actually started it before WWDC 2019, but completely started over to do it as an independent watch app on SwiftUI.

Here’s what I’d like from watchOS

Allow the user to control location privacy in the watch’s settings app
You can already control HealthKit authorizations on the watch, but changing location authorization makes you use the iPhone. This is impossible to link to, and very hard to explain.

Make some SwiftUI equivalent to WKInterfaceTimer
This view is what makes showing a timer easy and performant. You can update it with elapsed time at a low frequency, but it updates its view in between so that it looks like a running timer.

Unfortunately, you can’t even host WKInterfaceTimer in a SwiftUI View (via interop) because it doesn’t have a default init (and can only be constructed via a Storyboard)

Allow workout apps to keep showing on the display when a workout is running
When you run the built-in Workouts app, the display stays on and shows the UI of the app. For 3rd party workout apps, when you lower your wrist, the display shows the time and a frozen UI under a blurred overlay.

This means that 3rd party workout apps require the pre-always-on wrist movements if you want to see their updated UI.

Add the APIs that the Workouts app uses to send data to the Activity app
The built-in Workouts app appears to have private APIs (or private metadata) that the Activity app uses to enhance the workout display (e.g. custom icons, per-segment data). I’d like to see those, and even new ones, publicly available to any workout app.

Make some canonical way to base font-sizes on display size
There isn’t a good way that I can see to make a single View for 38mm and 44mm watches that look good without hardcoding or hacks.

There are a lot of other issues that I ran into, but the general idea of an independent watch app coupled with SwiftUI and the simplified app architecture more than makes up for it. If Apple just keeps moving this forward in big steps, I’ll be pretty happy.

WWDC 2019 Wishlist Results

Parameters in SiriKit custom intents & Fine-grained Shortcut integration (apps provide blocks): Parameters are definitely in and I believe (from the SOTU demos) that the Shortcuts app can directly call into intents with parameters, thus enabling more fine-grained interactions. This is great news, and even if you don’t think Siri as a voice-assistant would be useful for your app, you should want this for Shortcuts integration.

On-device transfer learning in CoreML: This is also in and unlocks all kind of on-device ML applications. There is also a new category of “easy” ML integration (voice/sound analysis) along with a ton of other improvements. CreateML is now a Mac app instead of being integrated into Playgrounds.

HKLiveWorkoutBuilder (from watchOS) in iOS: I don’t see any mention of HealthKit or workouts at all in the release notes, so no luck here.

Web->AppStore->App ad attribution (w/o user tracking): Even though this was not announced, I have some hope that this could happen. The WebKit announcement of an privacy preserving ad click tracking mechanism is evidence that this problem is on their radar.

The App Store story is even worse, because there is no official way to pass some kind of data through your App Store URL that the App gets on first start. The normal attribution mechanism, IDFA, is not available to websites (only apps), so the only way to do a website-ad -> AppStore -> App attribution is for the web site and App to “fingerprint” the user somehow. One simple way is a correlation with time and an IP address, but that isn’t perfect. Unfortunately, many apps (and 3rd party ad trackers) do not stop there.

The last few years have been a cat-and-mouse game between Ad Tech firms finding loopholes in iOS (e.g. shared Pasteboards) and Apple closing them. It would be much better if Apple provided a privacy preserving mechanism and then explicitly forbade anything else in the developer agreement.

Multi-select image picker: No luck this year.

WWDC 2019 Wishlist

Today I tweeted

Here’s a quick elaboration

Parameters in SiriKit custom intents: The custom intents that were introduced last year do not support recognition-time parameters. All of the parameters of the intent must be baked into the intent. SiriKit calls this “resolving parameters” and the built-in intents all support this, but custom ones do not.

On-device transfer learning in CoreML: Transfer learning allows you to build a new model from an existing one by providing more examples. CoreML added that last year, but you still need to train and build the new model off-device. I’d like a way to build new models this way on-device from device gathered examples (which would preserve privacy).

HKLiveWorkoutBuilder (from watchOS) in iOS: This class is only available for watch workout apps, but a simpler version would be nice for iOS workout apps. It obviously can’t gather heart rate, but it could automatically build the route and perhaps use a less sophisticated algorithm for guessing calories burned.

Web->AppStore->App ad attribution (w/o user tracking): The WebKit team just announced a privacy preserving ad attribution system for websites. I want the same thing to work for an ad for an app that appears on the web, App Store, or in another App. No need to attribute to a user — just the ad source is sufficient.

Fine-grained Shortcut integration (apps provide blocks): The Workflow team integrated the x-callback-urls of a bunch of popular apps into blocks — and Shortcuts still has them, but as far as I know, there’s no API for apps to provide small bits of functionality for Shortcuts to use as a building block. Even with the ones they have, the app comes up, does a bunch of stuff and then returns. A more streamlined experience would be nice.

Multi-select image picker: The current UIImagePickerViewController doesn’t support multi-select of photos. If you want to do this, you can build your own VC, but then you need to ask the user permission to their entire photo library in order to show them the photos. Since iOS 11, you have been able to bring up a picker without permission since it runs out-of-process and doesn’t give your app any access to the photos–just the one the user picked.

SwiftFest

I will be speaking about my experience with RxSwift at SwiftFest 2019 in Boston on July 29-30. Last year, I spoke there about how to sketch iOS UIs in Playgrounds — unfortunately the talks are not available online, but I’ll be putting together a video shortly that covers the material I spoke about.

I highly recommend this conference — it’s two-track and has about 300 attendees. I went to talks every chance I got and learned a ton. It will also be a good time to discuss the ramifications of WWDC as we’ll all have add a couple of months to absorb iOS 13.

If you are going to be there, contact me here or on twitter.