99 Bottles of OOP book review

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

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

NGINX to Release Unit 1.3 Beta

Developers expanded the ability to run web applications in Python, PHP, Perl, Ruby and Go
16 July 2018   110

In open access, a beta version of the NGINX Unit 1.3 application server was released. Developers continued to expand the ability to run web applications in Python, PHP, Perl, Ruby and Go. The project code is written in C and is distributed under the Apache 2.0 license.

Features

Version 1.3 eliminates the problems with handling errors when installing HTTP connections.

Among other changes:

  • parameter max_body_size to limit the size of the body of the request;
  • new parameters for setting timeouts when setting up an HTTP connection:
         "settings": {
              "http": {
                  "header_read_timeout": 30,
                  "body_read_timeout": 30,
                  "send_timeout": 30,
                  "idle_timeout": 180,
                  "max_body_size": 8388608
              }
          },
  • automatic use of the Bundler where possible in the Ruby module;
  • http.Flusher interface in the module for the Go language;
  • The possibility of using characters in the UTF-8 encoding in the request headers.

The first version of the NGINX 1.1 application server was released in mid-April 2018. Under the control of NGINX Unit, several applications can be executed simultaneously in different programming languages, the startup parameters of which can be changed dynamically without the need to edit the configuration files and restart.