Yegor Bugayenko's Blog, page 18
September 11, 2017
Yet Another Evil Suffix For Object Names: Client
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.
Let me give an example first. This is what an object with such a suffix may look like (it's a pseudo-code version of the AmazonS3Client from AWS Java SDK):
class AmazonS3Client { c...September 4, 2017
ReHTTP.net���HTTP Repeater
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.
...August 28, 2017
XCOP ��� XML Style Checker
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 t...
August 21, 2017
To Be Nice or Not to Be Nice?
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.
[image error]Scarecrow (1973)...August 14, 2017
Bitcoin Is Not a Pyramid. Coinbase��Is.
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 w...
Bitcoin Is Not a Pyramid. Coinbase Is.
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 w...
August 7, 2017
RAII in Java
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.
[image error]At Sachem Farm (1998) by John HuddlesThe problem RAII is solving is obvious; have a look at this code (I'm sure you know what Semaphore is and how it works in Java):
class Foo { private Semaphore sem = new Semaphore(5);...July 31, 2017
How to Manage a Manager?
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.
[image error]The Intouchables (2011) by Olivier NakacheFirst of all, remember your goal: do nothing...
July 24, 2017
My Favorite Websites
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.
[image error] [image error] [image error]
Gmail is the best email system. It aggregates all my accounts in one place: all emails are coming to the @gmail.com address and I have a few aliases for sending responses. Google Calendar helps me keep my plans in sync, and Google Drive helps me share documents with friends somet...
July 17, 2017
The Bigger Victim of Sexual Harassment
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.
[image error]Twentynine Palms (2003) by Bruno DumontWe will never know what really happened betwee...