Concurrency & Parallelism: Understanding I/O

Concurrent code has a bad reputation of being notoriously easy to screw up. This series will focus on well-known and widely adopted concurrency patterns in different programming languages, platforms, and runtimes, so hopefully it makes you more confident writing maintainable concurrent code.

The first chapter is an introduction to I/O.

This blogpost is published on the RisingStack Blog.

Quote: Dealing with awkwardness in functional programs

As you write more functional programs, you’ll sometimes encounter situations like this where the functional way of expressing a program feels awkward or tedious. Does this imply that purity is the equivalent of trying to write an entire novel without using the letter E? Of course not. Awkwardness like this is almost always a sign of some missing abstraction waiting to be discovered.

When you encounter these situations, we encourage you to plow ahead and look for common patterns that you can factor out. Most likely, this is a problem that others have encountered, and you may even rediscover the “standard” solution yourself. Even if you get stuck, struggling to puzzle out a clean solution yourself will help you to better understand what solutions others have discovered to deal with similar problems.

With practice, experience, and more familiarity with the idioms contained in this book, expressing a program functionally will become effortless and natural. Of course, good design is still hard, but programming using pure functions greatly simplifies the design space.