Jump to ratings and reviews
Rate this book

Software Mistakes and Tradeoffs: How to make good programming decisions

Rate this book
Optimize the decisions that define your code by exploring the common mistakes and intentional tradeoffs made by expert developers

In Software Mistakes and Tradeoffs you will learn how to:

Reason about your systems to make intuitive and better design decisions
Understand consequences and how to balance tradeoffs
Pick a proper library for your problem
Thoroughly analyze all of your service’s dependencies
Understand delivery semantics and how they influence distributed architecture
Design and execute performance tests to detect code hot paths and validate a system’s SLA
Optimize code hot paths to get the most improvement efficiently
Understand tight/loose coupling and how it influences coordination of work between teams
Clarify requirements until they are precise, easily implemented, and easily tested
Optimize your APIs for friendly user experience

In Software Mistakes and Tradeoffs you’ll learn from costly mistakes that Tomasz Lelek and Jon Skeet have encountered over their impressive careers. You’ll explore real-world scenarios where poor understanding of tradeoffs lead to major problems down the road, to help you make better design decisions. Plus, with a little practice, you’ll be able to avoid the pitfalls that trip up even the most experienced developers.
about the technology
Code performance versus simplicity. Delivery speed versus duplication. Flexibility versus maintainability—every decision you make in software engineering involves balancing tradeoffs. Often, decisions that look good at the design stage can prove problematic in practice. This book reveals the questions you need to be asking to make the right decisions for your own software tradeoffs.
about the book
Software Mistakes and Tradeoffs teaches you how to make better decisions about designing, planning, and implementing applications. You’ll analyze real-world scenarios where the wrong tradeoff decisions were made, and discover what could have been done differently. The book lays out the pros and cons of different approaches and explores evergreen patterns that will always be relevant to software design.

You’ll understand the consequences of certain decisions, like how code duplication impacts the coupling and evolution speed of your systems and how simple-sounding requirements can have hidden nuances with respect to date and time information. Discover how to efficiently narrow your optimization scope according to 80/20 Pareto principles and ensure consistency in your distributed systems. You’ll soon be able to apply the author’s hard-won experience to your own projects to pre-empt mistakes and take a more thoughtful approach to decision making.

416 pages, Paperback

Published June 7, 2022

Loading...
Loading...

About the author

Tomasz Lelek

2 books4 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
28 (33%)
4 stars
28 (33%)
3 stars
23 (27%)
2 stars
4 (4%)
1 star
1 (1%)
Displaying 1 - 24 of 24 reviews
Profile Image for Emre Sevinç.
181 reviews447 followers
October 8, 2022
This book is a very mixed bag: on the one hand, the experienced authors provide a good view into the complexities and pitfalls that senior software engineers must deal regularly, and this can give a good idea to junior software developers curious about back-end systems development. On the other hand, talking about date and time API and its complexities in Java in one chapter, and then jumping to Apache Spark and Kafka in the following chapters is a pretty weird choice; the book could use more editorial support for a better flow.

One nice thing I have to note is the following: in some chapters, the authors present alternative approaches and code patterns to solve the same problem, and they clearly explain how they evaluate each approach by running small experiments, benchmarks, as well as relying on rules of thumb.

I'm afraid I can't recommend this book strongly which is a pity, because most of the topics are pretty important for most of the software engineers, especially working in complex back-end and data processing systems.
Profile Image for Kris.
258 reviews15 followers
August 30, 2021
I was reading an early access (version V2).

It’s still work in progress, but what’s it lacking the most is editing, cleanups and maybe some charts. I don’t want my review to be misleading when the final version lands so I’m going to ignore those in this review.

I like to read cover to cover but this is one of those books when it’s not the best strategy. Especially when I think that the chapters in the second half were much more interesting to me.

I especially liked the last chapter 13    “Keeping up to date with trends vs cost of maintenance of your code”

But, most of them were pretty interesting. I can recommend chapter 7. It’s not an easy one but the best take on date/time data I’ve seen. And if you think you don’t need them in your app you will still get some first principles knowledge for working with time in the future.

Reading cover to cover is fine of course as I did it.

Why not 5 stars?
Book is focused a lot more on Java or C# ecosystems for me to be comfortable recommending it to everyone. Also if you don’t work with Kafka or similar then one of the chapters won’t be of any use to you as well.

But, it’s still a great read even if you don’t work in Java-just at the level of 4 stars (assuming editing before the final release)
Profile Image for Vitoshacademy.
5 reviews3 followers
November 17, 2022


In general, I can say I liked the book:

1. The book is written in a nice and understandable language, as if the author is speaking in a podcast;

