Super Saturday Sharefest: Matt Massicotte’s XPC Work

Ok ok, I know Super Saturday Sharefest is not a thing, but it’s too late for Follower Friday, alright? I want to give a big shout-out to Matt Massicotte of ChimeHQ for dropping another awesome Swift open source package that makes using XPC Swift-ier. I’m really grateful for all the amazing work Matt has been doing and for sharing it with the community.

Continue reading …

WordCounter v1.6.6 Released

Teaser image

I have released a maintenance update to my app, WordCounter. Check out the release notes.

Some old code went out, some updated components went in. Most notably the date range picker from the statistics:

Latest date range picker of your stats

Since this update is built on modern macOS, I can’t support anything older than macOS 10.13 anymore without hassle, so that’s what’s required now.

I hope to have something fancier in store for the 10-year anniversay next year!

Get the WordCounter app for Mac.

Swift Pattern Matching with Extra Conditions, and the Value of Syntax Summaries

Natalia Panferova writes about Swift enum pattern matching with extra conditions and goes over:

  • switch-case statements,
  • switch-case statements with where clauses,
  • for-in loops with where clauses,
  • while loops with extra conditions (case let matching),
  • if-case statements.
  • (Missing, for completion: catch ... where in try-catch blocks.)

I believe there’s tremendous value in summaries like these to learn the Swift programming language and its syntax: these short summaries show a slice of different aspects of the language in close proximity.

The Swift language book tells you all about the structural programming features one after another in the Control Flow chapter: if, for, while, etc.

It also has a section on where, but that’s limited to the switch conditional statement.

The section on for loops doesn’t mention where clauses at all! You need to go to the Language Reference part of the book, where the formal grammar is explained, to read that a where-clause? is allowed.

for-in-statement → for case? pattern in expression where-clause? code-block

So a post like Natalia’s reminds us about the similarity of different aspects of the Swift programming language.

It’s zooming in on where-clauses, and so the reader gets to know a different “view” into the syntax as a whole that is different from the book’s presentation.

This should be very valuable to get from beginner-level understanding of “I can do things in Swift” to a deeper understanding of recognizing similarities across different aspects of the programming language.

These should, in my opinion, be included in the language’s handbook to help with “deep learning”. Until then, I’m glad we have posts like Natalia’s!