Do You Test Ruby Code for Thread Safety?

  • 1098 words
  • 6 minutes to read
  • comments

Are you a Ruby developer? If you are, I’m pretty sure you have a very vague idea of what concurrency and thread safety are. No offense, but this is what I’ve figured out after dealing with Ruby code and speaking with Ruby programmers over the last half a year. I’ve been writing in Ruby pretty actively recently and I do like the language and the ecosystem around it. Zold, the experimental cryptocurrency we are creating, is written almost entirely in Ruby. What does that tell you? I like Ruby. But when it comes to concurrency, there are blank spots. Big time.

Mailanes.com Helps Manage Newsletters and Mailing Lists

  • 763 words
  • 4 minutes to read
  • comments

There are other products doing something similar, including MailChimp, AWeber, and many others. They are great. Maybe. I don’t really know. I tried some of them, some time ago. And I was frustrated. They are expensive, clumsy, and heavy. That’s my experience. I wanted something lightweight, where I can upload a list of emails, create a simple HTML/text letter, configure my SMTP outbound server, and call it a day. I spent a few days and created Mailanes. It’s free (for all of you), it’s simple, and it’s open source.

Don't Make Me Guess

  • 818 words
  • 4 minutes to read
  • comments

It’s Sunday. I’m at home, drinking tea and writing a new document for one of our future investors. One of my contacts in Telegram all of a sudden shoots me a message. I haven’t talked to this guy for at least two months. He is a software developer. I know him because he works at Zerocracy. His name is Paul.

You Think You Can Control Us?

  • 759 words
  • 4 minutes to read
  • comments

I was explaining how Zerocracy works to one of our prospective clients yesterday. He texted me today: “[At Zerocracy] there is no commitment and anybody is free to leave any time, so the risk of entrusting a highly important project to such a platform and failing to deliver it on time is very high. We will develop it on our own with hired developers who will have salaries, and I’ll be architect and project manager, that way it will be under our entire control.” I think this word “control” he used deserves a comment.

Ветер истории

  • 543 words
  • 3 minutes to read
  • comments

Иосиф Сталин, по словам Александра Голованова однажды сказал: “Я знаю, что, когда меня не будет, не один ушат грязи будет вылит на мою голову. Но я уверен, что ветер истории всё это развеет.” Ветер истории — это мы с вами. А ушат грязи — это наши родители. Так он видел будущее из тяжелого 1943 года. Однако, случилось все наоборот: грязи у нас оказалось значительно больше, чем он ожидал от своих ближайших последователей, а ветра истории пока не слышно.

Remote Work Boosts Productivity Only If Done Right

  • 277 words
  • 1 minutes to read
  • comments

Referring to the latest news, we know that nowadays people prefer to work distantly and we also know that this is productive, according to a Stanford study that shows the astonishing productivity boost of working from home. Simon Slade in his recent post says: “Creating a positive work environment that responds to millennial desires will ensure that your business becomes a coveted place to work and hires only the best.”

Fear of Decoupling

  • 1227 words
  • 6 minutes to read
  • comments

Objects talk to each other via their methods. In mainstream programming languages, like Java or C#, an object may have a unique set of methods together with some methods it is forced to have because it implements certain types, also known as interfaces. My experience of speaking with many programmers tells me that most of us are pretty scared of objects that implement too many interface methods. We don’t want to deal with them since they are polymorphic and, because of that, unreliable. It’s a fair fear. Let’s try to analyze where it comes from.

Code Must Be Clean. And Clear.

  • 599 words
  • 3 minutes to read
  • comments

There is a famous book by Robert Martin called Clean Code. The title is an obvious call to all of us: the code must be clean. Clean, like a kitchen, I suppose—there are no dirty dishes, no garbage on the floor, no smelly towels. Dirt to be cleaned in a code base, according to Martin, includes large methods, non-descriptive variable names, tight coupling, lack of SOLID and SRP compliance, and many other things. Read the book, it’s worth it. However, there is yet another aspect of source code. How clear is it?

How Long It Takes to Close

  • 760 words
  • 4 minutes to read
  • comments

Our Policy expects our developers to be fast. Section §36 pays for quicker delivery and §8 penalizes slow movers by removing them if they don’t close in ten days (at the time of writing). Why even ten days, if our tasks are so small? And how long does it really take to close an average task? Can we do something to close them sooner?

Monolithic Repos Are Evil

  • 2093 words
  • 11 minutes to read
  • comments

We all keep our code in Git version control repositories. The question is whether we should create a new repository for each new module or try to keep as much as possible in a single so called “monolithic” repo (or simply monorepo). Market leaders, like Facebook and Google, advocate the second approach. I believe they are wrong.

Soft Skills Demystified

  • 1020 words
  • 5 minutes to read
  • comments

