Mastering macOS Programming
上QQ阅读APP看书,第一时间看更新

Learning functional programming the fast way

This might seem like a strange piece of advice in a book about using Swift to develop for macOS, but here goes anyway.

Find yourself a free weekend, and spend it learning the basics of Haskell. I'm not joking; it's so simple and logical that you can get a grip on its simpler concepts, which are the ones that will most benefit your Swift skills, in just a couple of days. If you've never dealt with FP before, I promise you, it will expand your programming horizons forever. This is an excellent site: http://www.learnyouahaskell.com.

It's not often that the fastest way of doing something is also the best way, but this is one of those rare occasions. So much of what is available in Swift will make sense much sooner, and more deeply, after a couple of days of looking into a pure functional language such as Haskell.

It's fun, it's logical, and it's totally different to the C family of languages. And there are good reasons why Swift has adopted so many of its patterns.