Don't Parse, Use Parsing Objects

  • 828 words
  • 4 minutes to read
  • comments

The traditional way of integrating object-oriented back-end with an external system is through data transfer objects, which are serialized into JSON before going out and deserialized when coming back. This way is as much popular as it is wrong. The serialization part should be replaced by printers, which I explained earlier. Here is my take on deserialization, which should be done by—guess what—objects.

Microvesting

  • 596 words
  • 3 minutes to read
  • comments

Most startups don’t have enough cash to pay programmers as much as they deserve, unfortunately (or maybe not). Instead of cash, startups give their early employees shares of stock, which they will be able to either 1) sell in a few years and become millionaires billionaires, or 2) throw away and remain nobodies. It’s a common practice. The question, however, is what is the right procedure, and the optimal algorithm, to transfer those shares to programmers. When exactly do they become shareholders? What is the formula?

More Bugs, Please

  • 503 words
  • 2 minutes to read
  • comments

A bug is something we find in a software product that “doesn’t look right” (this is my personal definition). A bug can be hidden or visible; it can be “already fixed” or “still present”; it can be critical or cosmetic; it can be urgent or of a low priority. What is important is that the more bugs we are able to find and fix before our customers see them, the higher the perceived quality of the software. Simply put, bugs are a very good thing, if they are found by us, not our customers. We pay our programmers for each bug they find. Here is a cheat sheet for them, showing where and how they can find those bugs, to make more money.

Are You a Coder or a Developer?

  • 709 words
  • 3 minutes to read
  • comments

Software development and coding are two different things. Usually, the former includes the latter, but not always. Coding produces lines of code, while software development creates products. Unfortunately, the majority of programmers joining Zerocracy now are coders. Even though they claim to be developers, in reality they are lacking the very important sociotechnical skills that differentiate product creators from lines-of-code writers.

The Educational Aspect of Static Analysis

  • 491 words
  • 2 minutes to read
  • comments

Very often new programmers who join our projects ask us whether we have auto-formatting instruments to make Java code look exactly the way Qulice expects. (Qulice is the static analyzer we use.) I always reply that having such an automated code polisher would only be harmful and wouldn’t help the project and its members improve and grow. Here is why I think so.

План Даллеса, Версия 2.0

  • 421 words
  • 2 minutes to read
  • comments

Говорят, что во времена холодной войны существовал План Даллеса, разработанный ЦРУ с целью уничтожения своего главного противника на геополитической арене — Советский Союз. Сработал ли именно этот план, существовал ли он вовсе, и был ли его автором Аллен Даллес — мы точно не знаем. Однако, СССР действительно развалился. Нечто подобное происходит сейчас с Россией — она движется к развалу, без видимой внешней причины. А может быть она есть и у нее существует план?

Five Stages of Microbudgeting

  • 972 words
  • 5 minutes to read
  • comments

Microtasking, which I explained in an earlier post, works only when each task has a very specific reward for success and a punishment for failure. I believe that the best reward and punishment instrument is money. The budget is fixed, the programmer gets it only when the task is completed (reward), no matter how much time it costs; if it is not completed, there is no money at all (punishment). Pure and simple. However, a logical question arises: how can we know upfront what is the right budget? Who sets it?

План "Фиктивная Оппозиция"

  • 420 words
  • 2 minutes to read
  • comments

Главной задачей любого государственного режима является выживание. Главной потенциальной угрозой этому всегда является народ, этим режимом угнетаемый. Наиболее активные и решительные представители народа, сплоченные вокруг единой цели, называются оппозицией. Переход оппозиции к решительным действиям выливается в митинги, демонстрации, забастовки, бунты и теракты. Неудачные попытки квалифицируются как государственный переворот и жестоко режимом наказываются. Удачные получают гордое имя Революция и празднуются. Новым режимом.

Operator new() is Toxic

  • 914 words
  • 5 minutes to read
  • comments

To instantiate objects, in most object-oriented languages, including Java, Ruby, and C++, we use operator new(). Well, unless we use static factory methods, which we don’t use because they are evil. Even though it looks so easy to make a new object any time we need it, I would recommend to be more careful with this rather toxic operator.