There are tech skills and there are soft skills. Every programmer knows that. Tech skills are about algorithms, operators, classes, objects, and everything else they teach us in tech schools. Soft skills are about something else. What exactly? Difficult to say. Let’s try to clear the air.

Why Refusal Is Penalized?

  • 386 words
  • 2 minutes to read
  • comments

We at Zerocracy, as you know, are strong advocates of freedom and the “No Obligations” principle. You, as a developer, are supposed to work only when you feel like it. If you don’t like the task assigned to you, you simply refuse it. No strings attached. However, Zerocrat will penalize you for such a refusal with a few negative reputation points, according to the §6 of the Policy. Why so? Here is the logic explained.

Builders and Manipulators

  • 1078 words
  • 5 minutes to read
  • comments

Here is a simple principle for naming methods in OOP, which I’m trying to follow in my code: it’s a verb if it manipulates, it’s a noun if it builds. That’s it. Nothing in between. Methods like saveFile() or getTitle() don’t fit and must be renamed and refactored. Moreover, methods that “manipulate” must always return void, for example print() or save(). Let me explain.

70/70

  • 937 words
  • 5 minutes to read
  • comments

A few days ago, a friend of mine asked me to join him in a new startup. He said that he needed a partner, to help him partially finance the project, promote it, bring in new ideas, and push the business forward. I liked the business idea and wanted to participate. I started to ask questions about our future partnership and attempted to draw a simple partnership agreement. He quickly got offended. He said that he was looking for a real partner, who would share his goals and would never require any papers or lawyers.

Either Bugs or Pull Requests ... or You Are Out

  • 299 words
  • 1 minutes to read
  • comments

Here is how it goes, over and over again. I find a new developer for one of my projects managed by Zerocracy. He claims to be an expert with 10 years of hands-on coding experience, $60 hourly rate (we don’t hire US guys), and fluent English. Then he joins the project and attempts to close a few tickets. But he hardly can. For many reasons. Then he comes back and explains why our microtasking methodology doesn’t work, trying to convince me that I have to pay him per hour, instead of per result. Here is my answer.

What's Wrong With Global Variables?

  • 618 words
  • 3 minutes to read
  • comments

Only lazy people haven’t written already about how global variables are evil. It started in 1973 when W. Wulf et al. claimed that “the non-local variable is a major contributing factor in programs which are difficult to understand.” Since then, many other reasons where suggested to convince programmers to stop using global variables. I think I read them all, but didn’t find the one that bothers me most of all: composability. In a nutshell, global variables make code difficult or impossible to compose in ways which are different from what its original author expected.

Are You an Architect?

  • 1951 words
  • 10 minutes to read
  • comments

Over twenty five years ago, in 1992, at an OOPSLA workshop in Vancouver, Kent Beck, in answer to the question “What is an architect?” said, according to Philippe Kruchten, that it is “a new pompous title that programmers demand to have on their business cards to justify their sumptuous emoluments.” Not much has changed since then. There is a big difference between a smart programmer and a project architect. Here is a list of traits that, I believe, a good architect has.

Simplified GitHub Login for a Ruby Web App

  • 688 words
  • 3 minutes to read
  • comments

You know what OAuth login is, right? It’s when your users click “login” and get redirected to Facebook, Twitter, Google, or some other website which then identifies them. Then they go back to your website and you know who they are. It’s very convenient for them. It’s convenient for you too, since you don’t need to implement the login functionality and don’t need to keep their credentials in a database. I created a simple Ruby gem to simplify this operation for GitHub only. Here is how it works.

Object Validation: to Defer or Not?

  • 872 words
  • 4 minutes to read
  • comments

I said earlier that constructors must be code-free and do nothing aside from attribute initialization. Since then, the most frequently asked question is: What about validation of arguments? If they are “broken,” what is the point of creating an object in an “invalid” state? Such an object will fail later, at an unexpected moment. Isn’t it better to throw an exception at the very moment of instantiation? To fail fast, so to speak? Here is what I think.

One More Recipe Against NULL

  • 378 words
  • 2 minutes to read
  • comments

You know what NULL is, right? It’s evil. In OOP, your method can return NULL, it can accept NULL as an argument, your object can encapsulate it as an attribute, or you can assign it to a variable. All four scenarios are bad for the maintainability of your code—there are no doubts about that. The question is what to do instead. Let’s discuss the “return it” part and I will suggest one more “best practice” on top of what was discussed a few years ago.

An Open Code Base Is Not Yet an Open Source Project

  • 1702 words
  • 9 minutes to read
  • comments

