ThatGuyDuncan (68) [Avatar] Offline
#1
14.3   Getting started
However, resist the temptation to simply copy and paste code from it – you’ll get much more out of this by trying to {write it?} yourself and using that only as a last resort.
Start by creating a new F# Console Application named capstone2, and open the fsx file that’s included in the application before deleting everything in it. {are you talking about the sample project?}

14.5   Creating behaviours
I’ll help you out by given you a typical function signature for deposit and a hard-coded implementation that needs replacing.


14.6.1   Adapting code with higher order functions
[i]{the word "audit" is repeatedly used where I would use "log". I record (log) details for later review (audit) -- for me, audit is the looking, not the logging. This might be merely the collision of colloquial English from different continents, so feel free to ignore.}

"Audit log the details of the transaction e.g. “withdraw £50”"
"If the account balance was modified, audit log a message with the details of the transaction and the new balance"
"If the account balance was not modified, audit log a message that the transaction was rejected"

"Return back out the updated account"

"This looks pretty nice in principle..."

"If you struggle to figure it out, first write a version that is tightly coupling coupled to ..."

14.7   Writing a console application
"Let’s now pull the code we’ve written up until now into dedicated modules and namespaces so that they can be built into a compiled application."
"Domain.fs: contains the Customer and Account record types in the Capstone2.Domain namespace" {presumably, "Account" should be monospace}

14.7.2   Managing the account state
"... but for now, here’s a simple scaffold of {into? How 'bout, "template into"} which you should “fill in the blanks” for your code: -"

"We’ll learn tricks in throughout the rest of this book how to avoid common mutation pitfalls..."

14.9   Summary
"Secondly {Also? There's no "firstly" so "secondly" is jarring}, definitely don’t feel frustrated if you thought “I could have done this with my eyes closed in C#”!"
"... something that requires you to do a little data modelling, and {a?} little functional design, and try to implement it."
Isaac Abraham (68) [Avatar] Offline
#2
Thanks for this.

Regarding logging / auditing - in retrospect, I could have used logger, yes. Unfortunately at this stage I'm not really fond of the idea of changing this all (including all the code samples throughout all of the capstones) so I'll leave it as it.