Holy Bible: ESV Bible
Quotes from the Book
One advantage of static factory methods is that, unlike constructors, they have names.
Learning the art of programming, like most other disciplines, consists of first learning the rules and then learning when to break them.
Collection or an appropriate subtype is generally the best return type for a public, sequence- returning method.
Writing concurrent programs in Java keeps getting easier, but writing concurrent programs that are correct and fast is as difficult as it ever was.
A second advantage of static factory methods is that, unlike constructors, they are not required to create a new object each time they're invoked.
If you export a nontrivial interface, you should strongly consider providing a skeletal implementation to go with it. To the extent possible, you should provide the skeletal implementation via default methods on the interface so that all implementors of the interface can make use of it.
Implementing a constant interface causes this implementation detail to leak into the class’s exported API. It is of no consequence to the users of a class that the class implements a constant interface. In fact, it may even confuse them. Worse, it represents a commitment: if in a future release the class is modified so that it no longer needs to use the constants, it still must implement the interface to ensure binary compatibility. If a nonfinal class implements a constant interface, all of its subclasses will have their namespaces polluted by the constants in the interface.
You can put any element into a collection with a raw type, easily corrupting the collection’s type invariant (as demonstrated by the unsafeAdd method on page 119); you can’t put any ele- ment (other than null) into a Collection<?>.
arrays are covariant. This scary-sounding word means simply that if Sub is a subtype of Super, then the array type Sub[] is a subtype of the array type Super[]. Generics, by contrast, are invariant: for any two distinct types Type1 and Type2, List is neither a subtype nor a supertype of List. You might think this means that generics are deficient, but arguably it is arrays that are deficient.
A forEach operation that does anything more than present the result of the computation performed by a stream is a “bad smell in code,” as is a lambda that mutates state.
streams do not make iteration obsolete
premature optimization is the root of all evil. —Donald E. Knuth [
In other words, it is about 50 times slower to create and destroy objects with finalizers.
In fact, two-thirds of the uses of the close method in the Java libraries were wrong in 2007.
There is no way to extend an instantiable class and add a value component while preserving the equals contract, unless you’re willing to forgo the benefits of object-oriented abstraction.
Given all the problems associated with Cloneable, new interfaces should not extend it, and new extendable classes should not implement it.
It is too early to say whether modules will achieve widespread use outside of the JDK itself. In the meantime, it seems best to avoid them unless you have a compelling need.
Builder pattern is more verbose than the telescoping constructor pattern, so it should be used only if there are enough parameters, say, four or more.
Watch on YouTube
About Unknown
More by Unknown
Holy Bible: ESV Bible
Holy Bible, NKJV
The New Oxford Annotated Bible: New Revised Standard Version
Hagakure: The Book of the Samurai
Book details
- Author
- Unknown
- Genre
- Nonfiction
- Goodreads rating
- 4.51 (8k ratings) →
Keep reading
Code Complete
JavaScript: The Good Parts
The Pragmatic Programmer: From Journeyman to Master
Structure and Interpretation of Computer Programs (MIT Electrical Engineering and Computer Science)
Domain-Driven Design: Tackling Complexity in the Heart of Software
Software Engineering at Google: Lessons Learned from Programming Over Time
Continuous delivery
Pragmatic Thinking and Learning: Refactor Your Wetware
Getting Real: The Smarter, Faster, Easier Way to Build a Web Application
Hackers & Painters: Big Ideas from the Computer Age
Humble Pi: A Comedy of Maths Errors
Don't Make Me Think, Revisited: A Common Sense Approach to Web Usability
Gödel, Escher, Bach: An Eternal Golden Braid
Algorithms to Live By: The Computer Science of Human Decisions
Managing Humans: Biting and Humorous Tales of a Software Engineering Manager
The Goal: A Process of Ongoing Improvement
In the Beginning...Was the Command Line
The PARA Method: Simplify, Organize, and Master Your Digital Life
The Design of Everyday Things
Accelerate: Building and Scaling High Performing Technology Organizations
Peopleware: Productive Projects and Teams
Thinking In Systems: A Primer
Rework
Antifragile: Things That Gain from Disorder
Shape: The Hidden Geometry of Information, Biology, Strategy, Democracy, and EverythingElse
My Ishmael
Because Internet: Understanding the New Rules of Language
The Unfolding of Language: An Evolutionary Tour of Mankind's Greatest Invention
Lean Analytics: Use Data to Build a Better Startup Faster
Microserfs
The Elements of Style
Just for Fun: The Story of an Accidental Revolutionary
Founders at Work: Stories of Startups' Early Days
Rationality: From AI to Zombies
Right Kind of Wrong: The Science of Failing Well
The Most Human Human: What Talking with Computers Teaches Us About What It Means to Be Alive
Dataclysm: Who We Are
Early Retirement Extreme: A Philosophical and Practical Guide to Financial Independence
How to Take Smart Notes
The Cyberiad
Math with Bad Drawings
The 4-Hour Chef: The Simple Path to Cooking Like a Pro, Learning Anything, and Living the Good Life
The Art of Thinking Clearly
Please Understand Me II: Temperament, Character, Intelligence
Life 3.0: Being Human in the Age of Artificial Intelligence
Word by Word: The Secret Life of Dictionaries
Co-Intelligence: Living and Working with AI
Dreyer's English: An Utterly Correct Guide to Clarity and Style
Amp It Up: Leading for Hypergrowth by Raising Expectations, Increasing Urgency, and Elevating Intensity
How Not to Write a Novel: 200 Classic Mistakes and How to Avoid Them—A Misstep-by-Misstep Guide
A Death in Tokyo
Peak: Secrets from the New Science of Expertise
The Rhesus Chart
Making Ideas Happen: Overcoming the Obstacles Between Vision and Reality
Superintelligence: Paths, Dangers, Strategies
Permutation City
Black Box Thinking: Why Some People Never Learn from Their Mistakes - But Some Do
Soonish: Ten Emerging Technologies That'll Improve and/or Ruin Everything

