The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jvermeir (5) [Avatar] Offline
#1
Hi, I noticed the examples in chapter 1 use the var keyword to define variables. Though this works fine, I think there is value in introducing the val concept asap.

Immutability is important so it may be a good idea to start right away.
aslam.khan (50) [Avatar] Offline
#2
Re: Use of val instead of var?
Hi,

When to introduce immutability is a big decision in this book. This is a deliberate choice to not drop a statement that FP values immutability, and rather lead to why we value immutability.

I choose to introduce through a deliberate set of examples and principles in chapter two where we work towards referential transparency. I only make a distinction between val and var in chapter 3 when we actually start programming with immutable data.