Yegor Bugayenko's Blog, page 23

November 20, 2016

Encapsulation Covers Up Naked Data

Encapsulation is the core principle of object-oriented programming that makes objects solid, cohesive, trustworthy, etc. But what exactly is encapsulation? Does it only protect against access to private attributes from outside an object? I think it's much more. Encapsulation leads to the absence of naked data on all levels and in all forms.

Borat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan (2006) by Larry CharlesBorat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan (2006) by Larry Charles

This is what naked data is (C code):

int...
 •  0 comments  •  flag
Share on Twitter
Published on November 20, 2016 16:00

November 17, 2016

Software Conferences to Attend

This is my list of software conferences that are worth attending, as a speaker and a listener; with a focus on Java and project management. I will try to update this list regularly, mostly not to forget where I have to submit my talks. Hopefully the list will help you too, to make the right choice and never miss their CFP deadlines.

Name Place When CFP JEEConf Kiev May Jan AgileEE Kiev Apr Jan GeekOUT Tallinn Jun Feb JavaOne San Francisco Sep Mar Devoxx Antwerp Nov Apr JavaZone...
 •  0 comments  •  flag
Share on Twitter
Published on November 17, 2016 16:00

November 8, 2016

Why I Don���t Publish E-Books

Very often readers of my books ask me why I don't publish them in digital format as e-books for Amazon Kindle, EPUB, FB2, or simply PDF. There are a few reasons. It's time to summarize them all and explain why dead trees are the only way to go if you want to read my content.

The Addams Family (1991) by Barry SonnenfeldThe Addams Family (1991) by Barry Sonnenfeld

First of all, there is a simple technical reason:

badge

I don't know how to format them. I type all my books in LaTeX. To my knowledge, it's the best and most power...

 •  0 comments  •  flag
Share on Twitter
Published on November 08, 2016 16:00

Why I Don���t Publish E-Books

Very often readers of my books ask me why I don't publish them in digital format as e-books for Amazon Kindle, EPUB, FB2, or simply PDF. There are a few reasons. It's time to summarize them all and explain why dead trees are the only way to go if you want to read my content.

The Addams Family (1991) by Barry SonnenfeldThe Addams Family (1991) by Barry Sonnenfeld

First of all, there is a simple technical reason:

badge

I don't know how to format them. I type all my books in LaTeX. To my knowledge, it's the best and most power...

 •  0 comments  •  flag
Share on Twitter
Published on November 08, 2016 16:00

October 22, 2016

Software Quality Award, 2017

This is the third year of the Software Quality Award. The prize is still the same—$4,096. The rules are still the same. Read on. Previous years are here: 2015, 2016.

Registration is open! Fill this form to submit.

Rules:

One person can submit only one project.

Submissions are accepted until the September 1, 2017.

I will check the commit history to make sure you're the main contributor to the project.

I reserve the right to reject any submission without explanation.

All submissions...

 •  0 comments  •  flag
Share on Twitter
Published on October 22, 2016 17:00

September 26, 2016

Command, Control, and Innovate

Command and control has worked effectively in military units across the world for thousands of years. But apparently we've just discovered that the best companies are built on different verbs, which are inspire, delegate, trust, lead, innovate, etc. The question is whether we really uncovered something new that our predecessors failed to understand for ages or something else is going on.

Andrei Rublev (1966) by Andrei TarkovskyAndrei Rublev (1966) by Andrei Tarkovsky

We are lazy and greedy animals. To work and produce somethin...

 •  0 comments  •  flag
Share on Twitter
Published on September 26, 2016 17:00

September 19, 2016

OOP Without Classes?

I interviewed David West, the author of the Object Thinking book, a few weeks ago, and he said that classes were not meant to be in object-oriented programming at all. He actually said that earlier; I just didn't understand him then. The more I've thought about this, the more it appears obvious that we indeed do not need classes.

Battleship Potemkin (1925) by Sergei M. EisensteinBattleship Potemkin (1925) by Sergei M. Eisenstein

Here is a prototype.

Let's say we have only types and objects. First, we define a type:

type Book { v...
 •  0 comments  •  flag
Share on Twitter
Published on September 19, 2016 17:00

September 12, 2016

Inheritance Is a Procedural Technique for Code Reuse

We all know that inheritance is bad and that composition over inheritance is a good idea, but do we really understand why? In most all articles I've found addressing this subject, authors have said that inheritance may be harmful to your code, so it's better not to use it. This "better" part is what bothers me; does it mean that sometimes inheritance makes sense? I interviewed David West (the author of Object Thinking, my favorite book about OOP) a few weeks ago, and he said...

 •  0 comments  •  flag
Share on Twitter
Published on September 12, 2016 17:00

September 6, 2016

Gradients of Immutability

Good objects are immutable, but not necessarily constants. I tried to explain it here, here, and here, but now it's time to make another attempt. Actually, the more I think about it, the more I realize that immutability is not black or white—there are a few more gradients; let's take a look.

Twelve Monkeys (1995) by Terry GilliamTwelve Monkeys (1995) by Terry Gilliam

As we agreed here, an object is a representative of someone else (some entity or entities, other object(s), data, memory, files, etc.). Let's exam...

 •  0 comments  •  flag
Share on Twitter
Published on September 06, 2016 17:00

August 29, 2016

Vertical vs. Horizontal Decomposition of Responsibility

Objects responsible for too many things are a problem. Because their complexity is high, they are difficult to maintain and extend. Decomposition of responsibility is what we do in order to break these overly complex objects into smaller ones. I see two types of this refactoring operation: vertical and horizontal. And I believe the former is better than the latter.

Once Upon a Time in America (1984) by Sergio LeoneOnce Upon a Time in America (1984) by Sergio Leone

Let's say this is our code (it is Ruby):

class Log def initialize(path) @...
 •  0 comments  •  flag
Share on Twitter
Published on August 29, 2016 17:00