Yegor Bugayenko's Blog
August 16, 2025
The End of Type Annotations
Type annotations are what make statically typed object-oriented languages like Java run faster and safer.Without annotations, every variable would effectively collapse to Object, forcing runtime casts.The code would work, but slower and with more runtime errors.Some type annotations may be inferred instead of being explicitly specified by a programmer.Not all though.In Java, for example, a number of hard-to-resolve challenges prevent us from inferring types of all objects.This is not a fun...
June 21, 2025
remove(42) vs. find(42).remove()
We have a list of books in the books object.How do we remove a single book from it, given that we know its ID?We can do books.removeById(42).Alternatively, we can find it with books.findById(42) and then call b.remove().Which option should we prefer, and why?The second choice is the better one.Not only because it���s more object-oriented, but also due to several practical advantages.
[image error]8 Femmes (2002) by Fran��ois OzonExtending the Deletion BehaviorWhat if we want to extend the deleti...
June 7, 2025
Write Unit Tests, Don���t Waste Our Money!
Automated tests help us write code faster.Unit tests immediately tell us when we break something.Integration tests calm us down, reducing the fear of shipping a failure to a user.But who are ���us���?Programmers.What about our employers?How do automated tests help them?Automated tests protect their investments.
[image error]La Femme Nikita (1990) by Luc BessonEvery change we make to a codebase costs our employer money.Whether they pay us monthly or per line of code, the bottom line is the same:...
May 30, 2025
Good Title ��� Good Bug Report
A few weeks ago, @horw released a new GitHub plugin that fixes GitHub issue titles: issue-title-ai.Once an issue is created, the plugin asks ChatGPT���or DeepSeek, or Claude���to improve its title.We���ve already integrated the plugin into objectionary/eo and a few other repositories.Works like a charm.What���s wrong with the titles the way they are, you may ask?Why do we need to ask ChatGPT to make them ���better���?Because we want every issue���either a bug report, a feature request, or ...
May 24, 2025
Stop Asking and Suggesting ��� Just Complain
Wikipedia says that Bug Driven Development (BDD) is an anti-pattern.Raja Shankar Kolluru perfectly explains why.However, Florian Rappl argues that it���s not.Ben Winding believes that it���s better than TDD.In simple words, BDD is kind of like trying to build a plane while it���s flying, based on passenger complaints.Nobody builds planes like that (well, maybe Boeing and Airbus).However, a software team that practices BDD might demonstrate higher productivity.
[image error]Ghost Dog (1999) by Jim Ja...Stop Asking and Suggesting���Just Complain
Wikipedia says that Bug Driven Development (BDD) is an anti-pattern.Raja Shankar Kolluru perfectly explains why.However, Florian Rappl argues that it���s not.Ben Winding believes that it���s better than TDD.In simple words, BDD is kind of like trying to build a plane while it���s flying, based on passenger complaints.Nobody builds planes like that (well, maybe Boeing and Airbus).However, a software team that practices BDD might demonstrate higher productivity.
[image error]Ghost Dog (1999) by Jim Ja...May 17, 2025
No BTW in Bug Reports
Every ticket���a bug report or a feature request���is a short-term contract.You, the reporter, hire them to make a fix or implement a feature.They, the team of developers, do it for you���provided you pay, or their motivation is intrinsic���for example, in open source.The discussion that happens along the way may help clarify the requirements of the contract.It may also help the team convince you that the bug doesn���t deserve a fix.Also, it may help them deliver the fix to you and convince...
April 23, 2025
Let the Bug Reporter Have the Last Word
Someone has submitted a bug report to your repository.You fix the bug.You close the bug report.Stop.This is wrong.You shouldn���t close it.Instead, you should ask the reporter to review your fix.Then, maybe, they will close the ticket.If they don���t, you make another fix, until they do.
[image error]Analyze This (1999) by Harold RamisAccording to Joel Spolsky, ``the only person who can close a bug is the person who opened it in the first place.������But, why?Why shouldn���t you close it, when...
April 18, 2025
We Don���t Merge into a Broken Master Branch
What do you think is the most typical reason for delays in pull request reviews?A study at Google confirms that it���s the size���the more changes, the slower the review.Another study shows that it���s the emotional tone���anger and dominance expressed in comments are linked to a lower likelihood of a pull request being merged.A more recent study finds that it���s the author���s reputation: we merge PRs faster if we know the author.All of the above is true.In our projects, though, what ofte...
April 11, 2025
Four Builds: A Balance Between Quality and Joy
How long should it take to know if your code is safe?Martin Fowler once said: 10 minutes.Ten years later, five hundred developers agreed.I disagree���with all of them.First, ten minutes is not enough for a proper build, even for a small software system.Second, ten minutes is too much for a build that we run from the IDE after every one-line edit.We need a finer-grained classification of builds: from bullet-fast to thorough and dead slow.
[image error]Trainspotting (1996) by Danny BoyleHow long sho...