2. What I liked was the fact that there was a whole chapter, dedicated to date and time data. Being an active Stackoverflow.com user, I have answered quite some number of questions on this topic and yet, there were plenty of things I learned from the book. E.g. this is a good example:
While in maths a+(b+c) == a+(b+c), in the java.time both might be different:
(January 31, 2021 + 1 month) + 2 months = April 28, 2021
January 31, 2021 + (1 month + 2 months) = April 30, 2021
and it actually makes sense.
After explaining a lot of the date and time corner cases, the author provides some good idea how to test these and what exactly to test in them. When you read it, you will get some advanced knowledge on that subject and be able to structure well the requirements for an application (or to ask the right questions to the product owner, if you are in the dev's boots);

3. I liked the first chapter, where the author explains that although the singleton is quite a simple and straightforward design pattern, it can have its tradeoffs and it can be improved, depending on the input. E.g. once you create a singleton, every access to the object will need to by synchronized.
This might be bad, as it could lead to unwanted waiting time on a lock. Thus, the authors provide an interesting addition to the singleton, that checks the existence of a lock, and in a specifically customized benchmark test, it performs better (115 times faster) than the singleton itself. Does this mean we should always opt for the singleton with the lock check? Actually, not - only when our actual data requires it;

4. Code duplication is not always that bad - with examples! E.g. if you have two teams, working on a project with similar structure, then if they do not share code, they will go faster, as they will be working completely in parallel (Amdahl's law). However, if they need to unite their code at
a later stage, the earlier they do it - the better, as it is unlikely they will come up with similar interfaces, method names, signatures, etc.

What I did not like:
I did not like that the examples were mainly in Java (with some places, where .Net libraries were mentioned), but this is digestible, as the code was well written.

The verdict:
5 stars, as I learned new things from the book, it is well structured and kept my interest. Separate star for the courage to go into so much details on the date and time topic.
2 reviews1 follower
December 29, 2022
Straight to the point, extremely informative

1- the top tip section cover the most important lesson of each chapter
2 - the chapters on Premature optimization, Consistency and atomicity in distributed systems, Managing versioning, and compatibility helped me a lot personally
3- I personally recommend this book to any software engineer who wishes to make his life easier when facing the problems discussed in this masterpiece
Profile Image for Vinicius Souza.
54 reviews4 followers
March 22, 2023
A mix of very diverse themes. Each chapter covers a different subject inside software engineering / computer programming. Some chapters are incredible good and some are very boring and repetitive. There are two that I highly recommend to most engineers:

- The one about working with dates and times. This is the best resource on the subject I've ever read.
- The one about optimizations. I believe there are many resources on this subject, but the coverage here is a very good and broad introduction.

1 review
March 29, 2023
I like the idea, the structure, and all the suggestions the authors shared with us.

The book describes various problems we may face during daily work, how to tackle them, and how to decide which solution brings us the most benefits.

From small to enormous challenges
The book is a journey through various challenges. We start with code-related issues. We look at them to learn their impact on the current implementation and future maintenance. We get to know the harm they bring to the code.

Then we move to the higher level of abstraction, to face difficulties with APIs and libraries, with the boundaries of our components. And this is still not the end.

We continue our journey to learn about the challenges that come with distributed systems, consistency, versioning, and more.

Each challenge is described carefully to give a good understanding of the subject so we know why the presented implementation is a problem. The authors advise possible solutions to make the issue less damaging. They go through the pros and cons of each choice and explain the tradeoffs that come with them.

It makes us aware the journey comes with a price. There is always a decision to make, and unfortunately, rarely the best option exists.

For everyone
Topics in the book are about the code and the component's design, the readability, and the high-level integration, changes on the method level, and changes to the system. The number of covered topics makes this book relevant for developers and architects, for those who start their careers, and for those with experience.

Regardless of the topic, the book demonstrates what the decision-making process should look like. We learn what should be taken into consideration and what level of detail is relevant in the given context. I think this is one of the most priceless lessons.

Examples
Whatever the subject and level of abstraction are, authors share a lot of practical examples we can explore. We can examine them and see what changes when the just-explained option gets implemented. We can compare choices and their tradeoffs, and decide which one we can or cannot accept.

Explaining the topic without well-written examples left us with the theory only. Nothing is as precise for an engineer as the code you can look at. And this level of clarity is what authors serve us.

Testing
Years ago, I wrote that the main method should not be your test strategy - we should use tests to prove the problem exists or to validate the solution. I believe authors have similar opinions because you can find dozens of tests in the book - most of the issues and solutions are covered by test suites.

I think everyone who shares the knowledge should use this approach to prove the behavior of the code/component/service is as expected.

Due to that practice, even though the book focuses on various issues and tradeoffs you need to accept, it also teaches how to develop the software. We can learn to do changes in a way that increases the quality of the code and makes future refactorings and modifications safer and easier.

This is an amazing additional lesson we get.

Conclusion
I recommend the book regardless of your seniority or role. Why? It teaches one key thing: "With each decision comes tradeoffs".

In every chapter, we learn the cost is always there, and we must consider that when making the decision. We learn to accept these consequences, weigh the pros and cons, make the judgment, and move forward.

I enjoyed the journey and wish you the same experience with the book.
Profile Image for Krystian.
11 reviews1 follower
December 21, 2022
Overall, this is a great book, written by experienced developers.

There was one thing that surprised me. I thought that it was going to present a generic framework for the decision-making process - it didn't, instead it's a collection of real-life problems and possible solutions for these problems. You can infer the process from the presented options, but nevertheless, it feels more like a sample of concrete, useful techniques from an experienced developer's toolbox.

I especially enjoyed the two chapters about the caveats of distributed systems. I recommend it to anyone who can at least read Java and already has some experience in developing production-grade systems.
Profile Image for Grzesiek Mierzwa.
1 review
December 27, 2022
As a big data engineer I find this book very insightful and interesting. Although I am working mostly in Python rather than Java the general concepts are explained in a nice and concise way so that I didn't experience any language barrier.
I definitely recommend this position, particularly for engineers that want to grasp some senior level experience quicker.
1 review
November 5, 2022
Great book! You can learn a lot from it. There are so many things in it that I had no idea. Thanks Tomasz!
This book is intended for beginners as well as advanced programmers.
1 review
October 28, 2022
I liked it. It might be a bit focused on Java, but it helped in my situation as I was learning Java when I read the book. The book isn't really structured. Instead, each chapter focuses on a different topic, so might as well pick a chapter that interests you after reading the introduction.
Profile Image for Yan Guo.
1 review
January 3, 2023
(I read the PDF version of this book)

This is a very good book for the senior engineers to broaden the scope and vision. It tells in honesty when and why to break some rules at times, e.g. code duplication is not always bad. The book has very common and practical examples, such as code duplications, lib v.s. service, etc.

Some great points really beneficial to software engineers at all levels, cherry-picked from my memory:
1. need to understand the alternatives and tradeoff before hand, to avoid common pitfalls too late to fix later
2. understand best practice, such that the direction is not too far from being optimal
3. thinking process on why choosing one over another due to tradeoffs
4. textbook theory couples with practice: singleton pattern, multithreading context, etc
5. speaking of the truth instead of blindly advocate one technology, e.g. design patterns
Last but no least, the book also covers the traditional OOP way vs functional ways (Monads!)
4 reviews
July 2, 2023
Am entry-level book. Most of the materials are pulled out of thin air. Avert little insight, a lot of things are simply obvious. Overloaded with code samples that don't make reading more interesting and don't help the reading
Profile Image for Jevgenij.
564 reviews14 followers
reject-after-initial-skim
July 5, 2022
Despite claiming otherwise, quite heavily Java oriented. Topic selection for the book is too unstructured.
1 review
June 2, 2023
Software Mistakes and Tradeoffs" is an exceptional book that every person who makes software should have on their shelf. As someone who has been working in the industry for several years, I can confidently say that this book is key to reaching the next level. It dives deep into the intricate world of software development, in particular the part when we have to make some codes or architectural decisions. It highlights common mistakes and presents a very interesting idea. Every decision we make has tradeoff that can impact the success of our software project.
Jon is well known in the community and it doesn't dissapoint.
If you wanna improve your knowledge in how to make software decisions this is your book.
Profile Image for Strong Extraordinary Dreams.
593 reviews30 followers
November 25, 2024
yet another extremely poor programming book. some programmer waffles about projects that he has worked on, dropping in almost random hints and tips, all localised to the particular irrelevant problem that he is demonstrating. It is just soooo bad.

The other positive reviews are only because virtually every programming book is dire.

This book was meant to be about how to make good programming decisions. instead it is a pile of disordered anecdotes. I don't want to hear about someone deciding to derive Class B from class A as if that was somehow important. it's stupidity really. those who give good reviews or good ratings to books like this should be ashamed of themselves.
Profile Image for Nilendu Misra.
363 reviews20 followers
October 20, 2023
Really wanted to like this book - highest-level decisions in tech, just like in any other domain, are not binary. They require probabilistic trade-off analysis. Experiende and Wisdom from such books could act as “prior” of that equation.

It, however, went all over the place without a structured theme - read like a few disjointed blog posts cobbled together. In some cases the focus was too narrow beam - like exeception hierarchy and optimize it with a “try monad”. Smart, but exotic enough to be generalized.
Profile Image for Mikhail Filatov.
418 reviews23 followers
September 4, 2022
The title is very misleading. Only first couple of chapters (about applicability of "singleton" and some other patterns and pros/cons of DRY) are really relevant. After that - chapters on Exceptions in Java (with dozen of pages about checked/unchecked exceptions), big Data, concurrent programming... more or less everything the author wants to share from his experience.
I'm not sure who is the audience of this book.
3 reviews
March 17, 2025
Most of is a very basic stuff for mid+ engineers. Really complicated topics with subtle nuances (e.g. atomicity, deduplication, idempotency in distributed systems) are glanced over and sometimes oversimplified. Which
imo (given the size of the book) is a big shortcoming.
The content is bloated with sometimes too much code which is not much useful as for the most part it illustrates very obvious concepts, which are clear w/o those extensive code listings.
Profile Image for Christoph Kappel.
513 reviews11 followers
March 1, 2024
I really enjoyed reading this book and especially the chapter about dates and times was the funniest thing about that I've ever read before.

Especially the overall decision/trade-off theme is something that you usually find in books geared towards architects only and I really appreciate that!
1 review
March 31, 2023
Excellent book for the programmer. This book contains lot of knowledge gained and handled over years. Prefect for becoming the expert pull request reviewer and for the coder alike.
Displaying 1 - 24 of 24 reviews