<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marko Kruljac</title>
    <description>The latest articles on DEV Community by Marko Kruljac (@krukru).</description>
    <link>https://dev.to/krukru</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F342991%2F47c2dd0d-5372-43e6-9ec1-95b9d2465af3.jpeg</url>
      <title>DEV Community: Marko Kruljac</title>
      <link>https://dev.to/krukru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krukru"/>
    <language>en</language>
    <item>
      <title>The cost of abstraction</title>
      <dc:creator>Marko Kruljac</dc:creator>
      <pubDate>Tue, 15 Dec 2020 10:14:12 +0000</pubDate>
      <link>https://dev.to/krukru/the-cost-of-abstraction-4il7</link>
      <guid>https://dev.to/krukru/the-cost-of-abstraction-4il7</guid>
      <description>&lt;h6&gt;
  
  
  Credits to the image: &lt;a href="http://davewolanski.blogspot.com/2007/01/it-was-dark-and-rainyfoggy-night.html"&gt;Dave Wolanski&lt;/a&gt;
&lt;/h6&gt;

&lt;p&gt;Yesterday I was driving down the highway and it was very foggy. All along the highway, there were digital (variable) speed limit signs, which were showing a speed limit of 60km/h (instead of the default 130km/h) due to the bad road conditions.&lt;/p&gt;

&lt;p&gt;And I thought to myself, how cool. The constructor of the highway decoupled the actual speed limit from the sign, just for cases like this. Now they have the flexibility to dynamically adjust the limit, based on the road condition. That was a very smart design choice!&lt;/p&gt;

