Category Archives: Software Development

WWDC 2021 Developer Tools Wishlist

WWDC 2021 starts Monday. Here are some of the things I hope to see with the developer tooling.

Xcode

  • Playgrounds are still super-buggy. I get red-squiggles and false errors everywhere in source files.
  • Ditto with SwiftUI previews. Even for simple stuff, I constantly need to reset them.

Swift

  • Support for narrowing, like in Typescript. With narrowing, your conditionals are taken into account when checking for the correctness of your code. So if you check is something is not-nil, then inside the if block, I can use it. This is better than an if let, because that creates a new constant and you cannot modify the obj using it. There are also more complex possibilities that are not possible with if-let.
  • Compilation speed.

I write Typescript in VSCode which is a freaking Electron app and it smokes Xcode with Swift.

It checks for errors as you type and it’s fast, never wrong, and always works. Typescript is also a type-inferring language and JSX is similar enough in spirit to SwiftUI. I have no idea why Microsoft can do this and Apple cannot.

WWDC 2021 watchOS Wishlist

WWDC 2021 starts Monday. Here’s what I’m hoping to see that would help me with Sprint-o-Mat.

  • Third-party workout apps should be able to keep the screen live, like the built-in app does. It’s a pain to do workouts and see blurred screens, especially for apps like meditation or yoga where you might not be able to easily move your wrist. Even with my app, I constantly see blurred screens during my run and have to shake my wrist to see my progress.
  • The Activity app has bugs with showing third-party workouts. There seem to be undocumented data types that the real Workouts app is able to write, and segments don’t work at all.
  • There are still a bunch of kinks with regards to independent watch apps. For example, users control HealthKit permissions on the watch, but location on the phone.
  • There is still no way to use the built-in timer controls with SwiftUI. They are built to be battery efficient, so making them available makes it easier to keep the screen live.

This list is pretty similar to last year because they didn’t address any of these. The first one would be good for all workout apps, so I really hope they do it this year.

Learn by Cloning

The App-o-Mat website was mostly written in 2013. The backend is in Django, and over time I have had to constantly upgrade that, so now it’s on pretty modern Django and Python 3.

The frontend is simple HTML, but uses Bootstrap and a bootstrap template for layout and styling. I decided it was time to abandon that and just build it on CSS Flex and Grid. The styling isn’t complex, so I can easily write the CSS for that.

I found this YouTube video to be a great whirlwind tour to implementing a design in modern CSS.

He mostly just plows along and does it, which was good enough for me.

In my version, I am learning from the lessons of Tailwind and relying nearly 100% on utility classes (or by selecting tags classlessly), so that I can do everything I need from the markup and inside server-side components. I would use Tailwind, but it’s overkill for my system, and I am sick of updating dependencies for this site.

In the end, the site should be pretty much the same, except with no Bootstrap and fairly simple CSS that I can maintain going forward.

The Amazing Voice Master

In yesterday’s episode of Write While True, I spoke about how making things changes you. This is true even if what you made isn’t that great. I asked you to think about the programs you threw away.

In my morning pages today I tried to start from the first program I ever wrote and think about all the small things I made and never finished. I hadn’t thought about it in years, but I reminded myself of the Amazing Voice Master and found an ad for one in the Internet Archive’s Compute! Magazine archive.

The Voice Master ad claimed it could turn humming into sheet music, but I guess I didn’t hum in tune.

I mostly remember making card games that responded to voice, which worked a little better, but I did learn to be skeptical of voice recognition claims. Perhaps that prepared me to do my Skillshare course and Smashing article on Siri.

Design by Opposite Example: Nebulous

Yesterday I wrote about a way to think about designing something: by comparing opposites. I also think you can use the idea of opposites to generate a new thing from something else.

This is an exercise I did recently to design a game.

I call it Nebulous, because it’s meant to be a play on a “nebula”, which I am thinking of the opposite of an asteroid. Nebulous is the opposite of Asteroids.

Here are some essential elements of Asteroids

  1. It is about survival through evasion and destruction. You die if you touch an asteroid (or spaceship or get shot)
  2. The camera is stationary in space
  3. The game surface is the finite surface of a torus (it wraps on the sides)
  4. It is black and white
  5. All of the game elements are a stroked white shape
  6. You pilot a ship that can thrust, rotate, fire, and hyperspace

