Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Kevlin Henney, Trisha Gee

Rating No ratings yet

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A collection of 97 practical, opinionated essays from experienced Java developers covering everything from coding fundamentals and design philosophy to modern JVM features and testing strategies—ideal for working Java programmers who want to sharpen their craft and see how seasoned practitioners think about everyday problems. 【Book Arc】 - **Opening (~0%–10%)**: The book opens with a mix of project documentation advice (AsciiDoc), problem decomposition strategies, and the philosophy of writing code for future maintainers—setting the tone that this is about professional practice, not just syntax. - **Early (~10%–23%)**: Focus shifts to core Java-specific pitfalls and design principles: avoiding null parameters, understanding the null type in the JLS, handling legacy code with patterns like strangler fig, and using alternative JVM languages like Groovy for pragmatic solutions. - **Early (~23%–32%)**: Essays cover learning new ecosystems, improving code readability through speed-reading techniques for code, and emphasizing separation of concerns—with concrete examples like refactoring a fraction parser to make testing easier. - **Middle (~32%–42%)**: The book broadens into modern JVM topics: Kotlin coroutines for concurrency, container-based integration testing, and the importance of naming and code structure for maintainability. - **Middle (~42%–48%)**: Includes author biographies and index highlights, revealing the breadth of topics—from garbage collection and fuzz testing to JVM performance and multiparadigm programming—though the excerpts here are mostly structural rather than substantive. 【Key Takeaways】 - **Break problems into small, testable chunks** (Early): Write automated tests and commit frequently for each piece; this reduces cognitive load and gives you rollback points when things fail. - **Write code for the future restorer, not the original author** (Early): The best code is written with the next programmer in mind; haste leads to fragile systems that collapse under pressure, like overstretched trees. - **Avoid null parameters in public APIs** (Early): If a parameter is optional, create an overloaded method without it; null should only be an internal implementation detail, never leaked to callers, to prevent NullPointerExceptions. - **The null type is a real, unnamed type in the JLS** (Early): Understanding this from the Java Language Specification clarifies why `var v = null;` fails to compile—it's not just a "special literal" but a distinct type with no name. - **Legacy code deserves repair, not rewrite** (Early): The "broken windows" effect means quick fixes degrade systems, but full rewrites lose domain knowledge; the strangler pattern lets you incrementally replace legacy systems with pride. - **Separate concerns to improve testability** (Early): If a test is hard to write, it's a sign of poor coupling or separation; pulling out focused classes like a `FractionParser` makes code more modular, composable, and readable. - **Coroutines are lightweight threads for concurrency** (Middle): Kotlin's `runBlocking` and `launch` let you split work into simple tasks that appear concurrent on one thread—invaluable for Android's threading model and scalable servers. - **Use containers for integration testing** (Middle): Interact with container engines via APIs or CLI to write your own "container driver," but distinguish between starting a container and the readiness of the service inside it for testing. 【Reading Tips】 - **Skim the early essays for philosophy, deep-read the technical ones**: Pieces on "code restorer" and "broken windows" are mindset-setting; essays on null handling and separation of concerns have concrete code you should study. - **Treat this as a reference, not a linear read**: Each essay is self-contained (2–3 pages), so jump to topics that match your current pain points—whether that's legacy code, testing, or JVM performance. - **Pay attention to the JLS citations**: The essay on null type references Section 4.1 of the Java Language Specification; if you want to understand Java's type system deeply, follow these references. - **Look for cross-essay themes**: Many authors return to testability, readability, and maintainability; noticing these recurring values will help you internalize the book's core philosophy. - **Skip the author bios and index in the middle**: These are filler; the real content is in the essays themselves, so don't get distracted by the structural sections. 【Coverage Limits】 The excerpts cover roughly the first half of the book (0–48%), with substantial gaps in the later essays on garbage collection, fuzz testing, and JVM performance—these topics appear only in the index, not in the sampled content.
Excerpt 1
ide to go all in with AsciiDoc, there’s even a Doclet named Asciidoclet that lets you write Javadoc using AsciiDoc! Break Problems and Tasks into Small Chunk...
View in text
Excerpt 2
se the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. There it is. Java allows us to write down...
View in text
Excerpt 3
s is a very effective design strategy to employ in any code. Code with good separation of concerns is, by definition, more modular, and it’s usually much mor...
View in text
Excerpt 4
sed fuzzers, The Unreasonable Effectiveness of Fuzz Testing generational hypothesis, Garbage Collection Is Your Friend getter methods, Learn to Use New Java...
View in text
Excerpt 5
as about to be sprung. Pushbackers were to be encircled and isolated by associating them all in the public mind with Trump and then labelling Trump as some s...
View in text
Excerpt 6
conian lockdowns in the West as the way to ‘beat the virus’. Trouble was that we subsequently had lockdown aer lockdown, but never business as usual. As the...
View in text
Excerpt 7
and to increase capacity as soon as possible’. Psychopaths All these different approaches are needed. The messaging also needs to take account of the realiti...
View in text
Excerpt 8
ade Minds are an antidote to all of these things. They will never concede their self-respect no maer what the circumstances. Even when apparent humiliation i...
View in text
Tags
AI categories
Programming LanguageBackendCode
ISBN: 1491952695
Publisher: O'Reilly Media
Publish Year: 2020
Language: English
File Format: PDF
File Size: 4.4 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…