Learn Functional Programming with Elixir (Pragprog)

Whoo hoo I finished it! Here’s…

My Review

I really enjoyed this book! I think it’s going to prove incredibly useful for those of us who are coming to Elixir as our first functional programming language. But before I go into the details, I want to say that this book reminded me that you should never judge a book by its cover!!

Why? Well when I first heard about this book I immediately thought it was going to be Elixir’s version of the Ruby book by Chris Pine, called Learn to Program (an amazing book btw!). But it’s not - this book goes much further down the rabbit hole! In fact, I reckon it could even drop ‘learn’ from the title and simply be called Functional Programming with Elixir. Having ‘learn’ in the title makes it sound as though it’s for newcomers to programming in general - but maybe that’s just because I’m aware of the aforementioned Ruby book which also happens to be published by PragProg.

For the same reason, I’m also glad I read this book after Programming Elixir and Elixir in Action. Because the focus of those books are the fundamentals of the Elixir language and OTP, and that’s why they cover them in great detail. The focus of this book however, is functional programming …with Elixir. So the aim of this book isn’t to teach you the ins and outs of Elixir and OTP, it’s to teach you the fundamentals of functional programming - and just so happens to be using Elixir, but, while also showcasing Elixir’s advantages in the area and how it approaches and tackles common problems using functional programming.

So this book is for you if Elixir is your first functional programming language or maybe even if it’s not, and you want to see how Elixir is functionally minded. It will go into detail about things like recursion - (which btw, is a deeper topic than I first thought!) for instance, just like in Elixir in Action where you build a genserver and supervisor from scratch using bare processes, here you build a Map function using recursion. I LOVE it when books do this, because it helps give you a much better understanding of what is going on and helps make things ‘click’.

If you still don’t think you need this book - here are some questions for you: Do you know functional concepts and terms such as Divide and Conquer, Decrease and Conquer, Unbounded Recursion, Pure Functions, Impure Functions, Higher Order Functions? Do you know what Map and Reduce are really doing under the hood? Do you know when to use Comprehensions or Monads or Try and Rescue/Throw or With? Or what about when to use Protocols or Module Behaviours? If not, this book will teach you, and much more!

I’m glad I read this book - and if you read it, I think you will be too!

Well done @ulissesalmeida, this book definitely fills a void and I think will prove very useful to a lot of people :023:

19 Likes

Since the book’s forum is down, posting a question here.

I’m on the Dungeon Crawl app part, and I’m getting stuck near the beginning when I try to run iex -S mix. Page 111 of 160 in my version of the book, Creating the Character with Structs.

I receive this error in Visual Studio Code:

"PS D:\code\Functional_Programming_with_Elixir_Book\dungeon_crawl> iex -S MixInvoke-Expression : A parameter cannot be found that matches parameter name ‘S’.
At line:1 char:5

  • iex -S Mix
  • ~~
    
    • CategoryInfo : InvalidArgument: (:slight_smile: [Invoke-Expression], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeExpressionCommand"

I’ve tried googling and that hasn’t yielded anything I’ve found helpful so far. Any help would be appreciated.

Please do not use Powershell, it has a built-in function iex, which shadows the iex of elixir.

1 Like

What would you suggest in lieu of Powershell? I’m pretty new to all of this.

Good old cmd.exe. Or Linux :wink:

2 Likes

Okay, I ran cmd.exe in the Powershell terminal and that switched the terminal to cmd.

Trying ‘iex -S mix’ worked as intended after that. Thanks!

1 Like

You can start it directly, just do win+R and then type cmd.exe and Enter.

2 Likes

Just finished this book. It was a fantastic introduction to functional programming and the elixir syntax for an absolute beginner. If you have prior experience programming but not with functional programming then I’d still highly recommend this as a starting point.

7 Likes

Is the Discount still on? I get a message saying it is expired when I enter it at checkout

2 Likes

Hi Tom, we have a new coupon coming soon - can you hold off a few weeks? :smiley:

2 Likes

Yeah no problem! Thanks for the quick reply. I’ll keep my eye out for when it comes out :slight_smile:

2 Likes