I used this to generate what could be the essential elements of Nebulous

  1. It is about survival though finding and nurturing. You die if you run out of energy, which you get by flying through a nebula.
  2. The camera follows the ship
  3. The game surface is infinite in all directions
  4. It uses color. Each nebula has a color and the color indicates its behavior. Mixing colors is part of game play
  5. (not sure yet of the design language)
  6. You pilot a ship that only has two thrusters. You turn by using just one of them. You can eject stored nebula gases.

I am still thinking about this. At this point, I don’t need to keep thinking about the opposite of Asteroids — this starting point will be the seed that goes in its own direction from here.

My Third Lesson in Personal Finance: Optionality

My early career was in writing financial options software, so I’ve been around the concept for options for a long time. The general characteristic that’s important to understand is that it has a fixed, low cost and a (low-relative-probability) of very high upside.

My ex-boss, Philip Brittan, wrote this piece about optionality back in 2014 on an internal blog and recently posted it publicly. It goes over the technical details, but generally, when I read it I was reminded about the power of the generic concept of options when applied more broadly.

He ended: “In general, you should be on the lookout for situations that naturally make you long options and give an asymmetrical (‘unfair’) advantage”. (being “long options” means you have options — as opposed to short, where someone has options on you).

Applied broadly, there are many things that “have optionality”. For example, renting instead of buying. But, for now, let’s concentrate on optionality in compensation.

At the time I read this, I was consulting. The kind of optionality that consulting offers is options on opportunity and freedom. You can easily change what you are doing or when and where you work. You can stop and start at will, comparatively. But, in consulting, pay is mostly tied to work and does not have options-like returns.

Before that, and for most of my career, I worked for startups that had some kind of optionality in the pay structure. My first job had an unlimited profit-sharing bonus pool that was literally a percent of profit that was not capped. At other times I had equity-like instruments, options, or RSUs. I also did limited work for free for a share in future profits.

My personal finance plan was just a normal compounded returns and high savings with an exponential curve, but when I look at what actually happened, there are these moments of step-wise lumps when one of these options paid off. I was lucky, for sure, but also, I took a lot of shots.

The key was that my options mostly felt free to me. I was completely satisfied with the job and guaranteed pay, so the option was extra. It might be true that I could get more elsewhere, but I was satisfied.

My default plan would still work.

I think of optionality in compensation the way some people think about playing the market with “play money”. I’d be ok if the options expired worthless. It’s another way I think programmers can “beat the market” with labor instead of by picking stocks.

Consider C4 for Systems Interviews

I recently ran into the C4 model for visualizing software architecture. It’s simple and notation agnostic (meaning, you don’t need to learn the meaning of arrow heads).

One of the things I noticed in giving systems interviews is that the interviewee didn’t have any kind of coherent way to visualize their system. So, it was hard to understand what they were saying.

The benefit of C4 is that it’s just slightly more organized than doing nothing. It also asks that you provide a key/legend for any notation choices you make.

I think that most of the benefit comes from the suggestions to use more text. For example:

Boxes have a name, type, and a short description. Think of it like this: NAME is a TYPE that DESCRIPTION.

A C4 container box that describes "Sprint-o-Mat' as a watchOS App that guides you during an outdoor run

Arrows form a sentence when read as “BOX A” — “arrow text” –> “BOX B”.

A C4 container diagram that says that Sprint-o-Mat stores workouts in HealthKit

The idea is that the diagrams are stand-alone and are mostly organizing short text snippets.

They are also hierarchical—meaning that if I need more information, there would be possibly be a set of sub-diagrams for each box. Without C4, I think many people would just have the boxes with just the names (titles) and unlabeled arrows.

The metaphor is a map that starts zoomed out and gets more and more detail as you zoom in.

I am mostly suggesting this as a sketching/communication visualization using a whiteboard. But if you are trying to do C4 to keep real diagrams, then generating them from some kind of DSL is much better. PlantUML provides a free solution, and the author of C4 has a freemium solution called Structurizr.