99 Bottles of OOP book review

Review of one of the most popular OOP books, written by a skilled coder 
28 July 2017   3047

Dynamic, open source programming language with a focus on simplicity and productivity, it has an elegant syntax that is natural to read and easy to write.

“99 bottles of OOP” is the second Sandi Metz’s book, co-authoring Katrina Owen. I was interested in this book for several reasons: first of all, I like the authors and their activities, secondly, I like the topic and the name of the book is awesome. I believe that writing the solid book based on the discussions about one kata, especially the one about “99 bottles of beer” is an outstanding idea by itself.

99 bottles of OOP
99 bottles of OOP

The authors recommend spending a half an hour on solving the “99 bottles of beer” kata before reading the book.

In the beginning of the book, there are several solutions which are evaluated with the help of metrics and common sense. When the best solution (for now) is chosen, the new requirements appear. Now you have to adapt your code so that it would become open for the easy change. In the following chapters, you’ll find the refactoring steps with the detailed descriptions and rationales.

Make the change easy (warning: this may be hard), then make the easy change.

Kent Beck
Programming Coach, Facebook

This book was written as the alternative to visiting a workshop, so it’s important to reproduce all steps and imagine that you are at the event :)

The authors imply, that “99 bottles” may totally change your assumptions on TDD. The code is changed by very small steps, and after each change, you must run the tests and they should remain green. If not, revert and make another change.

If you are an experienced programmer and haven’t used such approach before, it may be hard for you to use it. It’s not easy to me to use all rules, especially when I work on large projects, that contain legacy code. But it’s useful to explore this approach: e.g. sometimes the right abstractions will “appear” after you make several small steps. It may be easier to try this approach while solving katas first.

According to the authors, the book has 2 goals:

  • supply you with the concrete refactoring techniques for everyday use
  • make you fall in love with polymorphism

I guess we shouldn’t think of “99 bottles” as finding the right solution for the specific task. It’s more of a demonstration of refactoring rules and oop principles, using this example.

Refactoring is one of my favorite topics, so I liked the book. It helped me to organize my knowledge, look at TDD from a different angle and use this approach more often.

My notes on the book

Git 2.20 to be Available

Let's check updates and features of new version control system
11 December 2018   109

Distributed version control system Git has received another update. In order for Git 2.20 to appear, 83 developers made changes 962 to the zcode. According to the team, this is an order of magnitude higher than the same figure in the largest release of the 2.x.x branch.

The git branch -l command is now a shortened version of the git branch --list - it used to help run reflog during the creation of a new branch. Developers have limited the launch of git fetch: it is only possible with an indication of --force, to avoid problems with consistency when updating the link.

The git help -a and git help -av commands to help newbies display a more verbose output. To return to the old view, just type git help - no-verbose -a. In git send-email, it is possible to extract lines with addresses that end with “-by” from signatures. This is an incompatible change, and it can be disabled by adding to the --suppress-cc = misc-by command.

  • If the repository contains files whose addresses differ only in the case of letters, a warning will be displayed during the execution of git clone.
  • The git format-patch command received the --interdiff and --range-diff options, which in a note or comment list the differences between the existing and previous versions.
  • git mailinfo learned how to recover code patches sent by email with plain text and damaged due to hyphenation.
  • git multi-pack-index now fixes damage in .midx files.
  • Creating experimental commit-graph files for large repositories takes a lot of time, so the developers have provided a form of output about the state of the process.

Performance and Development Support

  • For working builds, the -Wunused-function compilation option is provided.
  • git submodule update is completely rewritten in C.
  • One of the continuous integration (CI) tests, designed to work with the unusual/experimental/random settings, now supports midx and commit-graph files.
  • A new mechanism for finding objects among a large number of pack-files. It relies on combining all .idx files into one.

The previous version of the system was released in September 2018.