Yegor Bugayenko's Blog, page 20

June 5, 2017

Gluten-Free Management Recipes

We live in the era of organic food, eco-friendly toilets, zero-emission cars, and harassment-free offices. Our management practices have to keep up—they must be zero-stress, conflict-free, and idiot-friendly. If you're still stuck in the old carrot-and-stick, mediocrity-intolerant, primitive mentality, these recipes will open your eyes.

[image error]Dogville (2003) by Lars von Trier

Be Positive. You must remember that keeping people happy is more important than their results, effectiveness and...

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2017 17:00

May 29, 2017

Why Do You Contribute to Open Source?

You probably remember my half-a-year-old article: Why Don't You Contribute to Open Source?. I said there that if you don't have your own OSS projects or don't give anything back to those you're using—something is wrong with you. Now I'm talking to those who actually do contribute without demanding anything back—guys, you're doing it wrong!

[image error]The Untouchables (1987) by Brian De Palma

Open source almost always means free, as in beer—nobody will pay you a...

 •  0 comments  •  flag
Share on Twitter
Published on May 29, 2017 17:00

May 22, 2017

Any Program Has an Unlimited Number of Bugs

This may sound strange, but I will prove it: no matter how big or stable a piece of software is, it has an unlimited number of bugs not yet found. No matter how many of them we have already managed to find and fix, there are still too many left to count.

[image error]L'amico di famiglia (2006) by Paolo Sorrentino

Let's take this simple Java method that calculates a sum of two integers as an example:

int sum(int a, int b) { return a + b; }

This simple program has an unlimited number of bugs.

To pr...

 •  0 comments  •  flag
Share on Twitter
Published on May 22, 2017 17:00

May 16, 2017

Single Statement Unit Tests

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.

[image error]Bullet (1996) by Julien Temple

Look at this test method from RandomStreamTest from OpenJDK 8, created by Brian Goetz:

@Test public void testIntStream() { final long seed = System.currentTimeMilli...
1 like ·   •  0 comments  •  flag
Share on Twitter
Published on May 16, 2017 17:00

May 15, 2017

Monikers Instead of Variables

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.

[image error]OSS 117: Cairo, Nest of Spies (2006) by Michel Hazanavicius

Here is the code from Section 5.10 (Algorithms) of my book Elegant Objects:

public class Main { public static void main(String... args) { final Secret secret = new Secret(); new Farewell( new Attempts(...
1 like ·   •  0 comments  •  flag
Share on Twitter
Published on May 15, 2017 17:00

May 9, 2017

How Does Inversion of Control Really Work?

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.

[image error]Le conseguenze dell'amore (2004) by Paolo Sorrentino

Look at this code:

print(book.title());

It is very straight forward: we retrieve the title from the book and simply give it to the print() procedure, or whatever else it might be. We...

 •  0 comments  •  flag
Share on Twitter
Published on May 09, 2017 17:00

How Does Inversion of Control Really Work

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.

[image error]Le conseguenze dell'amore (2004) by Paolo Sorrentino

Look at this code:

print(book.title());

It is very straight forward: we retrieve the title from the book and simply give it to the print() procedure, or whatever else it might be. We...

 •  0 comments  •  flag
Share on Twitter
Published on May 09, 2017 17:00

May 1, 2017

A Remote Slave Is Still a Slave

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.

[image error]Happiness (1998) by Todd Solondz

Working from home, also known as work...

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on May 01, 2017 17:00

April 24, 2017

SixNines.io, Your Website Availability Monitor

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

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

April 17, 2017

Why I Won���t Help You Via Email

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.

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