Yegor Bugayenko's Blog, page 9
May 4, 2020
Open Source Arms Race
Some companies massively invest in open source software projects, while others still remain skeptical and stay away from this trend. What���s in it for those philanthropists, like Google, IBM or Microsoft? Why spend money on something that doesn���t belong to them and is shared among all of us developers? Don���t they understand that the code they write may be used by their competitors? It seems they do understand, but can���t do anything about it.
[image error]Filth (2013) by Jon S. BairdAs David...
March 2, 2020
Prefixed Naming
If you look at the source code of Takes or Cactoos for the first time, you most probably, like many others, will be triggered by the naming convention, which implies that most class names have two-letter prefixes: BkSafe, RqFake, RsWithStatus, TkGzip, and so on. To be honest, I havent seen a single Java developer who would be comfortable with this convention at first sight. I have, however, seen many who are in love with it now. This article is for those who are interested in moving from the...
February 18, 2020
Fat vs. Skinny Design
It seems that type/class hierarchies in OOP may be designed in two extreme ways: either with full encapsulation of data in mind; or with just a few interfaces making raw data visible, and letting classes deal with it, parse it, and turn it into smaller data elements. You may be surprised, but Im suggesting the second option is more elegant. It seems to me that we dont lose object orientation, but rather gain a lot of flexibility, reusability, testability, and so on.
[image error]Owning Mahowny (2003) by...February 10, 2020
Object Cohesion: Why It Matters
You most probably know about Elegant Objects (EO), an alternative object-oriented paradigm, which claims that objects must be immutable, have no static methods, never use NULL in their code, use no annotations, and so on. We, the EO adepts, claim many things, but not so many people believe us. Those non-believers say that we are trolls, at best. Their main argument is: everybody works differently, why should we listen to you? I have no answer for them well I had no answer, until I created ...
January 14, 2020
One Question You Should Never Ask Your Boss
There are good and bad soldiers in any team. The job of a manager is to understand which is which. Then to promote the good ones and discharge the bad ones. There is one simple indicator I use to make this segregation. Its a simple question I either hear from my people or dont. Those who ask it are the bad soldiers. Their attitude and their behavior require immediate corrective actions. Some of them are curable, while others are not. This question tells me everything, if its being asked. I...
January 6, 2020
Embrace the Chaos!
Being just yet another software developer in a large enterprise is a pain. You are surrounded by legacy code, inconsistent architecture, low quality standards (assuming they even exist), lack of coding discipline, broken or dirty unit tests, mediocre programmers, and so on. On top of that, the management is very chaotic: no strict plans, no task management, no objective metrics, no quality control, and no light at the end of the tunnel. You feel like a cog in the machine: arrive at nine,...
December 30, 2019
Talented Programmers, Who Are They?
Im not talking about those who are famous, well-paid, or the authors of big and popular products. They are not necessarily talented, even though their results are outstanding. Talent is something some of us have as Gods gift. Very few of us otherwise it would not be called a talent. We all know what talent looks like in music, sport, poetry, or the art of acting. We can tell right off the bat whos got it and who is faking it, no matter how hard they try. Can we do the same after a short...
December 23, 2019
Altruism Kills!
Altruism means selflessly giving others more than you take back, while egoism means selfishly taking more than you return. Modern theories of management and social life tell us that altruism means prosperity for the society and success to the project. In my book Code Ahead I claim the opposite: altruism hurts the society and kills projects. I truly believe that any group activity eventually collapses if it encourages altruistic behavior among its members, be it a project, a company, or a...
December 2, 2019
Does Code Review Involve Testing?
When you review a pull/merge request from someone, do you check out the branch and run the build? I usually dont, but some people do. Their obvious reason is: running a build, or even testing the product manually, helps find more important errors. Just looking at the source code may not reveal all visual defects recently introduced to the HTML/CSS, for example. Its better to check out the branch, start Apache, open the site in Chrome, and see whats broken. Then, make a screenshot, attach it...
November 18, 2019
How Much Cohesion Is Enough?
Which one is better: books.del(42) or books.book(42).del()? I do both and I rarely can tell which one is better. The first option is shorter, while the second one is more object-oriented. The first option is more difficult to extend, while the second one is more verbose and requires more lines of code, which means a higher chance of making mistakes. Which one do you prefer?
[image error]Irr��versible (2002) by Gaspar No��Either one will work, of course, but the question is which design is more object-oriented? It seems to depend on the size of the...