The Formula for Software Quality

  • 539 words
  • 2 minutes to read
  • comments

How do you define the quality of a software product? There is definitely an intrinsic emotional component to it, which means satisfaction for the user, willingness to pay, appreciation, positive attitude, and all that. However, if we put emotions aside, how can we really measure it? The IEEE says that quality is the degree to which a product meets its requirements or user expectations. But what is the formula? Can we say that it satisfies requirements and expectations to, say, 73%?

Alan Kay Was Wrong About Him Being Wrong

  • 524 words
  • 2 minutes to read
  • comments

From time to time someone asks me what I think about what Alan Kay, the father of OOP, the designer of Smalltalk, the first object-oriented language, said in 1998 about OOP. He literally said that the very term “object” was misleading and a more appropriate one would be “messaging.” Here is what I think.

DAO is Yet Another OOP Shame

  • 626 words
  • 3 minutes to read
  • comments

Someone asked me what I think about DAO and I realized that, even though I wrote about ORM, DTO, and getters, I haven’t had a chance yet to mention DAO. Here is my take on it: it’s as much of a shame as its friends—ORM, DTO, and getters. In a nutshell, a Data Access Object is an object that “provides an abstract interface to some type of database or other persistence mechanism.” The purpose is noble, but the implementation is terrible.

How Micro Is Your Tasking?

  • 2390 words
  • 13 minutes to read
  • comments

“What are you doing now?”—when you hear this question from your boss, be aware: you’re dealing with a micromanager. Keeping us busy is the key objective of these creatures and this is what makes them so annoying. To the contrary, effective managers make sure we are productive, meaning that our results satisfy their expectations. They are not interested in knowing what we are doing to deliver them—they manage the project, instead of managing us. And the first step to making the project manageable is to decompose its scope into smaller pieces.

В оппозиции к народу

  • 777 words
  • 4 minutes to read
  • comments

Меня недавно спросила одна знакомая, в оппозиции ли я к власти. Вопрос заставил меня задуматься, и очень скоро найденный ответ удивил мою собеседницу и немного меня самого. Я в оппозиции не к власти — я в оппозиции к своему народу. Не власть я вижу главным врагом, а наш собственный украинский народ. С ним я в непримиримой оппозиции. Его считаю виновником всех бед и его считаю необходимым срочно люстрировать.

Trust. Pay. Lose.

  • 486 words
  • 2 minutes to read
  • comments

“Listen up, dude,” a friend of mine said when he called yesterday, “I trusted them for over a year—we’ve been partners. They’ve been programming it all and I was busy doing business development. Now they’ve quit and I’m left with nothing! What am I supposed to do with all these JavaScript files? How do I even know they are mine? Moreover, they don’t even want to cooperate. I feel like a hostage. Please, help me out!” What could I say? “It’s too late, dude,” was my answer, “but the good news is—you are not the first to have this problem.”

Constructors or Static Factory Methods?

  • 2396 words
  • 13 minutes to read
  • comments

I believe Joshua Bloch said it first in his very good book Effective Java: static factory methods are the preferred way to instantiate objects compared with constructors. I disagree. Not only because I believe that static methods are pure evil, but mostly because in this particular case they pretend to be good and make us think that we have to love them.

Крым их!

  • 689 words
  • 3 minutes to read
  • comments

“Крым наш!” кричат с обеих сторон пропускного пункта “Чонгар” на границе между материковой Украиной и Крымом. Каждый имеет свои доводы, с которыми можно согласиться. Украина и ООН считают, что Крым был оккупирован, вопреки действующей Конституции Украины. Россия считает, что Крым лишь воспользовался своим правом на самоопределение, как и недавно Каталония. Кто прав? А так ли нам это важно? Какая нам разница, под властью Киева или Москвы находится полуостров?

Кнут и пряник для украинского языка

  • 1339 words
  • 7 minutes to read
  • comments

Я недавно высказался против насильственной украинизации и вытеснения русской культуры с территории Украины, чем вызвал массу негативных комментариев от читателей, большинство которых сводились к одному: “не нравится — уезжай”. И лишь немногие поинтересовались, к чему конкретно я призываю, в чем мой конструктив? Я рад, что все же нашлись те, кто сумел за критикой увидеть невысказанный призыв к реальным действиям. Сейчас я его выскажу.

