Streams vs. Decorators

  • 795 words
  • three 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.

Java 9: The Good, The Bad, and Private Interface Methods

  • 1079 words
  • four minutes to read
  • comments

Java 9 was released a few weeks ago. Check the release notes, they include many interesting features. However, I think that not everything is as good as Oracle and Java adepts seem to picture it. I see three trends in the Java world, which are good, bad, and ugly, respectively. Let's start with the good one.

ThreeCopies.com—Server-Side Data Backup Service

  • 613 words
  • three minutes to read
  • comments
badge

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

  • 1416 words
  • 6 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

  • 822 words
  • four 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

  • 321 words
  • two 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

  • 255 words
  • a minute 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 StackOverflow 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?

  • 1031 words
  • four 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 or 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.

  • 619 words
  • three 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?

RAII in Java

  • 489 words
  • two minutes to read
  • comments

Resource Acquisition Is Initialization (RAII) is a design idea introduced in C++ by Bjarne Stroustrup for exception-safe resource management. Thanks to garbage collection Java doesn't have this feature, but we can implement something similar, using try-with-resources.

How to Manage a Manager?

  • 1065 words
  • four 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.

My Favorite Websites

  • 642 words
  • three 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

  • 753 words
  • three 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.

How I Would Re-design equals()

  • 379 words
  • two minutes to read
  • comments

I want to rant a bit about Java design, in particular about the methods Object.equals() and Comparable.compareTo(). I've hated them for years, because, no matter how hard I try to like them, the code inside looks ugly. Now I know what exactly is wrong and how I would design this "object-to-object comparing" mechanism better.

Am I a Sexist?

  • 727 words
  • three 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.

My Work Environment

  • 736 words
  • three 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.

Object-Oriented Declarative Input/Output in Cactoos

  • 671 words
  • three minutes to read
  • comments
badge

Cactoos is a library of object-oriented Java primitives we started to work on just a few weeks ago. The intent was to propose a clean and more declarative alternative to JDK, Guava, Apache Commons, and others. Instead of calling static procedures we want to use objects, the way they are supposed to be used. Let's see how input/output works in a pure object-oriented fashion.

DynamoDB + Rake + Maven + Rack::Test

  • 748 words
  • three 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

  • 895 words
  • four 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.

Why Do You Contribute to Open Source?

  • 461 words
  • two minutes to read
  • comments

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!