Gram matrix
An elegant algebraic identity says If x is the vector [a b] and y is the vector [c d] then this identity can be written where the dot indicates the usual dot product. I posted this on Twitter the other day. Gram matrix Now suppose that x and y are
Read moreThe Ultimate Guide to Building SwiftData Applications
SwiftData made its debut at WWDC 2023 as a replacement for the Core Data framework. Serving as a wrapper on top of Core Data, SwiftData…Continue reading on Better Programming »
Read moreDemystifying Kotlin’s Channel Flows
Why does Kotlin have two almost identical flow builders, and which one should you be using?Continue reading on Better Programming »
Read more(Yet) Another Way to Harm Performance With Moment.js
Image generated with canva.comMoment.js, a widely recognized date manipulation library, has been in legacy mode for almost three years now, starting from September 2020. However, it’s still slightly more used than its popular competitors such as dayjs and date-fns, at least according to npm stats (~17M weekly downloads vs ~14M
Read moreCircular, hyperbolic, and elliptic functions
This post will explore how the trigonometric functions and the hyperbolic trigonometric functions relate to the Jacobi elliptic functions. There are six circular functions: sin, cos, tan, sec, csc, and cot. There are six hyperbolic functions: just stick an ‘h’ on the end of each of the circular functions. There
Read moreSwift Enums Design Systems
Implement design systems with progressive disclosure — utilise the Swift type system for simple, customisable SwiftUI componentsIf you’ve worked on any large development projects, you’ll likely have encountered a design system. A design system is a library that encapsulates your branding into reusable components, colors, fonts, icons, and motifs, to help ensure
Read moreMnemonic hexagons
I posted some notes here about mnemonics for trig identities and hyperbolic trig identities. The post Mnemonic hexagons first appeared on John D. Cook.
Read moreSwiftUI apps at scale
It’s been production-ready since 2020SwiftUI is fantastic, but not perfect. Some of these imperfections are expected from a nascent 4-year-old framework, but just one creates the roadblock to wider adoption.Today, I’m going to tell the story of my SwiftUI journey at 3 startups; and explain my solution to the critical flaw
Read moreThere Is No Bad Code
A short reflection.Photo by Michael Dziedzic on UnsplashThere is no bad code.It just does the wrong thing very efficiently.The words effective and efficient both mean “capable of producing a result,” but there is an important difference. Effective means “producing a result that is wanted”. Efficient means “capable of producing desired results without
Read moreBest line to fit three points
Suppose you want to fit a line to three data points. If no line passes exactly through your points, what’s the best compromise you could make? Chebyshev suggested the best thing to do is find the minmax line, the line that minimizes the maximum error. That is, for each candidate
Read more