Single Statement Unit Tests

  • 372 words
  • two minutes to read
  • comments

Many articles and books have already been written about unit testing patterns and anti-patterns. I want to add one more recommendation which, I believe, can help us make our tests, and our production code, more object-oriented. Here it is: a test method must contain nothing but a single assert.

Monikers Instead of Variables

  • 200 words
  • a minute to read
  • comments

If we agree that all local variables must be final, multiple returns must be avoided, and temporal coupling between statements is evil—we can get rid of variables entirely and replace them with inline values and their monikers.

How Does Inversion of Control Really Work?

  • 273 words
  • two minutes to read
  • comments

IoC seems to have become the cornerstone concept of many frameworks and object-oriented designs since it was described by Martin Fowler, Robert Martin and others ten years ago. Despite its popularity IoC is misunderstood and overcomplicated all too often.

A Remote Slave Is Still a Slave

  • 906 words
  • four minutes to read
  • comments

Working remotely is definitely a trend, according to the BLS and my personal observations. "Let them work from home" seems to be the silver bullet for every second startup and even some big companies like Buffer, Automattic, Groove, and many others. However, in most cases, the replacement of a brick-and-mortar office with a virtual one doesn't help companies and their slaves employees become more productive.

SixNines.io, Your Website Availability Monitor

  • 363 words
  • two minutes to read
  • comments
badge

Availability is a metric that demonstrates how often your website is available to its users. Technically, it's a ratio between the number of successful attempts to open the website and the number of failed ones. If one out of a hundred attempts failed, we can say the availability is 99 percent. High-quality websites aim for so-called "six nines" high availability, so named by the number of 9s in the ratio: 99.9999 percent. We created a service that helps you measure this metric and demonstrate its value to your users: SixNines.

Why I Won't Help You Via Email

  • 254 words
  • a minute to read
  • comments

I've been blogging and writing for almost three years now, and a few times a week I get emails or Facebook and Telegram messages from people I don't really know. They ask questions about Java, management, object-oriented programming, and other things they believe I understand and can help them with. Well, my contact details are published right in the header on my blog—what else would I expect, right? True, but even though I always reply to them, I never answer their questions.

Flexibility Equates to Lower Quality

  • 653 words
  • three minutes to read
  • comments

There are two opposing mindsets: "If it works, it's good" vs. "If it's good, it works;" or "Make it work" vs. "Make it right." I'm talking about the software source code. I've been hearing this almost every day in blog comments: Why do we need all those new OOP principles if our code works just fine without them? What is the point of introducing a new way, which is supposed to be "better," if the existing, traditional, semi-object, semi-procedural, not-so-perfect approach just works?

PDD in Action

  • 328 words
  • two minutes to read
  • comments
badge

Puzzle-driven development (PDD) is a methodology we've been practicing on our teams for more than seven years. Using PDD, we delegate the responsibility of task decomposition to its performers, eliminating the role of a project manager. We've been using our proprietary software for that. A month ago, we made it public, open source, and free. It is available as 0pdd—a GitHub-based chat bot.

SOLID Is OOP for Dummies

  • 730 words
  • three minutes to read
  • comments

You definitely know the SOLID acronym. It stands for five principles of object-oriented programming that, if followed, are supposed to make your code both legible and extensible. They were introduced almost 30 years ago, but have they really made us better programmers in the time since? Do we really understand OOP better thanks to them? Do we write more "legible and extensible" code? I don't think so.

The TDD That Works for Me

  • 1181 words
  • five minutes to read
  • comments

Test-driven development (a.k.a. TDD) was rediscovered by Kent Beck and explained in his famous book in 2002. In 2014, David Heinemeier Hansson (the creator of Ruby on Rails) said that TDD is dead and only harms architecture. Robert Martin (the inventor of the SOLID principles) disagreed and explained that TDD may not work only in certain cases. A few days later, he even compared the importance of TDD with the importance of hand-washing for medicine, and added that "it would not surprise me if, one day, TDD had the force of law behind it." Two years later, now just a few months ago, he wrote more about it, and more, and more. This subject seems to be hot. Of course, I have my own take on it; let me share.