Yegor Bugayenko's Blog, page 21

April 10, 2017

Flexibility Equates to Lower Quality

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-obj...

 •  0 comments  •  flag
Share on Twitter
Published on April 10, 2017 17:00

April 4, 2017

PDD in Action

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.

[image error]0pdd.com

Here is how you configure it, in two steps. First, you grant read-only access t...

 •  0 comments  •  flag
Share on Twitter
Published on April 04, 2017 17:00

March 27, 2017

SOLID Is OOP for Dummies

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.

[image error]Dumb & Dumber (1994) by Peter Farrelly

Let's go one by one and see ho...

 •  0 comments  •  flag
Share on Twitter
Published on March 27, 2017 17:00

March 23, 2017

The TDD That Works for Me

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 23, 2017 17:00

March 6, 2017

Traits and Mixins Are Not OOP

Let me say right off the bat that the features we will discuss here are pure poison brought to object-oriented programming by those who desperately needed a lobotomy, just like David West suggested in his Object Thinking book. These features have different names, but the most common ones are traits and mixins. I seriously can't understand how we can still call programming object-oriented when it has these features.

Fear and Loathing in Las Vegas (1998) by Terry GilliamFear and Loathing in Las Vegas (1998) by Terry Gilliam

First, here's...

 •  0 comments  •  flag
Share on Twitter
Published on March 06, 2017 16:00

February 27, 2017

How to Handle the Problem of Too Many Classes

During nearly every presentation in which I explain my view of object-oriented programming, there is someone who shares a comment like this: "If we follow your advice, we will have so many small classes." And my answer is always the same: "Of course we will, and that's great!" I honestly believe that even if you can't consider having "a lot of classes" a virtue, you can't call it a drawback of any truly object-oriented code either. However, there may...

 •  0 comments  •  flag
Share on Twitter
Published on February 27, 2017 16:00

February 20, 2017

Why I Don���t Talk to Google Recruiters

This is a real story, and it's not only about Google. I'm getting emails from recruiters at Amazon, Facebook, and smaller Silicon Valley startups. They find me somehow, most likely through this blog, my books, or my GitHub account. They always start with "We're so impressed by your profile" and finish with "Let's schedule an interview." I always reply with the same text, and they always disappear, only to come back in a few months under a different name. Le...

 •  0 comments  •  flag
Share on Twitter
Published on February 20, 2017 16:00

Why I Don���t Talk to Google Recruiters

This is a real story, and it's not only about Google. I'm getting emails from recruiters at Amazon, Facebook, and smaller Silicon Valley startups. They find me somehow, most likely through this blog, my books, or my GitHub account. They always start with "We're so impressed by your profile" and finish with "Let's schedule an interview." I always reply with the same text, and they always disappear, only to come back in a few months under a different name. Le...

 •  0 comments  •  flag
Share on Twitter
Published on February 20, 2017 16:00

February 13, 2017

StackOverflow Is Your Mandatory Tool

I've said before that your StackOverflow reputation is very important to us when we make a decision on how much we should pay a software developer. However, there were many complaints about this metric. Take, for example, the ones here and here. In a nutshell, so many of you disagreed and said that the number of StackOverflow up-votes was nothing more than a measurement of the amount of time someone spent answering stupid questions asked by clueless programmers. Let me disagree and explai...

 •  0 comments  •  flag
Share on Twitter
Published on February 13, 2017 16:00

February 6, 2017

Each Private Static Method Is a Candidate for a New Class

Do you have private static methods that help you break your algorithms down into smaller parts? I do. Every time I write a new method, I realize that it can be a new class instead. Of course, I don't make classes out of all of them, but that has to be the goal. Private static methods are not reusable, while classes are—that is the main difference between them, and it is crucial.

[image error]The Master (2012) by Paul Thomas Anderson

Here is an example of a simple class:

class Token { private St...
 •  0 comments  •  flag
Share on Twitter
Published on February 06, 2017 16:00