Моя ли это страна?

  • 646 words
  • 3 minutes to read
  • comments

Пару дней назад один мой знакомый американец спросил меня, переживаю ли я за свою страну в связи с ее тяжелым положением. Он имел в виду и войну на Донбассе, и нынешнее экономическое состояние Украины, и все вместе взятое, как им это видится из-за океана. Я ответил, что своей эту страну не считаю, потому и переживать особо не за что. Он удивился. Патриотизм у американцев, видимо, в крови. У меня, видимо, нет. А должен быть?

Streams vs. Decorators

  • 1491 words
  • 8 minutes to read
  • comments

The Streams API was introduced in Java 8, together with lambda expressions, just a few years ago. I, as a disciplined Java adept, tried to use this new feature in a few of my projects, for example here and here. I didn’t really like it and went back to good old decorators. Moreover, I created Cactoos, a library of decorators, to replace Guava, which is not so good in so many places.

ThreeCopies.com—Server-Side Data Backup Service

  • 816 words
  • 4 minutes to read
  • comments

I have a number of data resources which exist in one place only and which I don’t really want to lose. For example, I have a hosted PHP website, and a MySQL database hosted at the same place. I also have a NoSQL database at Amazon DynamoDB, a PostgreSQL database at Heroku, and also… Well, there are many of them. How to back them up was always a question for me.

What Motivates Me as a Programmer

  • 1436 words
  • 7 minutes to read
  • comments

I wrote a number of sarcastic articles about management and motivation, where some traditional and very popular practices were criticized. Now I’ve decided to think it all over and summarize what actually motivates me as a programmer when I’m working for someone else. Let’s say you hire me tomorrow as a Java coder and ask “What do you want us to do for you so that you will be most productive?” This would be my wish list.

Yet Another Evil Suffix For Object Names: Client

  • 956 words
  • 5 minutes to read
  • comments

Some time ago we were talking about “-ER” suffixes in object and class names. We agreed that they were evil and must be avoided if we want our code to be truly object-oriented and our objects to be objects instead of collections of procedures. Now I’m ready to introduce a new evil suffix: Client.

ReHTTP.net—HTTP Repeater

  • 353 words
  • 1 minutes to read
  • comments
badge

I faced a problem a few weeks ago with 0pdd.com, one of my web apps that is supposed to receive HTTP requests (known as webhooks) from GitHub: sometimes the app is down, GitHub gets an HTTP error, and never sends the request again. The request simply gets lost. There is absolutely no way to receive it again once the app is back up. I realized that I needed a service mesh between GitHub and my web app, to accept HTTP requests and repeat them later if they can’t be delivered immediately.

XCOP—XML Style Checker

  • 327 words
  • 1 minutes to read
  • comments

One of the biggest advantages of XML versus many other data formats is that it is human-readable. Well, to some extent, you may say. Indeed, a badly formatted XML document may be rather difficult to digest. I’m not talking about XML validity now, but about its formatting style. Just like we format our Java/Ruby/Python nicely and then check their “prettiness” with static analyzers, we can also check our XML documents. Six years ago I asked the Stack Overflow community for such a tool, but unfortunately my question was down-voted and closed (you will need 10K+ reputation to see it). Last week I finally decided to create a tool myself and I called it xcop.

To Be Nice or Not to Be Nice?

  • 1019 words
  • 5 minutes to read
  • comments

I stumbled upon this two-year-old article Why It’s Safe for Founders to Be Nice, written by Paul Graham (a co-founder of Y Combinator), whom I honestly respect, and I decided to explain why I disagree. Not that I think we shouldn’t be nice. Not at all. But I do think that “being nice” is not a solution for organizational, management, marketing, sales, or business development problems. Moreover, in most cases it is actually not safe for founders to be nice.

Bitcoin Is Not a Pyramid. Coinbase Is.

  • 633 words
  • 3 minutes to read
  • comments

