small medium large xlarge

Java By Comparison: Become a Java Craftsman in 80 Examples / December PragPub Magazine

December 06, 2017

Today marks a publishing milestone. On this day in 1768, the first edition of the Encyclopedia Britannica was published. You can learn a lot by reading.

You can learn a lot about coding by reading code, and especially by comparing good code and bad. That's the idea behind Java By Comparison: Become a Java Craftsman in 80 Examples, now available in beta from Come and get your own personal copy today to be a better programmer tomorrow. Okay, that was really cheesy, but you get the point. Now come and get the book.

Also this month, the final issue of PragPub for 2017. Read on for details!

Java By Comparison: Become a Java Craftsman in 80 Examples

This book is an essential companion for anyone learning to write clean Java code. The authors introduce you to the fundamentals of becoming a software craftsman by comparing pieces of problematic code with an improved version, to help you to develop a sense for clean code. This unique before-and-after approach teaches you to create clean Java code.

Learn to keep your booleans in check, dodge formatting bugs, get rid of magic numbers, and use the right style of iteration. Write informative comments when needed, but avoid them when they are not. Improve the understandability of your code for others by following conventions and naming your objects accurately. Make your programs more robust with intelligent exception handling and learn to assert that everything works as expected using JUnit5 as your testing framework. Impress your peers with an elegant functional programming style and clear-cut object-oriented class design.

Writing excellent code isn't just about implementing the functionality. It's about the small important details that make your code more readable, maintainable, flexible, robust, and faster. Java by Comparison teaches you to spot these details and trains you to become a better programmer.

Now available in beta from

December PragPub Magazine

PragPub wraps up the year with an extra-large issue and a return to Foo Bar.

Foo Bar? Be patient. All will be explained.

All year long we’ve been graced by an article series from Venkat Subramaniam in which he has explored the functional programming capabilities of Java 8. He’s shown how to refactor your Java code to functional style, every month demonstrating, through before-and-after code makeovers, how a functional approach can make your code more concise, readable, and maintainable. This month Venkat concludes his series, revealing the elegance and power you can gain with infinite sequences.

Two other writers return to the pages of PragPub for this fat 102nd issue. Dave Copeland, co-author of Agile Web Development With Rails 5.1, delivers a passionate argument for why Rails is more relevant than ever. And Jonathan Rasmusson shares lessons learned from that time he joined a relatively unknown music streaming service called Spotify.

Most of our regular columnist are here as well. Johanna Rothman writes about what managers want versus what they really need. Antonio Cangiano reports on dozens of new tech books, highlighting one on data visualization. Marcus Blankenship shares some insight on writing software that he drew from the writing advice of the king of cyberpunk science fiction writers, William Gibson. And John Shade — well, John’s on vacation. Taking his place this month is Michael Swaine, who returns to an old haunt, a little-known watering hole on the fringe of Silicon Valley called Foo Bar, where he meets some curious characters.

So: seven veteran technology writers doing their best to educate and entertain you with some holiday reading. We hope you enjoy it.

But wait. There’s one more thing.

The Pragmatic Bookshelf is always on the lookout for excellent book ideas from talented, knowledgable writers. And we do all we can to help them develop their ideas into excellent books for programmers. Chances are, you’ve got a book idea percolating in the back of your mind. So this month we at PragPub are introducing a new feature, our annual December Focus on Writing. Brian MacDonald, the Managing Editor at Pragmatic Bookshelf, has written three articles that will help you formulate your book idea and develop it into a working outline for a publishable book, and lead you through all the intricacies of the publishing process.

Because when we talk about our business being for programmers and by programmers — that’s also an invitation to you to contribute.

Oh, and Mike wants you to know that you’re also invited to write an article for PragPub in 2018. If you want to know what kinds of articles we like, there’s a complete index to 2017 in this issue.

Now available from

Don't Get Left Out

Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is create an account on (email address and password is all it takes) and select the checkbox to receive newsletters.

Are you following us on Twitter and/or Facebook? Here's where you can find us and keep up with the latest news and commentary, and occasional discounts:

Tell your friends! Tweet this

Follow us on Twitter: @pragprog, @pragpub, Andy Hunt @PragmaticAndy.

Coming Soon:

  • Docker for Rails Developers: Build, Ship, and Run Your Applications Everywhere in beta
  • 3D Game Programming for Kids, Second Edition in beta
  • Programming Elm: Build Safe and Maintainable Front-End Applications in beta
  • Programming Crystal: Create High Performance, Safe, Concurrent Apps in beta

Recently Released:

Thanks for your continued support,

Andy Hunt Publisher, Pragmatic Bookshelf

Books • eBooks • PragPub Magazine • Audiobooks and Screencasts