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.

Mike_Hamer (1) [Avatar] Offline
#1
Hello. First off, great job on the second edition! Loving it so far.

Just thought i'd chime in and mention that I found this sentence about assertions on page 31 to be slightly misleading

"The assertion reveals that for the remainder of the code, it’s assumed that y has the value 1"

Being a total noob, my first thought after reading this sentence was that assert statements were somehow constantly checked for the lifetime of the application, and that if their expressions ever evaluated to false, that the assertion would fail.

Of course after firing up the Groovy console and trying it out for myself I discovered that this was not the case, but I think it would be better if it were worded more like

"The assertion reveals that at this line in the code, it’s assumed that y has the value 1"

Cheers!
Mittie (397) [Avatar] Offline
#2
Well, spotted, thanks!

It never occurred to me that this is could be interpreted as a constantly checked invariant.
But now, that you say it, ...

Thanks for posting and your kind words
Dierk