I was thinking about the definitions of ‘generous’ today and the question of what I means to be generous when you have nearly infinite resources came up. Lets have a thought experiment: I am eating with Jeff Bezos at Pamelas on Murray Ave. We have a nice breakfast and I offer to take the check and Jeff will take the tip. Being a nice guy, he leaves a 200% tip which for our theoretical breakfast comes to $100.

That number, objectively, is a good tip for a place like Pamelas. This theoretic Pamelas has an average tip amount of $12 with a standard deviation of $8 making this tip a serious outlier on the tip scale. Mr. Bezos is the 3rd[^1] richest person in the world, so he is the .0000000125%

Given that, what should he tip to equal his position in the global wealth scale? The Answer is that the $100 is probably already there (I calculated $65 for the 99.99999985% given the mean and the stdev). But is that generous?

Mr. Bezos net worth being something like $130 Billion Dollars, that $100 would be insignificant. If his net worth was the US Median at $121,760 then that tip would be $0.00010

Is it even possible for someone with Bezos-level wealth to be generous? The short answer is: I don’t think so. The reason sits with the fact that generosity is more about what _you_ have than what others have. Maybe.

I finished reading an article about why Haskell was their first-choice development language and I came to this nice list of
reasons:

  • Haskell has a strong static type system that prevents errors and reduces cognitive load
  • Haskell enables writing code that is composable, testable, and has predictable side-effects
  • Haskell facilitates rapid development, worry-free refactoring, and excellent maintainability
  • Haskell programs have stellar performance, leading to faster applications and lower hardware costs
  • Haskell is great for domain modeling and preventing errors in domain logic
  • Haskell has a large number of mature, high-quality libraries
  • Haskell makes it easy to write concurrent programs
  • Haskell enables domain-specific languages, which foster expressiveness and reduce boilerplate
  • Haskell has a large community filled with smart and friendly people

and I thought “Huh”.

Swift is true for all of these points.

And then I thought “Well, Swift is an acceptable Haskell”.

The article starts out by showing how higher order functions make things great in Haskell. Swift has those, too.

func squareMe(_ x: Int) -> Int {
    return x * x
}

let source = [1, 2, 3, 4, 5]
source.map { squareMe($0) } // returns [1, 4, 9, 16, 25]

This code is composable and reusable. Nice.

A little later there is some discussion of Abstract Data Types. The provided example is strange (to me) because it uses Integer Dollars. I think we can do better (and not just because it’s Swift).

import Foundation
protocol Currency {}

struct Dollars: Currency {
    let whole: Int
    let cents: Int8? // valid only between 0 and 100
    
    init(whole: Int, cents: Int8 = 0) {
        self.cents = (0..<100).contains(cents) ? cents : nil
        self.whole = whole
    }
}

enum InvoiceStatus {
    case Issued, Paid, Canceled
}

struct CustomerInvoice {
    let invoiceNumber: Int
    let amountDue: Currency
    let tax: Currency
    let billableItems: [String]
    let status: InvoiceStatus
    let createdAt: Date
    let dueDate: Date
}

We can then write functions on these data types. In the article there is a nice example of Haskell case statement. Swift has those, too.

func createCustomerNotification(_ invoice: CustomerInvoice) -> String {
    switch invoice.status {
    case .Issued:
        return "New invoice # \(invoice.invoiceNumber) due on \(invoice.dueDate)"
    case .Paid:
        return "Successfully paid invoice # \(invoice.invoiceNumber)"
    case .Canceled:
        return "Invoice # \(invoice.invoiceNumber) has been cancelled"
    }
}

Swift, like Haskell, requires case statements to be exhaustive. If we update the InvoiceStatus enum to include a new status Refunded the code will show a compile error and prompt us to fix the swtich cases.

