Yegor Bugayenko's Blog, page 17
November 27, 2017
How Micro Is Your Tasking?
"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...
November 20, 2017
Trust. Pay. Lose.
"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'...
November 13, 2017
Constructors or Static Factory Methods?
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.
[image error]Extract (2009) by Mike JudgeLet's analyze the reasoning and see why it's wrong, from an object-oriented point of view....
November 6, 2017
Five Features to Make Java Even Better
I stumbled upon this proposal by Brian Goetz for data classes in Java, and immediately realized that I too have a few ideas about how to make Java better as a language. I actually have many of them, but this is a short list of the five most important.
[image error]Idiocracy (2006) by Mike JudgeGlobal Variables. There are Singletons in Java, which, as we all know, are nothing but global variables. Wouldn't it be great to enable global variables in Java and get rid of Singletons. PHP, JavaScript, Ruby...
October 23, 2017
Software Quality Award, 2018
This is the forth 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, 2017.
Fill THIS FORM to submit.
Rules:
One person can submit only one project.
Submissions are accepted until September 1, 2018.
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 will be published o...
October 16, 2017
Lazy Loading and Caching via Sticky Cactoos Primitives
You obviously know what lazy loading is, right? And you no doubt know about caching. To my knowledge, there is no elegant way in Java to implement either of them. Here is what I found out for myself with the help of Cactoos primitives.
[image error]Reality (2012) by Matteo GarroneLet's say we need an object that will encrypt some text. Speaking in a more object-oriented way, it will encapsulate the text and become its encrypted form. Here is how we will use it (let's create tests first):
interfa...October 9, 2017
Streams vs. Decorators
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.
[image error]La Haine (1995) by Mathieu KassovitzHere is a primitive example. Let's say we have a collection...
October 2, 2017
Java 9: The Good, The Bad, and Private Interface Methods
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.
[image error]Birdman (2014) by Alejandro G. I����rritu The PlatformThe first trend is an obvious improvement of the platform that compiles Java, packages JARs, and runs the bytecode. It definite...
September 25, 2017
ThreeCopies.com���Server-Side Data Backup Service

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.
[image error]The most straightforward way is to rent a cheap $15/mo server (or use an existing one) and configure Cron to run a custom ba...
September 18, 2017
What Motivates Me as a Programmer
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.
[image error]300 (2006) by Zack SnyderThe list is in no parti...