August 2011
Intermediate to advanced
280 pages
6h 50m
English
In the middle of difficulties lies opportunity.
We can’t avoid manipulating state; that’s integral to programs we create. The compiler, for instance, takes a set of source files and creates bytecode, and the Mail app keeps track of unread emails, among other things.
As we gain experience with Java, we’re often set in the way we design programs. Objects encapsulate state, and their methods help transition between selected valid states. I scoffed when someone said we can create significant code that doesn’t change state. Later when he showed me how, I was intrigued and enlightened, like that kid in the bookstore.[8]
Manipulating state doesn’t necessarily mean mutating state. Think of state transformation ...
Read now
Unlock full access