WWDC 2021: Day 1 Thoughts

So far I’ve watched the Keynote and the Platforms State of the Union.

watchOS

The biggest thing to me was that a wishlist item I had this year and last year was finally done: watchOS apps will keep the screen on, not just show a blurred view with the current time. I had only asked for this for workout apps while doing a workout, but they are just doing it always, which is great.

They reworked the Breathe app, so I hope that they allow meditations more than 5 minutes. Also, I kind of want Tai Chi to log mindfulness minutes instead of workout minutes.

Swift Concurrency

Swift first class concurrency support is obviously great, but since Swift is open-source, we’ve known about this coming for quite a while. They seemed to have implemented it much like it’s implemented in other languages. I’ve been doing a lot of Typescript this year, and it seems basically the same.

They have also done a few important things related to this.

  1. If your asynchronous function returns a Result with a non-Never error type, they will automatically turn that into an exception.
  2. They provided async compatible versions of asynchronous APIs throughout their frameworks.

Focus

I am very much looking forward to the various Focus modes. I’m not sure that the new APIs will result in anything I want, but I am interested in innovation here.

Xcode Cloud

Xcode cloud isn’t going to be out for a while, but I signed up for the beta. My personal usage will depend on cost. I am using GitHub workflows for a new open-source swift framework I am building. In the past, I have used Microsoft’s App Center. Apple’s ability to provide cloud services to developers is mixed.

Things that are part of the app runtime, like notifications and CloudKit are excellent. They are reliable and fast. But, AppStoreConnect, the dev portal, and things like that are a mess.

If Xcode Cloud is considered mission critical and treated like notification delivery, then it will be great. But, I do suspect it’s more likely to be like AppStoreConnect (and I’m just talking about speed and reliability here — not the other pain points).

Face Time Data Channel

As part of the new Face Time improvements, they added an API to sharing data in a group to be used however the app wants. The demo was a shared whiteboard. I think this will be interesting beyond the obvious applications for streaming apps and games.

Random Stuff

There were a bunch of other random things that seem interesting.

  1. iCloud+ seems to come with a VPN now
  2. All the RealityKit stuff seems great — especially the object capture
  3. Playgrounds being able to make and deploy apps is great, but I don’t think this is for professionals.
  4. Multitasking menu on iPad will finally make this usable. This is the only thing that makes me want to update my OS immediately.
  5. Hoping on-device Siri works well, but my problems are with Siri just never responds sometimes (mostly music requests while out for a run).

WWDC 2021 iOS Development Wishlist

WWDC starts tomorrow. Here is what I want in iOS development. Most of these probably apply to all of the platforms, so I mean this as the more as the frameworks that are on all of Apple’s OS’s.

  • Provide Combine interfaces for all frameworks. Or at least something more natural for SwiftUI. This would include at least CoreLocation, HealthKit, and CoreData. It would be nice to have an RxCocoa style interface to UIKit, but I think that’s probably not on their radar.
  • I’m not sure what would make screen navigation easier to understand in SwiftUI, but what we have now doesn’t seem right.
  • It would be nice if Apple had first party support for an anonymous way to track a link to the AppStore to an installation and run of an app. This is something in Safari already (ad click attribution for the web). And then, make this the only allowed way to do this.

This isn’t a developer ask, but I would love Apple to provide a pasteboard manager for iOS. These are common on macOS, but the privacy model of iOS precludes third-party implementations. Even if it was just in iPadOS, it would go a long way to making iPads more usable for more complex work. I don’t think it would desirable on iOS to make APIs that would make it possible for a third-party to make one.

Dependency Based Tech Debt

One of the things I am doing right now is ripping Bootstrap out of App-o-Mat. The site was mostly built in 2013 and at the time, Bootstrap was good about hiding all the float/clear/positioning nonsense from CSS and giving you a simple grid system. Once I had it, I used everything else it brought along. The site markup is pretty coupled to Bootstrap.

My plan is to build it on just a very small amount of hand-written CSS. Modern CSS has flex and grid layouts built-in, and so re-implementing what Bootstrap offered for layout is not that hard (especially for my limited usage).

When I’m done, my only frontend dependency will be on highlight.js, which syntax colors my code samples.

Ripping out dependencies is a recurring theme for me when a codebase starts to age. I wrote about this in Tech Debt Happens to You.

And I think that this is the main source of tech debt, not intentional debt that you take on or the debt you accumulate from cutting corners due to time constraints. The debt that comes with dependency and environment changes.

Being able to bring code into your project or build on a framework is probably the only thing that makes modern programming possible, but like mortgages, they come with constant interest payments and a looming balloon payment at some point. 

There are some you can’t avoid, like the OS, language, and probably database, but as you go down the dependency list, remember to factor in the debt they inevitably bring with them.

Of course, in 2013, the trade-off was probably right for me. I really didn’t want to build anything complex with CSS as it existed. Today, I be hard-pressed to take on any CSS framework dependency (I looked at Tailwind).

It’s not that they aren’t useful—it’s that I don’t have time to keep up with the dependency management problem they will bring with them, and they don’t promise any kind of long-term backwards compatibility (like SQLite does, for example).

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.

Write While True Episode 12: Keep a Topic List

In the past, when I set goals to write more frequently, I was always stopped by not having ideas ready for what to write about. Or when I got one, I didn’t have a systematic way of collecting them. I would sit down to write, but getting started on a new piece was too difficult.

My ONE thing is make it so that when I sit down to write I have a checklist to work from.

Transcript

May 2021 Blog Roundup

I started the month writing about long-lived systems

But mostly, I wrote about how I think about personal finance:

The first post is about savings rate, so I made a spreadsheet and python script to help understand the effect I was describing

The second lesson was about increasing income, and I wrote two posts following up on that

Finally, I wanted to say a few words about excessive saving

And, I continued releasing Podcast episodes about writing

I’m doing a lot with SpriteKit and making tutorials on App-o-Mat as I go.