I'm not translating all the examples from the article, mostly because if you want Abstract Data Types and higher order functions you can have them in Swift.

  • Swift has a strong static type system that prevents errors and reduces cognitive load
  • Swift enables writing code that is composable, testable, and has predictable side-effects
  • Swift facilitates rapid development, worry-free refactoring, and excellent maintainability
  • Swift programs have stellar performance, leading to faster applications and lower hardware costs
  • Swift is great for domain modeling and preventing errors in domain logic
  • Swift has a large number of mature, high-quality libraries
  • Swift makes it easy to write concurrent programs
  • Swift enables domain-specific languages, which foster expressiveness and reduce boilerplate
  • Swift has a large community filled with smart and friendly people

It’s quite possible I met Ernest Cline at some point in the late 80s, early 90s. He grew up in the nearest city to where I grew up. I spent my post-prom dinner at the truck stop on 250 that he likely went to. There was a pizza place near the University in that city as well.

To call it a “city” is being very nice, since the population of 20,000 makes it a small town by a lot of peoples reckoning.

These last two paragraphs, are full of nostalgia
And tell you nothing. They’re not even particularly well written. Much like the book, Ready Player Two.

I wanted to like this book so very much. I pre-ordered it. I enjoyed Ready Player One a great deal, even with it’s flaws. I did not read his sophomore work, Armada, though, because the reviews were so problematic I was afraid I’d hate it. I’m pretty sure I would have.

I kinda hate Ready Player Two. If you liked the first book, don’t read this one. The main character has turned into such a prick and he (the author) doesn’t indicate any kind of awareness of that.

One thing that nags me, though. I can’t help but shake the idea that many parts of Ready Player Two were influenced by The Boat of a Million Years. I might have even been reading that book when I unknowingly passed Ernest Cline at Truckstop 250 in 1990. It’s a nice thought.

I’m spending the first week of 2021 auditing cloud services and shutting down stuff that costs money but isn’t being used enough to justify it.

One of the backups I made during this Cloud KonMari was a web application that is 9 years old and hasn’t been modified in 7 years (maybe more? I seem to have lost the git repo it was originally placed in).

Surprisingly, I was able to copy the code to a new repo and on my M1 Macbook pro run the tests (they are green) and launch it and it still works. It is written in Clojure and I’m pretty impressed that this thing still works. The associated iOS application from the same project does not compile (Xcode doesn’t crash when it loads up, but it’s a mess of pre/post-arc ObjC targeting iOS 4).

It’s a cute film. Millie Bobby Brown is able to break the 4th wall and keep the movie from collapsing on itself mostly through the force of her charm. There are a few nods to the violence British Suffragettes contended with but it’s mostly a YA movie adapted from a YA novel without any revolting romance side plots (I know romance is important and I’m a big fan, but not every story is about love).

My teenage children also enjoyed it and it’s worth a watch just keep your expectations low and you’ll be fine. Also, just because they do it in a movie doesn’t mean anyone should play tennis in the library.

In some ways, I feel bad for Mr. Kantrowitz because 2020 was not a good year to publish a book. Always Day One came out in April, just as the lockdowns were really starting up in the US and it’s message of how the “Tech Titans plan to say on top forever” could have had better time of it. That being said, it’s not a great book.

I listened to this book on Audible. I don’t think that changes anything, but it’s worth noting his message was presented to me via a product of one of the very titans this book (theorectically) exposed.

One of the subtitles for the book is “Compete in the tech giants’ world using their playbook.” That must be from a different book, though, because the book I read was mostly a glowing hero-worship of the CEOs of these companies. Except for Apple. And a chapter about doing “Black Mirror” exercises.

Now, don’t get me wrong: “Black Mirror” excersizes are something everyone working on a technology product should definately do. It’s a good way to game out anything obviously dangerous about your product.

The Apple chapter is kinda baffling in this book. Amazon is great, according to this book, and you should be like them. Or be like Google, because they’re really smart, too. Apple, though, is filled with people who hate little people and want to destroy them. Even the CEO hates people (and I’ve heard Tim Cook called a lot of things but never an egomaniac that hates people).