Jacek Laskowski wrote:Thanks Robert! I immediately immersed in its reading and just on page 86 found a typo - GoldCoins should be goldCoins, I believe. Also, I don't understand why you compare isCaptain to true since you could use isCaptain directly - it's of boolean type after all?
"... and just on page 86 found a typo - GoldCoins should be goldCoins, I believe."
Good catch, this is indeed a typo and will be added to a new errata list for the book, that will be available online. Thank you very much for calling this out.
"Also, I don't understand why you compare isCaptain to true since you could use isCaptain directly"
This is an excellent observation as well. I believe you are referring to a "best practice", that we could have indeed followed. But I think in the context of the diagram and for novice programmers, showing the full operation was a better decision. On second thought, perhaps it wasn't the best decision. We'll need to consider refactoring this as well.
Thanks again and please let use know if you find anything else,
Robert