A few weeks ago someone suggested I should try to integrate IntelliJ IDEA’s static analysis rules into Qulice, our aggregator of Checkstyle, PMD, FindBugs, and some other analyzers. I do love IDEA’s rules—some of them are unique and very useful. I asked whether I could find them somewhere in Maven Central (they are written in Java) and the answer was “You’ll have to figure out yourself how to use them, but they are open source.” Here comes my opinion about this situation: I believe that open source doesn’t just mean the code is readable without authorization. It means something much bigger.

The Right Way to Report a Bug

  • 653 words
  • 3 minutes to read
  • comments

You know, at Zerocracy, either you are a programmer or a tester, and we pay for each bug you find and report. Well, not quite. We pay for each bug report a project architect considers good enough to pay for. The architect’s decision is totally subjective and non-disputable, according to §29 of the Policy. Some of our developers find this unfair and ask me to explain how they can report bugs such that they are definitely paid. Here is a non-exhaustive list of my recommendations.

How to Be Lazy and Stay Calm

  • 1184 words
  • 6 minutes to read
  • comments

What frustrates me most in my profession of software development is the regular necessity to understand large problem scopes before fixing small bugs, especially if the code is legacy and not mine. Actually, it’s even more frustrating when the code is mine. The “deep thinking,” as they call it, which is always required before even a small issue can be resolved, seriously turns me away from programming. Or did turn me away. Until I started to think differently and encourage myself to be lazy. Here is how.

Nine Steps of Learning by Refactoring

  • 1481 words
  • 8 minutes to read
  • comments

I was asked on Twitter recently how is it possible to refactor if one doesn’t understand how the code works. I replied that it is “learning by refactoring.” Then I tried to Google it and found nothing. I was surprised. To me refactoring seems to be the most effective and obvious way to study the source code. Here is how I usually do it, in nine object-oriented steps.

Fully Transparent Donations via Zerocracy

  • 506 words
  • 2 minutes to read
  • comments

Open source is free, as in beer: you write code, nobody pays you. Of course, there are many ways to monetize your efforts, but there will be no direct cash payments from your users, usually. There are ways to collect money, which include an obvious “tip jar” button on your GitHub project page. The chances anyone will pay are low though. In my opinion, this is mostly because nobody trusts you enough—they are not sure you will use the money to make the product better. Most likely you will just spend it and nothing will change. But they want the product, not to make you happier. At least that’s what I feel when I see a Patreon button.

How I Test My Java Classes for Thread-Safety

  • 1738 words
  • 9 minutes to read
  • comments

I touched on this problem in one of my recent webinars, now it’s time to explain it in writing. Thread-safety is an important quality of classes in languages/platforms like Java, where we frequently share objects between threads. The issues caused by lack of thread-safety are very difficult to debug, since they are sporadic and almost impossible to reproduce on purpose. How do you test your objects to make sure they are thread-safe? Here is how I’m doing it.

Почему именно газ?

  • 428 words
  • 2 minutes to read
  • comments

Несколько недель назад в Лондоне был отравлен Сергей Скрипаль, его дочь, несколько полицейских и несколько десятков случайных прохожих. По информации британского премьер-министра Терезы Мэй отравлены они были газом “Новичок”, который мог быть произведен только в России. За этим последовали дипломатические санкции. Куда далее может завести этот конфликт, сейчас сложно прогнозировать. Интересно другое — что на самом деле произошло, и какой был план?

Zerocracy: A Project Manager That Never Sleeps

  • 943 words
  • 5 minutes to read
  • comments

I’ve been in the software business for almost 30 years. I wrote my first piece of code when I was 12. Since then I have been programming and managing other programmers, hiring and firing them, planning projects and their budgets, finding and losing customers, investing into software teams and losing my investments, even teaching others how to manage software projects. What is my overall impression? It’s a pain. I think I’ve found a solution though.

Что сделал Путин, чтобы завтра победить

  • 1096 words
  • 6 minutes to read
  • comments

Завтра в России выборы президента, на которых победит Владимир Путин. Это будет его четвертый президентский срок. Фактически он находится у власти уже 18 лет, начиная с момента ее захвата передачи в январе 2000 года. Почти 150 миллионов человек в территориально самой большой стране мира завтра в очередной раз выдадут этому человеку мандат на управление их судьбой. Трудно не согласиться, что это заслуживающий уважения результат. Как он это делает?

Don't Aim for Quality, Aim for Speed

  • 751 words
  • 4 minutes to read
  • comments

I decided to write this blog post after reviewing this pull request. What happened there? The author of the PR wasn’t able to figure out the “right” way to implement it, and the code reviewer was waiting and waiting. Eventually, the reviewer came to me, since I was an architect, and complained that it was taking too long and he wasn’t able to earn his money for the review he had done. Then the author of the changes explained that he couldn’t finish since there were impediments and design inconsistencies; he also couldn’t earn the money he deserved for fixing the issue. What did I say? I said: Forget the quality, just finish it any way possible.

sixnines availability badge  GitHub stars