In September 2016 I paid Coinbase $1,222 for two BTCs, $611 each. Seven months later, in April 2017, they paid me back $2,490, which was $1,245 for each BTC. My profit before tax was $1,268, over 100% of the investment, in just seven months. Moreover, if I had waited until today, I would have made $6,800 profit instead. Actually, I still have a few BTCs in my Coinbase account and I can make that 750% profit, if I sell now. Should I? The BTC price is over $4,000. Will it go up? Or down? What would you do?

How to Manage a Manager?

  • 1129 words
  • 6 minutes to read
  • comments

No secret, we you all have managers. Some of them are great, while many are simply idiots. What do you do if you happen to have a boss that fits perfectly into this dominating category? Quit and try to find a better place? This may sound like good advice, but you know as well as I do that a new boss most likely won’t be any better. Don’t quit. Stay. Manage the manager. Most of them are manageable.

Саботажника Саакашвили геть!

  • 368 words
  • 2 minutes to read
  • comments

Бывший президент Грузии Михаил Саакашвили в феврале 2015-го стал советником Порошенко. Через три месяца из рук своего начальника он получил украинское гражданство и должность главы Одесской ОГА с зарплатой $280 в месяц. Еще через полгода его лишили грузинского гражданства. В течение следующего года Саакашвили сделал ряд громких обвинений в коррупции, в том числе в адрес Авакова, Яценюка, и самого Порошенко. В ноябре 2016 он заявил об отставке с Одесского поста, и Порошенко его уволил, избавившись одним махом и от советника. Вчера Саакшвили был лишен украинского гражданства.

My Favorite Websites

  • 828 words
  • 4 minutes to read
  • comments

I recently published a summary of the software and hardware I’m using every day. Now I’ll list my most favorite websites and online services, which help me do my daily job: write code and manage projects.

The Bigger Victim of Sexual Harassment

  • 757 words
  • 4 minutes to read
  • comments

You most probably are aware of the recent sexual harassment scandals in Silicon Valley, which led to serious career problems for Dave McClure (former CEO of 500 Startups), Travis Kalanick (former CEO of Uber), Chris Sacca, and a few others. Let’s try to put emotions aside and analyze what’s happening and what long-term consequences this panic may have for our male-dominated engineering environment.

Am I a Sexist?

  • 767 words
  • 4 minutes to read
  • comments

Recently I said a few words in my Telegram group about “women in tech,” which led to some negative reaction on Twitter. I believe I owe my readers an explanation. Some of them already got confused and came to me with the question: “If you’re so much against slavery, where is this male chauvinism coming from?” Let me explain what’s going on. Indeed I am a big fan of freedom, but recent hysteria around gender equality is not helping us to become more free. Instead it is causing quite the opposite effect.

Лагерные активисты

  • 728 words
  • 4 minutes to read
  • comments

В любом учреждении пенитенциарной системы — тюрьме или зоне — есть категория заключенных, сотрудничающих с администрацией. В начале прошлого века в советских лагерях системы ГУЛАГ их называли “активистами”. Они помогали администрации поддерживать порядок и дисциплину среди заключенных. Надо ли говорить, что во все времена арестанты относились к подобному “активу”, как минимум, с опаской, а, как максимум, резко враждебно.

My Work Environment

  • 962 words
  • 5 minutes to read
  • comments

I was asked in my Telegram Group which tools and hardware I use in my daily work. Here is the full list of what I have and even how much I paid for them. Maybe it will be helpful for someone.

DynamoDB + Rake + Maven + Rack::Test

  • 1054 words
  • 5 minutes to read
  • comments

In SixNines.io, one of my Ruby pet web apps, I’m using DynamoDB, a NoSQL cloud database by AWS. It works like a charm, but the problem is that it’s not so easy to create an integration test, to make sure my code works together with the “real” DynamoDB server and tables. Let me show you how it was solved. The code is open source and you can see it in the yegor256/sixnines GitHub repo.

Gluten-Free Management Recipes

  • 970 words
  • 5 minutes to read
  • comments

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.

Any Program Has an Unlimited Number of Bugs

  • 574 words
  • 3 minutes to read
  • comments

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.

Single Statement Unit Tests

  • 868 words
  • 4 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

  • 410 words
  • 2 minutes 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.

sixnines availability badge  GitHub stars