0. Intro ☕
The test of a first-rate intelligence is the ability to hold two opposed ideas in the mind at the same time, and still retain the ability to function.
~ F. Scott Fitzgerald (in The Crack-Up)
Which fountain of youth it bathed in will likely remain shrouded in mystery during our lifetimes, this polyglot programmer all the same is amazed by how this one programming language, the one we’ll be talking about in this essay—Java, as you may tell by the mound of coffee beans coming right next up—has defied aging unlike any other language you care to name. It’s been around for decades, and, like the Energizer Bunny, is still going strong.
And yes, Java isn’t that old: the horse-drawn buggy in the picture above doesn’t quite accurately reflect the year—or even the century, come to think of it—when Java arrived on the scene. Considerations of antiquity aside, this programming language landed like a tsunami and turned our industry upside-down. Who could’ve predicted that?
So it is that many of us in the trenches have used Java to great effect. It sure has taken us on quite the ride. In this essay, then, we’re going to check out some of the finest learning resources to help our ride that much smoother, and take us to the threshold of yet more frontiers as they open up. Smitten enough for now? Good.
But why in the world would I, as I did, put that electrifying Fitzgerald quote atop this essay? Well, for one thing, forget all about The Great Gatsby (and its attendant big city lights) and please focus, if you please could, on the import of Fitzgerald opining how “The test of a first-rate intelligence is the ability to hold two opposed ideas in the mind at the same time, and still retain the ability to function.”
The answer to exactly that is coming right next up, following a complementary cup of Java, which I’ve set daintily atop a sea of coffee beans; hey, I even checked their origins and they sure weren’t Spring beans—so yeah, we’re talking about the edible stuff here.
1. It All Began With A Cup Of Java 🍩
What would life be without coffee? But then, what is it even with coffee?
~ King Louis XV
Now that you’ve had a few reviving sips of your Java, let me spill the beans, the beans, and nothing but the beans: So the reason I quoted Fitzgerald was that, for one thing—and taking a cue here from the adage that “a wealth of information creates a poverty of attention“—our attention spans nowadays are fickle. So anything I can do to help you (and me) perk up a bit can only help.
Really, though, here’s the deal: As polyglot programmers, we context-switch between different styles—and even paradigms—as we move from programming in one language to programming in another. To take the example of some languages I’m most familiar with, writing code in Go is a vastly different experience when compared to writing code in Java, which, in turn, is measurably different, in both kind and degree, from hacking Scala code.
Oh, and if my use above of the word “paradigms” struck you as hyperbole, allow me to quote on good authority—none less than Alan Perlis, the Yale computer scientist who became the first ever recipient of the Turing Award—that “A language that doesn’t affect the way you think about programming, is not worth knowing.”
And then we can go meta with, but of course, the headiness of paradigm blending. But I digress.
And while I confess not knowing much (at all) about the origins of such statements as the hilarious pontification above on all things coffee by King Louis XV—who would’ve thought that kings, other than King Ralph of course, could be so funny?—as only regality would deign to sprinkle around like confetti, I can vouch for the need to have some caffeinated beverage at hand to help power us through the remainder of this essay.
Actually, we’re just getting started. Yep, we’re talking Java—mocha latte.
2. Ducks In A Row 🐓
Art, in itself, is an attempt to bring order out of chaos.
~ Stephen Sondheim
So I sat down and began whittling down my list of wannabe-in-this-essay books—oh yeah, I kept paring away—until I had it down to something digestible. Look, I don’t want to unwittingly make my readers get a case of indigestion by, say, serving up an unpalatably generous offering, and, in turn, having them groan and reach for that blue Maalox bottle tucked away in their medicine closet.
Well, pared down to the essence, here, then, are the books—like ducks in a row—which were left standing after the dust from my frenzied whittling had settled:
- Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce (Addison-Wesley Professional)
- Effective Java, 3rd Edition by Joshua Bloch (Addison-Wesley Professional)
- Java Concurrency in Practice by Brian Goetz et al (Addison-Wesley Professional)
- Modern Java Recipes: Simple Solutions to Difficult Problems in Java 8 and 9 by Ken Kousen (O’Reilly Media)
- Effective Unit Testing by Lasse Koskela (Manning Publications)
- Java in a Nutshell: A Desktop Quick Reference, 6th Edition by David Flanagan and Benjamin Evans (O’Reilly Media)
Before we review each one, in turn, all the while keeping an eye on what makes every one of these sparklers uniquely valuable to you in your journey to mastering Java, let’s make a quick pit stop. Actually, I confabulated a bit: As it turns out, it’s not quite a pit stop that we’ll be making. Folks, we’ve came to a fork in the road.
What’s up with that?
Oh, and I haven’t told you about a recent, inspiring conversation—one that has rendered the signal service of being the fuel and fire that made this essay happen—a conversation which ran the gamut from the science of quantum computing to the art of blogging to the pragmatics of working remotely to going meta?
Meanwhile, do just one thing for me, won’t you please? Keep your eyes peeled for a guest appearance of Schrödinger’s cat. Yep, Schrödinger’s, not mine—my feisty feline, all his tangerine loveliness, goes by the name Lumos.
But I digress.
3. We Came To A Fork 🚧
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
~ Robert Frost (in The Road Not Taken)
Not taking the advice of the wisecrack (evidently also an unrepentant subscriber to the philosophy that finders are keepers) who once said, “When you come to a fork in the road, take it“, we tried instead to use the fork (Harking back to Jedi Master Yoda’s timeless advice, which he had solemnly dispensed to Luke Skywalker in the immortal words, “Use the fork, Luke, use the fork“). However, not quite finding the fork palpably present—sigh, it wasn’t as corporeal as we had hoped for it to be—we decided to “fork” it, having once been, way back in the day, diligent students of operating systems.
Wait, come back! I can’t stand the sight of all those tears rolling down your cherubic cheeks. It’s just that some of us here couldn’t resist tossing in some geek humor. Sheesh, that was all.
Plus a little bird tells me that I should discreetly drop my plan of regaling you in the fascinating world wherein dwell such phantasmagorical beasts as—surely you remember the recent talk and such of my cat Lumos, um, actually—Schrödinger’s cat making a guest appearance?
Let’s fork all that to later—have it run as a background process meanwhile—until it’s time to bring it right back to the foreground. Did I really say that? Yikes (Channeling Schrödinger’s cat may be next, judging by the way things are going).
Seriously, though, Java the language—and the Java ecosystem even more so—has come to many a fork in the road over the years, and handled it with aplomb, scarcely ever careening or, heaven-forbid, skidding. Most recently, bowing to the wishes of the legions of Java programmers for functional programming features, a tip of the hat to the shepherds of Java for pulling off the introduction of just such features into the language proper. Sweet!
4. On Growing (Java) Software [#1] ☕
Mary, Mary, quite contrary
How does your garden grow?
~ Mother Goose (in the one-and-only Mary, Mary, Quite Contrary)
If inspiration is what you’re after—say, to power your very next programming jag—copious amounts thereof can be found between the covers of Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce (Addison-Wesley Professional). Published to great acclaim, this book is suffused with code commentary of the highest caliber.
So yes, if pure inspiration is what you seek—high octane, too, at that—give this gem a read. And yeah, should my plaudits strike you as a bit effusive, I have to level with you and divulge the sentiment that we all in the trenches do get carried away once in a while. But I’m telling you, inspiration and quality, beautiful code go hand-in-hand.
Having made that rather audacious claim—touching as it did on beautiful code—and in the process having opened the proverbial Pandora’s box, I owe you a fuller explanation. But not having enough real estate left in this section, allow me to point you in the direction of some musings entitled Beautiful Code, Beautiful Prose.
So let’s see, why don’t we next take a page from that perennial bestseller, The 7 Habits of Highly Effective People, and do the same here (for Java, of course).
5. On Being Effective [#2] ☕
Style is effectiveness of assertion.
~ George Bernard Shaw
This is simply an excellent book, with a decidedly pragmatic outlook; all stuff, no fluff. And what with my having a background in electrical engineering, I couldn’t help but reflexively think to the notion of the Signal-to-Noise Ratio (aka SNR). So yeah, the SNR in the contents of Effective Java 3rd Edition by Joshua Bloch (Addison-Wesley Professional) is about as high as it gets.
So it is no surprise that this book, very rightly, is just about as highly referenced compendium of Java wisdom as can be found on our fragile planet. Treat this book with care—much as I know that you lavish our planet with care—and tend to it carefully. You will be repaid in (Java) wisdom, many times over.
Organized into bite-sized topics, each one covering a crucial aspect of the sprawling landscape that makes up the juggernaut that is Java, the treatment of each topic is substantial nonetheless. The effect is great. You’ll be effective in no time, amirite?
Don’t miss this one.
6. Taming Concurrency [#3] ☕
Time is what prevents everything from happening at once.
~ John Archibald Wheeler
If you’re going to write a pile of Java code, make sure to have at your side a copy of this age-defying gem of a book. This marvelous book is another keeper. And oh my, how well Java Concurrency in Practice by Brian Goetz et al (Addison-Wesley Professional) has aged since it was published in 2005.
It has somehow managed to take a page from the queen of sciences—so it’s been said about math that it never goes out of style—this book on the crucial topic of concurrency is showing (15 years after its publication) hardly any signs of aging. Wow, that’s unheard of in an industry where entire paradigms shift under us within half a decade!
Incredibly well-edited, and crystal-clear in exposition, this fine volume is quite the expose and remains the go-to source for taming the world of multi-core processors in which we all dwell now. Remember, it all goes back to the basics: How to slay that red-eyed complexity monster, you know the one that has taken one redeye flight too many? Seriously, though—and if you’ll humor me by taking this one on faith— conquer concurrency is to slay that red-eyed complexity monster, amirite?
This book will arm you well to slay complexity in the world of Java.
7. Cooking With Gas (And Java) [#4] ☕
No profit grows where is no pleasure taken;
In brief, sir, study what you most affect.
~ William Shakespeare (in The Taming of the Shrew)
And when you’re ready to cook, we got you covered, too. If you’re anything like me, and learn best from tons of examples, then run and grab your very own copy—or someone else’s, if they let you have their’s—of Modern Java Recipes: Simple Solutions to Difficult Problems in Java 8 and 9 by Ken Kousen (O’Reilly Media)
It’s written in the tradition of your typical cookbook—think algorithmic and to-the-point. What sets it apart from its competitors is the pleasing coherence and unity which runs uniformly through the entire narrative.
Oh yes, while we are on the topic of algorithms, I would be remiss if I didn’t point you in the direction of two additional resources:
- A pile of the best in the realm of algorithmic goodness
- A second serving of wisdom in the land of algorithms
How are we doing? Plenty of reading material for now? All “booked up”, eh, as they say. Good, let’s move on from the pragmatics of cookbook-style algorithms to an even more pragmatic aspect of programming (in Java).
8. On The Unbearable Lightness Of Feedback [#5] ☕
Trust, but verify.
~ Popular proverb
Tell me if you’ve heard this one before: “Unit testing is the rigor of software.” If memory serves me right, I came across this memorable phrase while reading The Productive Programmer by Neil Ford, many moons ago. Doing admirable justice to this vital topic is on display through the length and breadth of this book.
Ignore the pragmatics offered in Effective Unit Testing by Lasse Koskela (Manning Publications) at your own peril.
If you’re thinking what I think you may be thinking—like, reading up on testing has got to be as boring as watching crabgrass grow—this book stands an excellent chance of disproving exactly such an assumption.
Yo, on top of all that, if ever you thought that a programming book couldn’t possibly read like an adventure, be prepared to have your mind changed in that department as well. Yep, this is one terrific book.
9. Tempest In A Teapot [#6] ☕
I’ll give you my opinion of the human race in a nutshell… Their heart’s in the right place, but their head is a thoroughly inefficient organ.
~ W. Somerset Maugham
In a nutshell, that is, within the minimalist confines of the shell of a nut—your choice, physical or figurative—decades of (Java) programming wisdom has been condensed for your consumption. Thus it is that, occupying the space between the two covers of Java in a Nutshell: A Desktop Quick Reference 6th Edition by David Flanagan and Benjamin J Evans (O’Reilly Media), you’ll find a wealth of knowledge.
David Flanagan, the principal author who kicked off this series of indispensable books—now into its ninth edition—is one amazing writer. A graduate of MIT, he is quite the writer: His books are uniformly brilliant, marvels of clarity and grace. The one we are talking about, which is all about what makes Java tick, is no exception.
All the stuff, without any fluff, this book’s a winner, well worth your time to at least check out, if not to devour outright. Watch out, T-Rex.
10. Watch ‘Em Grow 🌱
Organic growth is a cyclical process; it is just as true to say that the oak is a potential acorn as it is to say the acorn is a potential oak. But the process of writing a poem, of making any art object, is not cyclical but a motion in one direction toward a definite end.
~ W.H. Auden (in The Dyer’s Hand)
Like the fork in the road that we came to earlier—I’ll wait for you here while you dutifully scroll up to the length of this essay to check it out again— what happened next was like déjà vu all over again for me. I’ll go out on a limb and say: Your nice, organized lives as readers may never quite have prepared you to fathom the trouble we writers go to so as to serve you.
But that’s enough of me. Here, then, was the dilemma: What I had on my hands was not one but two fabulous quotes—one drawn from prose, the other from verse. How to keep one and, thus, drop the other, gaah!
Channeling Schrödinger’s cat in my desperation or, for that matter, my own cat Lumos to stand and deliver. Yo, wherefore art thou? Someone. Anyone?
Yay, the theme of duality makes yet another appearance and saves the day. Oh yeah, and as you might have noticed, while every other section is embroidered with a solitary quote, who said anything about this section having one quote too many?—two, to be precise.
You, who are on the road,
Must have a code
That you can live by.
And so become yourself
Because the past is just a goodbye.
~ Crosby, Stills, Nash & Young (lyrics from Teach Your Children)
Right, so Java the language began life as Oak. Forget nutshells. Oak it was. And oh my, how it grew, and grew—Jack and the Beanstalk, anyone? So yeah, in the spirit of this section serving as comic relief, let’s move right along to the other side of gravitas.
We collectively let this section slide, right, what with its uniformity-defying pair of quotes and all? And you all stop me before I lunge with my outstretched hands for a third quote, this one from the lyrics of a song by Elton John—Hold me closer, tiny dancer, won’t you?
11. Java, Distilled 📺
Life is easy to chronicle, but bewildering to practice.
~ E.M. Forster (in A Room With A View)
As you can tell from the pic above—and regular readers know that I’ve said on several occasions how all pics around here are either mine or culled from the public domain—I like to take notes and highlight. A lot. So it is that, behind the canopy of upright highlighters in the pic, you may, if you peer intently, spy a neat row of books, all cultivated and harvested for your reading pleasure.
In fact, a full half of them didn’t even make it into this essay. That’s selectiveness, all in the quest to serve you the better. Barista, would you please bring us some freshly prepared espressos?
And while we wait to be served, I invite you to linger over the pic above. Soak in the depth-effect. Or something.
12. Bring It In For A Landing 🚁
If you look at a dog following the advice of his nose, he traverses a patch of land in a completely unplottable manner. And he invariably finds what he’s looking for.
~ Joseph Cuomo
Wow, the words people will come up with—and get away with—never cease to amaze me. Check that word “unplottable” in the quote above, written with not a little abandon. Sheesh, c’mon. Neologisms notwithstanding, I must confess that the wayward quote, utterly uninformed by the notion of cybernetics and torpedoes, does have a point: Seek, and you shall find.
And so it is that we come full circle. Our well-caffeinated, Java-powered trek—those espressos were good, weren’t they?—now draws to a close.
Rubber is about to hit the tarmac. Speaking of which, remember those things we used to board and fly in, around the country, and the world? All that will come back, in good time, especially for you all smitten by wanderlust. But while we stay put nowadays, let’s bring this essay in for its landing.
I hear the drums echoing tonight
But she hears only whispers of some quiet conversation
She’s coming in 12:30 flight
Her moonlit wings reflect the stars that guide me towards salvation
~ Toto (Lyrics from the song Africa)
Oh yeah, we get to have not one but two quotes. Again.
Life is good.
Let’s take it to the limit.
13. A Sturdy Bridge To The Future? 🐘
How could we know that the music comes from us, we build the bridge into eternity, we are the song we sing?
~ James Baldwin (in Just Above My Head)
Are we there, yet? Take a deep breath, will you? Why is everyone, like, in such a hurry nowadays?
Whoah. First things first: Like, how in the world did this section even make it into this essay? I need to have a chat with my editing staff (“Shhh… Just between you and me: This is strictly a one-man shop; even calling it a shop borders on the presumptuous. It’s all on me. Solo. Uno. I’m writer, editor, designer, publisher, janitor—you name it—around here.“)
But come to think of it, this grand finale of a section isn’t such a bad idea after all. In fact, I’m going to call off that chat I was going to have with you-know-who. They’ve given us the perfect exit, our way to end things with the bang: Building on the metaphor of a bridge—so siphon off all those coffee beans for a moment—Java is uniquely poised to build bridges into the future of production, performant software.
For one thing, the already-thriving ecosystem continues to go places. The Java Virtual Machine (aka JVM) is the envy of one and all, deservedly so, being the stellar piece of software machinery that it is, and a mecca for modern languages—Scala and Clojure to name but two—which want to have a piece of the pie, understandably so.
We hardly knew ye, Java.
Craning my neck down a few inches, I notice a serene, porous, shining-white, bezier-mesh cranium suspended in deep thought, charting unknown vistas—having hopefully loaded enough of a context into its working memory—quite possibly dreaming up the next generation of algorithms, all to be written in… Java?
Only time will tell.