| CARVIEW |
Become a Better Java Developer
Improve your coding skills by comparing your code to that of expert programmers, so you can write code that’s clean, concise, and to the point: code that others will read with pleasure and reuse.
Get hands-on advice to level up your coding style through small and understandable examples that compare flawed code to an improved solution. Discover handy tips and tricks, as well as common bugs an experienced Java programmer needs to know.
Make your way from a Java novice to a decent developer.
Learn moreBecome a Better Java Developer in 70 Examples
A Mentor for you
This book is a useful companion for anyone learning to write clean Java code. The authors introduce you to the fundamentals of becoming a software developer, 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.
Code Cleanly
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.
Become a Developer
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.
- 70 Examples
- 210 Pages
- 15 Reviewers
- uncountable Cups of Coffee
What's in the book...
Welcome! (free sample)
Welcome to Java by Comparison! Get ready for code quality.
Start Cleaning Up
Learn the basics of code understandability and start cleaning your code.
Level Up Your Code Style
Get the quality of your Java code to the next stage.
Use Comments Wisely
Write meaningful comments when they're needed and avoid them when not.
Name Things Right
Find concise names for your code structures that comply to the conventions.
Prepare for Things Going Wrong
Make your program robust with clean exception handling
Assert Things Going Right
Use JUnit5 to test your code.
Design Your Objects
Apply object-oriented design principles to make your program flexible and maintainable.
Let Your Data Flow
Leverage the power of lambda expressions and functional programming in Java.
Prepare for the Real World
Use static analyis, build automation and concurrency to release your program into the wild.
What Happy Readers Say

Achim Weimert
CTO
I wish Java by
Comparison had been there when I was getting started with programming, It's like
a mentor, looking over your shoulder, and patiently helping you get your programming
skills up to the next level.


Dr. Guido Wirtz
Professor for Computer Science
This is the book I’ve
been waiting for since starting with intermediate Java programming courses. Without
dwelling for too long on the basics, Java by Comparison leads you step by
step to new insights on good coding practice. Instructive examples compare the do’s and
dont’s and make it easy for beginners to get the key points. Here, the book shines and
shows it’s based on long-term classroom experience. Luckily, the book can be read as a
textbook but is also useful as a reference. I’m looking forward to using it in my
classrooms. Are you sure your style is perfect? Get it!


Ashish Bhatia
Software Engineer
Java by
Comparison is a well-crafted quick read with good, succinct examples updated with
the latest Java 8 styling. Highly recommended for Java developers a few years into their
career.


Stefan Tilkov
CEO
With any language, once you’ve mastered its syntax, the next step is to learn how to use
it idiomatically. Whether you’re a beginner who has just started with Java or a seasoned
Java developer who started out using one of its many earlier versions, I consider Java
by Comparison a great step to become proficient in using Java well.


Johannes Schwalb
Java Architect
Java by
Comparison is a wonderful read for all those who want to level up their Java
skills. It contains the essence of Effective Java and Clean Code, updated with JUnit 5 and
Java 8.

About the three Authors
Take a closer look into our amazing team. We won’t bite.
Dr. Simon Harrer
Senior ConsultantSimon is a consultant, developer, and teacher who's always looking out for new technologies, frameworks, and ideas. His friends call him a clean code evangelist, but in a good way.
Dr. Jörg Lenhard
DeveloperJörg is a developer, teacher, and researcher. He has been teaching programming in Java for almost a decade and enjoys contributing to open source software.
Our Book in the Media (Selection)
- English
- Review by Andrew Binstock in the Java magazine
- Short review by Robert C. Martin on Twitter
- Thorough review by Frank Raiser on his personal blog
- Recommended Summer Reading by Thorben Janssen on his personal blog
- Review by Alexander Schwartz on his personal blog
- Review by Philip Riecks on his personal blog
- Review by Quinn Gil on his personal blog
- Review by Vijitha Kumara on Coderanch.com
- Review by Alex Armstrong on i-programmer.info
- Interview by David Rael on the Developer On Fire podcast
- Review by Dustin Marx on DZone and published on his own blog.
- Review by Steven Schwenke on his own blog.
- Review by Jeanne Boyarsky on infoQ
- Review by Michael Hönnig on his own blog
- Review by Rick Leir on blinkmonitor.com
- Review by Gary Woodfine on his blog
- Review by Daniel Lindner on his blog
- Review by Pan Pantziarka on TechBookReport
- Review by Tom Hombergs on reflectoring.io
- Review by Dan Geabunea on his own blog
- Dylan Isreal interviews Simon Harrer on coding360 on youtube
- Review by Sylvain Leroy on his own blog
- Timothée Bourguignon interviews Simon Harrer on the Software Developer's Journey Podcast
- Review by Ken Fogel on his own blog and on DZone
- Review by Sudheer Jonna on his own blog
- Review by Alexander Radzin on his own blog
- Interview by Adam Bien on his podcast airhacks.fm
- Review by Vojtech Ruzicka on his own blog
- Review by Mateusz Palichleb on his personal blog
- Interview by David Tanzer
- Review by Naresha K on his own blog
- Review by Kasra Madadipouya on his own blog
- German
- Review by Felix Betzl on www.feki.de
- Review by Michael Müller on Heise Developer
- Michael Vitz interviews Simon Harrer on the INNOQ Podcast
- Review by Jörn Hameister on his personal blog
- Interview of Simon Harrer and Linus Dietz on Uni Bamberg Facebook Account
- Review by Stefan Macke as a blogpost and podcast!
- Review in the JAVAPRO 3/2018 magazine
- Review by Prof. Dr. Oliver Höß on his site innovative-trends.de
- Review by Johnny Graber on his personal blog
- Autoweird.fm Podcast Interview
- French
- Review by Eric Siber on his personal blog, including an interview
- Turkish
- Review by İbrahim Kürce on medium.com Part 1
- Review by İbrahim Kürce on medium.com Part 2
- Presentation about Java by Comparison by İbrahim Kürce on slideshare.net
- Japanese
- Review by Jeanne Boyarsky on infoQ, translated by H. Yoshida
Our book in University libraries
- Germany
- HTW Berlin, HU Berlin, TH Hamburg, TH Köln, TH Nürnberg, TU Darmstadt, TU München, Uni Bamberg, Uni Bayreuth, Uni Dresden, Uni Erlangen, Uni Hamburg, Uni Passau, Uni Stuttgart, Uni Weimar, Uni Würzburg
Book Awards (Selection)
Talks About the Book
- 2018-05-15 at Hackerkegeln in Nürnberg, Germany
- 2019-03-25 Coding Dojo BMW in München, Germany
- 2019-04-02 at Softwerkskammer Ruhrgebiet, Germany Video (German)
- 2019-04-03 at Softwerkskammer Düsseldorf, Germany
- 2019-06-04 at Softwerkskammer Leipzig, Germany
- 2019-07-08 at Universität Bamberg WIAI.community, Germany
- 2019-10-09 at Leightweight Java User Group München, Germany
- 2019-10-10 at Softwerkskammer Nürnberg, Germany
- 2019-10-23 at Softwerkskammer Köln, Germany
- 2019-10-29 at JUG Mainz, Germany
- 2019-11-26 at JUG Hamburg, Germany
- 2021-03-31 at JUG Darmstadt, Germany
- Upcoming
- nothing yet