Top all-time · #25475
Andrew Bancroft
Personal blog · andrewcbancroft.comprogramming
Andrew Bancroft's personal blog at andrewcbancroft.com covers programming. Since 2016, 3 different Hacker News readers have linked it 3 times. It is still writing: the last post was on 2026-07-22, and you can follow it by feed.
Too few sampled comments (2) to say how often HN recommends it.?
Why HN links it
HN readers link Andrew Bancroft's Swift posts on protocol-oriented programming and language features. One thread questions his explanation of pattern matching in the Swift 3.0 examples.
Summarised by Claude from a sample of 2 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
What Hacker News says?
Your cases 2 and 3 are pattern matches . It's perfectly fine to use regular equality with optionals (case 2) or enums (case 3), but in that case you're not matching a pattern you're comparing two specific values , and you need the types to be equatable[0] (enums aren't by default, though optionals are if they contain an equatable value). * you can write "foobar == .someEnum" if you've defined "==" for your enum type…
Comment linking /2015/07/01/every-swift-value-type-should-be-equatable/
on “Swift 3.0 Released”Submitted Swift Dates Cheat Sheet Playground as a story · 1 points
HN discussionA major difference is that, in Java, the only way to make a class implement another interface is by changing its source. In Swift, on the other hand, one can make a class conform to a protocol, even if one does not have access to its source code ( https://www.andrewcbancroft.com/2014/12/02/send-a-type-to-ob... )
Comment linking /2014/12/02/send-a-type-to-obedience-school-using-swift-extensions-for-additional-protocol-conformance
on “Doubling Down on Protocol-Oriented Programming”