Hacker News new | ask | show | jobs
by overcyn 3170 days ago
This is my personal gripe with Swift. Theres just so many different ways to form expressions and do control flow. It just feels like code golf to me.

  for case let (title?, kind) in mediaList.map({ ($0.title, $0.kind) }) where title.hasPrefix("Harry Potter") {
     print(" - [\(kind)] \(title)")
  }
http://alisoftware.github.io/swift/pattern-matching/2016/05/...
1 comments

I don't know Swift much, but can tell at first glance that you're mapping items from `mediaList` into (title, kind) tuples, filtering for missing titles and "Harry Potter". I guess it's more about being comfortable with functional programming patterns in general, than its syntax.