Joshua Bloch quotes:

+1
Share
Pin
Like
Send
Share
  • Can be chained. Here's how the client code looks: NutritionFacts cocaCola = new NutritionFacts.Builder(240, 8). calories(100).sodium(35).carbohydrate(27).build();

  • Favor composition over inheritance,

  • When in doubt, leave it out.

  • What I do instead is I will cheerfully spend literally hours on identifier names: variable names, method names, and so forth, to make my code readable. If you read some expression using these identifiers and it reads like an English sentence, your program is much more likely to be correct, and much easier to maintain.

  • One advantage of static factory methods is that, unlike constructors, they have names.

  • When you choose a language, you're choosing more than a set of technical trade-offs-you're choosing a community.

  • It is hard to write even the smallest piece of code correctly.

  • The cleaner and nicer the program, the faster it's going to run. And if it doesn't, it'll be easy to make it fast.

+1
Share
Pin
Like
Send
Share