&lt;p&gt;The traditional solution would be to just place a metal sign, but this hardcodes the speed limit and cannot be easily changed (someone has to go to the sign, and place a new one in it's place, revert the change when conditions reset, etc.).&lt;/p&gt;

&lt;p&gt;Does this mean all signs everywhere should be digital? Probably not. A digital sign can easily cost two orders of magnitude more than just a metal plate sign. And not to speak of the operating and maintenance cost.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Every abstraction comes with its cost.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The point of my post is to show that the same applies to software architecture. It would be great to have "digital signs" everywhere, decouple all of the things and have infinite flexibility. As much as it would be great to have a new Tesla with full equipment and all features unlocked. But do you have the budget to pay for the cost?&lt;/p&gt;

&lt;p&gt;As much as we balance our budget when buying a new car, we as engineers should balance our budget for abstractions.&lt;/p&gt;

&lt;p&gt;Knowing when and where in your product to invest in abstraction, like the digital road signs, and where to just place a metal hardcoded one can mean the difference between success and failure.&lt;/p&gt;

&lt;p&gt;Where things need to change, invest in abstraction and layers. Where things are simple and static, go with the low cost solution. And if the simple thing starts getting complicated and changes frequently, THEN invest your budget in refactoring and abstraction. Your abstraction must provide more value than its cost, or else you are in trouble.&lt;/p&gt;

&lt;p&gt;I would really like to hear your thoughts on this. How do you approach complexity and abstraction? Do you consider the cost of these abstractions?&lt;/p&gt;

&lt;p&gt;Reading/listening material:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://news.ycombinator.com/item?id=19237592"&gt;https://news.ycombinator.com/item?id=19237592&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://sam-koblenski.blogspot.com/2014/07/the-cost-of-abstraction.html"&gt;http://sam-koblenski.blogspot.com/2014/07/the-cost-of-abstraction.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=rHIkrotSwcc&amp;amp;ab_channel=CppCon"&gt;https://www.youtube.com/watch?v=rHIkrotSwcc&amp;amp;ab_channel=CppCon&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
    </item>
    <item>
      <title>PHP session quirks</title>
      <dc:creator>Marko Kruljac</dc:creator>
      <pubDate>Mon, 16 Nov 2020 07:21:00 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/php-session-quirks-3da0</link>
      <guid>https://dev.to/bornfightcompany/php-session-quirks-3da0</guid>
      <description>&lt;p&gt;Hello there, fellow developer!&lt;/p&gt;

&lt;p&gt;Did you know that PHP Sessions are blocking on a single server instance, but vulnerable to race conditions bugs on multi-server architecture? &lt;/p&gt;

&lt;p&gt;Here are the important things you should know about how sessions work in PHP.&lt;/p&gt;

&lt;p&gt;First thing you should know is how sessions are stored.&lt;br&gt;
The default session save handler is called “files”, which just saves all the session data in a file. The file is conveniently named exactly like the value of the PHPSESSID, which is how the server knows where is your session data and if your session even exists on the server and how to retrieve the session data.&lt;/p&gt;

&lt;p&gt;Second thing you should know is that “files” session handler is blocking by design, and there is no way to disable this constraint on this session handler. What this means is that every time the server tries to open your session file, it locks the file (using &lt;a href="https://www.php.net/manual/en/function.flock.php"&gt;flock&lt;/a&gt;) which prevents any other processes from opening the file – until the lock has been lifted, which happens automatically after the PHP script/request has finished. This is actually a great technique to prevent race-conditions. You can imagine the following snippet of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_SESSION&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'received_payment'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;$_SESSION&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="n"&gt;received_payment&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;sendMoney&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running this code in parallel, and without locks could result in the sendMoney() being called multiple times! This is a race condition which is solved by locks. Remember, while PHP is single-threaded, you can achieve concurrency by running multiple processes in parallel, Apache or Nginx does this for you. The same trick is used by pm2 to parallelise node processes.&lt;/p&gt;

&lt;p&gt;So there is no problem, right? Wrooong 🙂&lt;/p&gt;

&lt;p&gt;The problem is that this pattern scales poorly with regards to the total time required to completely process all requests it received in parallel. The requests themselves are received in parallel, but due to the locking they are executed in sequence. This means that if you have 10 parallel ajax calls to process, and let say that each call takes 500ms to process, you will have to wait a total of 5 seconds until all the ajax requests have been resolved. Even worse is if the first call needs 4 seconds to complete, and the rest 9 call need 100ms each. You will still  end up waiting 5 seconds, but you will wait a full 4 seconds before seeing any results!&lt;br&gt;
There is a great &lt;a href="https://github.com/mattiasgeniar/demo-php-blocking-sessions"&gt;demo&lt;/a&gt; with which you can fiddle with. &lt;/p&gt;

&lt;p&gt;I also made my own experiment, here is with "slow" sessions &lt;a href="https://github.com/krukru/php-session-quirks/blob/master/example_1/screenshots/with-sharding/sharding.gif"&gt;https://github.com/krukru/php-session-quirks/blob/master/example_1/screenshots/with-sharding/sharding.gif&lt;/a&gt;&lt;br&gt;
And here is what happens when sessions get closed as soon as they are opened. &lt;a href="https://github.com/krukru/php-session-quirks/blob/master/example_0/screenshots/with-sharding-max-workers.png"&gt;https://github.com/krukru/php-session-quirks/blob/master/example_0/screenshots/with-sharding-max-workers.png&lt;/a&gt;&lt;br&gt;
There are also some other things to take into consideration, like the browser connection limit, and your web server concurrency settings - but these are beyond the scope of this post.&lt;/p&gt;

&lt;p&gt;So how to mitigate this issue?&lt;/p&gt;

&lt;p&gt;There are two viable solutions.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The first solution is to close the session as soon as you are finished with reading session data.&lt;/b&gt; Sessions are most often used just to determine if the user is logged or a guest. After that point the session is no longer needed (in most cases) and if you close the session early, you are allowing the next request to be processed concurrently.&lt;/p&gt;

&lt;p&gt;The second solution is to use the read-only session flag, when you will only be doing “read” operations from the session. Again a good example is checking if the user is a guest or logged in user. Here you are only reading from the session, not writing anything – this has the nice property that there is no possibility for race conditions (since data is not being changed) and there is no need for locks!&lt;br&gt;
This approach has its caveats. Read-only sessions are only supported from php 7, which is an  issue for frameworks who wish to support php 5 (looking at you &lt;a href="https://github.com/yiisoft/yii2/blob/master/framework/composer.json#L66"&gt;Yii2&lt;/a&gt;). Another issue is that major frameworks like Zend, Symfony are slow to support this, see &lt;a href="https://github.com/zendframework/zend-session/issues/39"&gt;https://github.com/zendframework/zend-session/issues/39&lt;/a&gt; and &lt;a href="https://github.com/symfony/symfony/issues/24875"&gt;https://github.com/symfony/symfony/issues/24875&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So your best bet is to just close-early and avoid sessions as much as possible 🙂&lt;/p&gt;

&lt;p&gt;Remember, this only applies to ajax calls from the same user (the same PHPSESSID) and only if the session is being used (session_start() called anywhere in the script lifecycle)!&lt;/p&gt;

&lt;p&gt;Ok, but what about multi-server architecture? Well, now you can no longer use “files” as your session handler, since a session could exist on one server instance, but not on another.&lt;/p&gt;

&lt;p&gt;How you approach this issue is by using some shared memory space to manage your sessions, redis and memcached being the strongest candidates for the job.&lt;/p&gt;

&lt;p&gt;Redis session handler does not support locks at all, and memcached has started supporting it with various degrees of success (there are bugs &lt;a href="https://github.com/php-memcached-dev/php-memcached/issues/310"&gt;https://github.com/php-memcached-dev/php-memcached/issues/310&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This means that you &lt;b&gt;cannot&lt;/b&gt; get that sweet sweet race-condition safety you get with “files” session handler. The trivial snippet with “received_payment” session gets very difficult to implement correctly.&lt;/p&gt;

&lt;p&gt;The solution for this case, is unfortunately to change your code logic and use either a database for locking or specifically some locking mechanism (like  &lt;a href="https://symfony.com/doc/current/components/lock.html"&gt;https://symfony.com/doc/current/components/lock.html&lt;/a&gt;), and again avoid sessions as much as possible.&lt;/p&gt;

&lt;p&gt;How do you approach session management? How do sessions work in a node backend environment? Please share your thought and experiences in the comments below! :) &lt;/p&gt;

&lt;p&gt;And happy developing!&lt;/p&gt;

&lt;p&gt;Links and resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original post that got me thinking about the issue &lt;a href="https://pasztor.at/blog/stop-using-php-sessions/"&gt;https://pasztor.at/blog/stop-using-php-sessions/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;My attempt at recreating the various experiments &lt;a href="https://github.com/krukru/php-session-quirks"&gt;https://github.com/krukru/php-session-quirks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>php</category>
      <category>performance</category>
      <category>engineeringmonday</category>
    </item>
    <item>
      <title>Is remote work bad for innovation?</title>
      <dc:creator>Marko Kruljac</dc:creator>
      <pubDate>Fri, 04 Sep 2020 08:58:41 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/is-remote-work-bad-for-innovation-25p5</link>
      <guid>https://dev.to/bornfightcompany/is-remote-work-bad-for-innovation-25p5</guid>
      <description>&lt;p&gt;The world’s largest work from home experiment has entered its midgame. So far, it was all about adapting quickly and making the best of it. Individual productivity has increased, there is no more commuting, which saves both time and money, work hours are flexible, and there are &lt;a href="https://www.statista.com/statistics/1110849/remote-work-advantages-during-covid-19-russia"&gt;other advantages&lt;/a&gt; as well. &lt;br&gt;
After all, this is what &lt;a href="https://chiefmartec.com/2020/08/bending-martecs-law-2020-taught-us-agile-thought/"&gt;agile&lt;/a&gt; taught us to do, embrace change and adapt quickly to it. &lt;br&gt;
We have won the earlygame, but now I ask question: “What did we lose in the process and are we prepared for the midgame?”&lt;/p&gt;

&lt;p&gt;There are many &lt;a href="https://www.statista.com/statistics/1110850/remote-work-disadvantages-during-covid-19-russia/"&gt;disadvantages&lt;/a&gt; to remote work, but I would like to focus on a big one, innovation, or creativity if you will.&lt;/p&gt;

&lt;p&gt;I have observed that thoughts and ideas, along with chitchat and casual smalltalk travel very difficulty across a remote medium, in contrast to the office environment where this happens naturally all the time.&lt;br&gt;
In a remote environment, you are usually not going to video-call your colleague just to tell him how you solved X or how Y happened and made you wonder about Z and so on. And texting just doesn’t cut it, we communicate so much non-verbally and explaining thoughts and ideas via text is just cumbersome and time-consuming.&lt;/p&gt;

&lt;p&gt;However, it is from this &lt;a href="https://www.ir.com/blog/communications/the-collision-of-ideas"&gt;collision of ideas&lt;/a&gt; that great innovation and progress is created. It is from these small, seemingly meaningless social interactions that creativity and innovation come from. It is from talking face-to-face to a colleague that you build a relationship and make a &lt;a href="https://hbr.org/2010/07/why-friends-matter-at-work-and"&gt;friend&lt;/a&gt;. Without these things, creativity and team’s cohesion is slowly being &lt;a href="https://hbr.org/2015/04/is-working-remotely-sapping-your-creativity"&gt;sapped away&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a great counter-example, let's look at the legendary Bell Labs, which fostered 9 Nobel Prizes and 4 Turing Award winners. Bell Labs is home to the transistor, UNIX and C among &lt;a href="http://blog.tmcnet.com/next-generation-communications/2011/08/the-top-bell-labs-innovations---part-i-the-game-changers.html"&gt;many many other innovations&lt;/a&gt;.&lt;br&gt;
When these people were asked what was so special about this building, the &lt;a href="https://www.youtube.com/watch?v=QFK6RG47bww&amp;amp;t=490"&gt;common answer&lt;/a&gt; was that it was an open environment packed with smart people who collaborated together and openly exchanged thoughts and ideas. (and had unlimited AT&amp;amp;T funding, which helps, but would not produce the innovations by itself).&lt;/p&gt;

&lt;p&gt;I would really like to hear about &lt;b&gt;your&lt;/b&gt; experiences, are you noticing the same things at your workplace? How are you addressing these issues? Let's discuss!&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>A post about delegation, responsibility and accountability</title>
      <dc:creator>Marko Kruljac</dc:creator>
      <pubDate>Mon, 31 Aug 2020 13:00:02 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/a-post-about-delegation-responsibility-and-accountability-7gd</link>
      <guid>https://dev.to/bornfightcompany/a-post-about-delegation-responsibility-and-accountability-7gd</guid>
      <description>&lt;h6&gt;
  
  
  Cover Photo by &lt;a href="https://unsplash.com/@robertwalsh0"&gt;rob walsh&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/4lfrwRyHRYk"&gt;Unsplash&lt;/a&gt;
&lt;/h6&gt;

&lt;p&gt;My sister recently started taking her driving lessons, and I thought that this is an excellent metaphor to explain the topics from the title of this post.&lt;/p&gt;

&lt;p&gt;How do driving lessons usually look like?&lt;br&gt;
In the first session, the driving instructor will give you a theoretic overview of the car, its parts and all the other important things you need to know before driving. After that, he will demonstrate this theory in practice. So far in the process, you only absorb and observe.&lt;/p&gt;

&lt;p&gt;But very soon after that, the student becomes the one driving the car on the streets. &lt;b&gt;The instructor delegates the driving responsibility to the student&lt;/b&gt;. The student is now responsible for following all rules and regulations and to safely drive the car.&lt;/p&gt;

&lt;p&gt;The instructor still shares the responsibility with you, as he has his own set of driving pedals in case anything goes really badly wrong, he can reach the wheel, he is watching the road with you, has special rearview-mirrors, etc.&lt;br&gt;
It is your responsibility to drive well, follow instructions, yet the instructor is accountable for your driving actions, in case of an accident.&lt;br&gt;
If you have an accident while driving, it is most likely because the instructor delegated too much responsibility too quickly. He is accountable for your failure.&lt;/p&gt;

&lt;p&gt;This is exactly how a healthy team is structured. You have a team leader or manager, who delegates and shares responsibility with his team members. The manager is, like the driving instructor, accountable if anything goes wrong. If a team member fails in their responsibilities, it is most likely because the manager either was not clear with his instructions, delegated too much, too difficult or it could be many many other reasons. If you fail, the manager is accountable for this, and must find a way for you to succeed.&lt;/p&gt;

&lt;p&gt;Responsibility is something to be shared, and delegated away. &lt;a href="https://medium.com/s/please-advise/as-a-leader-time-is-your-most-valuable-resource-133ae50ccba4"&gt;"Delegating is a gift with two recipients"&lt;/a&gt;. One person receives extra time to do other work, while the other person learns something new and interesting, and grows in the process.&lt;/p&gt;

&lt;p&gt;For example, you would never learn to drive a car, if you just watched your instructor do it flawlessly, if he never delegated the responsibility to you. Consequently, your team members cannot grow, if you have your hands on the wheel all the time.&lt;/p&gt;

&lt;p&gt;It is only when responsibility is delegated, that a person can grow. This is really important to remember.&lt;/p&gt;

&lt;p&gt;Delegating responsibility is the hardest thing in the world to learn and do well, but it is vital, both to the manager’s success and to the growth of members of the team. Be prepared to practice this a lot.&lt;/p&gt;

&lt;p&gt;Accountability, on the other hand, is not transferable. It is a burden the leader carries for the team.&lt;br&gt;
Giving praise for everything that goes well, and taking responsibility for everything that goes wrong – is the essence of leadership (as said by Dwight Eisenhower)&lt;/p&gt;

&lt;p&gt;If you want to learn more about management topics, there is an excellent series of podcasts which you can find &lt;a href="https://www.manager-tools.com/map-of-the-universe#286"&gt;here&lt;/a&gt;. They have been producing brilliant content for the last 15 years, and many thanks to them for that!&lt;/p&gt;

&lt;p&gt;As you become more and more senior, you will need to pick up on these skills. If you’re going for a engineering manager position, these skills will be your bread and butter, to the point that you will need to forget lots of coding skills. Be prepared to accept that.&lt;br&gt;
If you’re going down the technical senior/lead/architect track, don’t think that you are off the hook. Mastering these skills is still a very important tool in your road to success.&lt;/p&gt;

&lt;p&gt;Happy delegating, and keep on growing, both yourself and others.&lt;/p&gt;

</description>
      <category>career</category>
      <category>leadership</category>
      <category>management</category>
      <category>engineeringmonday</category>
    </item>
    <item>
      <title>Problem-solving and the dirty dishes principle of software development</title>
      <dc:creator>Marko Kruljac</dc:creator>
      <pubDate>Mon, 06 Jul 2020 08:22:40 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/problem-solving-and-the-dirty-dishes-principle-of-software-development-2go7</link>
      <guid>https://dev.to/bornfightcompany/problem-solving-and-the-dirty-dishes-principle-of-software-development-2go7</guid>
      <description>&lt;h1&gt;
  
  
  In this story, I would like to explore with you the cost of solving various tasks and problems.
&lt;/h1&gt;

&lt;p&gt;More specifically, let’s explore how the cost of solving a problem grows with respect to the size of the problem.&lt;/p&gt;

&lt;p&gt;Some types of problems have a linear cost function. This means that if a problem is doubled, the cost to solve it is also doubled.&lt;/p&gt;

&lt;p&gt;An example would be reading a book, or travelling — if it takes you one hour to read fifty pages of a book, then you can conclude that it would take you twice as long to read twice as many pages, or if it takes you one hour to travel a fixed distance, then it will take you twice as long to travel twice the distance (providing that you maintain the same average speed).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;However, there are many problems where the cost function is nonlinear. In practice, this means that as the problem increases in size, the solution cost becomes disproportionately higher.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dirty dishes principle?
&lt;/h3&gt;

&lt;p&gt;Take for example washing dishes. If all you need to wash is one dirty plate right after lunch, it’s no big deal. But as soon as you have a sink full of dirty plates laying around for weeks, the problem becomes much more difficult than simply cleaning every single plate individually (unless you are using a dishwasher, but that is cheating).&lt;/p&gt;

&lt;p&gt;All of a sudden, you have less free space in your sink, you need to be extra careful not to damage the rest of the dishes, you will probably need to do much more scrubbing and soaking as the dirt on the plates has hardened, and that in turn will require more soap, bacteria can form, etc, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal of cleaning dishes suddenly looks unachievable and the task is not fun for anyone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A bunch of new problems (which need to be solved, and now have a cost) emerged just by deferring and accumulating the problem and letting it increase in size. These problems did not exist when there was only one dirty plate. These problems would never have showed up had you washed every dish as soon as it became dirty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I call this the dirty dishes principle and it maps very well to software engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How does it transfer to software development?
&lt;/h3&gt;

&lt;p&gt;Take for example the &lt;a href="https://deepsource.io/blog/exponential-cost-of-fixing-bugs/"&gt;exponential cost of fixing bugs&lt;/a&gt;. If you detect a bug early on, as early as in the inception phase, the cost of fixing it is very low. The bug was not around for enough time to cause any real damage and you already know which part of the code needs fixing — the context is well known and understood, which all contributes to a quick and easy solution.&lt;/p&gt;

&lt;p&gt;But if you fail to find the bug, and time passes — the problem becomes harder and more costly to solve. Now all of a sudden, you need to invest time just to figure out what and why is wrong. The bug probably caused some issues with customers, which damaged the product image and will negatively impact future revenue. The original author of the bug is months gone in a different company, documentation is scarce, no one knows how the code works, and you need a hero to save the day.&lt;/p&gt;

&lt;p&gt;A bunch of new problems (which need to be solved, and now have a cost) emerged just by deferring and accumulating the problem and letting it increase in size. These problems did not exist when there was only one dirty &lt;del&gt;plate&lt;/del&gt; bug. These problems would never showed up had you &lt;del&gt;washed every dish&lt;/del&gt; fixed every bug as soon as possible.&lt;/p&gt;

&lt;p&gt;This is exactly what happened to the pile of dirty dishes, and the best part is that it could have easily been avoided by &lt;a href="https://www.bornfight.com/blog/how-qa-expenses-can-be-cheaper-than-having-no-qa-expenses/"&gt;investing in QA&lt;/a&gt; and in software development best practices. For example, by using a &lt;a href="https://dev.to/bornfightcompany/how-to-improve-your-code-quality-with-psalm-a-static-analysis-tool-419d"&gt;static analysis checker&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another infamous example that clearly explains this principle is the &lt;a href="https://medium.com/@matryer/broken-windows-theory-why-code-quality-and-simplistic-design-are-non-negotiable-e37f8ce23dab"&gt;Broken Windows Theory&lt;/a&gt;, which states that leaving small problems unattended will contribute to the overall situation becoming worse and thus more costly to solve. And this applies well to software engineering and highlights the importance of refactoring technical dept and maintaining a high quality bar.&lt;/p&gt;

&lt;h3&gt;
  
  
  The point is — handle problems on time…
&lt;/h3&gt;

&lt;p&gt;Software engineering is absolutely filled with these costly nonlinear problems. Be it code maintenance, system design, bug fixing, &lt;a href="https://dev.to/jainroe/the-ultimate-beginners-guide-to-analysis-of-algorithm-84h"&gt;algorithm analysis&lt;/a&gt; and many many others. That’s why it’s important to know which problems have a nonlinear solving cost, detect them early and address them &lt;a href="https://blog.noisli.com/what-it-means-to-eat-the-frog/"&gt;as soon as possible&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not let your problems accumulate, as the price of solving them could end up costing you more than the sum of its parts.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy dishwashing! 🙂&lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>career</category>
    </item>
  </channel>
</rss>
