Top 6 Brian Goetz Quotes
#1. Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using synchronization.
Brian Goetz
#2. Just as it is a good practice to make all fields private unless they need greater visibility, it is a good practice to make all fields final unless they need to be mutable.
Brian Goetz
#3. Once an object escapes, you have to assume that another class or thread may, maliciously or carelessly, misuse it. This is a compelling reason to use encapsulation: it makes it practical to analyze programs for correctness and harder to violate design constraints accidentally.
Brian Goetz
#4. Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.
Brian Goetz
#5. Sometimes abstraction and encapsulation are at odds with performance - although not nearly as often as many developers believe - but it is always a good practice first to make your code right, and then make it fast.
Brian Goetz
#6. It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.
Brian Goetz
Famous Authors
Popular Topics
Scroll to Top