I’m having some fun today “splitting an atom”, based on some feedback from a reader who downloaded the first 25% of Atomic Scala. He said that he thought that Values and Data Types should be split, so I started down that path this morning …
I’m splitting it into 2 atoms: Values … and Data Types. Following our practice before theory principle, Values must come first since Data Types has no context without storing a value. That’s driving some other fun changes too, notably in the Type Inference atom.
The Type Inference atom appeared later in the book because that’s how we thought of it … as something special that Scala does for us. But why did we think of it as special? Because we’re programmers who didn’t have that in other languages. Ah, but we’re writing this book to appeal to beginners as well as to seasoned developers. Stepping back, we realized that beginners don’t know that they have to declare the types of variables. And why should they? You didn’t have to do that in math class and that all worked out OK.
Beginners are not tied to the restrictions in older programming languages that required you to do so. So why not introduce Values using Type Inference and later show how you can do this in a more verbose way? I wouldn’t have thought of this when we started writing the book, but because our atoms are written to contain single concepts, they are also easy to re-order.
We are really grateful for feedback! Please keep it coming!