<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ihor Pidruchny on Medium]]></title>
        <description><![CDATA[Stories by Ihor Pidruchny on Medium]]></description>
        <link>https://medium.com/@ihorpidruchny?source=rss-3e84d08f6f7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dwD0R9q7TeYRNxs-Y29A1g.jpeg</url>
            <title>Stories by Ihor Pidruchny on Medium</title>
            <link>https://medium.com/@ihorpidruchny?source=rss-3e84d08f6f7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 02:36:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ihorpidruchny/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What a startup CEO can do with the bad code?]]></title>
            <link>https://medium.com/@ihorpidruchny/what-a-startup-ceo-can-do-with-the-bad-code-31fe30839c1a?source=rss-3e84d08f6f7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/31fe30839c1a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Ihor Pidruchny]]></dc:creator>
            <pubDate>Thu, 05 May 2016 17:26:37 GMT</pubDate>
            <atom:updated>2016-05-05T17:28:53.759Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I have written this post for CEOs in the early stage of technology startups.</em></p><p><em>Whether you have a CTO or you don’t have one, this article is for you if you want to obtain more control over technology. Since technology is clearly the core of a technology startup :)</em></p><p>Yet another client came to our <a href="http://letzgro.net/">technology consultancy</a> division to fix their bad codebase.</p><p>Written by several teams in the past, with different code styles and approaches, or rather lack of an approach towards architecture and scalability, her code was total crap, and we were very straightforward about it.</p><p>She didn’t have her CTO, and she came to us relying not only on execution of her technology business but also for acting as a strategic advisor on technology. To be her external CTO in a way.</p><h3>Definition of a bad code</h3><p>Bad code like this is not a problem. Say you’ve got a product that does what it’s supposed to do, and you don’t need to touch or modify it. Great! Just don’t touch it.</p><p>Bad code only worries us if:</p><ol><li>The code is supposed to be touched now or in the future.</li><li>Its quality creates bugs in the product, and thus you have to touch the code to fix bugs.</li></ol><p>It is impossible to talk about the matter without introducing the notion of technical debt.</p><h3>Technical Debt</h3><p>Wikipedia article defines it this way:</p><blockquote><strong>Technical debt</strong> (also known as <strong>design debt</strong><a href="https://en.wikipedia.org/wiki/Technical_debt#cite_note-Girish_2014-1">[1]</a> or <strong>code debt</strong>) is a metaphor referring to the eventual consequences of any system design, <a href="https://en.wikipedia.org/wiki/Software_architecture">software architecture</a> or <a href="https://en.wikipedia.org/wiki/Software_development">software development</a> within a <a href="https://en.wikipedia.org/wiki/Codebase">codebase</a>. The debt can be thought of as work that needs to be done before a particular job can be considered complete or proper. If the debt is not repaid, then it will keep on accumulating interest, making it hard to implement changes later on. Unaddressed technical debt increases <a href="https://en.wikipedia.org/wiki/Software_entropy">software entropy</a>. Also known as a feature gap.</blockquote><p>The topic is quite versatile. For example Uncle Bob <a href="https://sites.google.com/site/unclebobconsultingllc/a-mess-is-not-a-technical-debt">separates</a> notions of tech debt and code mess.</p><p>I tend to agree with Martin Fowler though who basically merges major categories of flaws into a notion of technical debt, and <a href="http://martinfowler.com/bliki/TechnicalDebtQuadrant.html">introduces a quadrant</a> based on two dichotomies: reckless vs. prudent and deliberate vs. inadvertent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*nuJA9F7QOTmYGSMkGbswiA.png" /><figcaption>Technical Debt Quadrant by <a href="http://martinfowler.com/">Martin Fowler</a></figcaption></figure><p>Thus, technical debt can’t be entirely under our mind’s control because some of it happens due to ignorance, and some of it can be actually defined as a debt only from a future perspective.</p><h3>How you determine if the code is bad?</h3><ol><li><strong>Your developers keep telling you something.</strong> The easiest way to determine if your code is bad is to really listen to what your developers are trying to tell you. It is the usual way of things that their voice is very much muted under the pressures of new milestones with hard deadlines.</li><li><strong>Your developers are silent.</strong> Well, it’s also a bad sign if your developers haven’t mentioned anything like refactoring, code review, technical debt etc.</li><li><strong>New features take more and more time.</strong> I’ve seen dozens and dozens of tech startups run into a situation where their code is just so bad that any additional feature development takes enormous amounts of time and leads to regression bugs which killed their user’s experience and made their produce impossible to use.</li><li><strong>Slow run time.</strong> Your app runs slow and getting a more powerful server doesn’t help much.</li></ol><h3>Examples of really bad code</h3><p>Forgive me for being too extreme, but bad code usually comes from outsourcing companies located in the developing and not yet developed economies.</p><p>Oftentimes you don’t know what you are buying, and while you think you got a great deal with low hourly rates, you end up paying more of your money and with more of your time. I’ve been on both sides of the table and I’ll write a separate crushing article about it later.</p><p>Some examples I’ve seen (PHP)…</p><ol><li>Some database table names with upper case letters and some with lower case. Worked well on someone’s Windows driven computer, but apparently failed to work on any POSIX system.</li><li>All web app MVC controllers are gathered in a single file. Long controller methods with no separation of code into auxiliary methods or helpers.</li><li>A mix of HTML and back-end code with nearly no OOP.</li><li>No use of code version control systems. It’s scary to realize this still happens nowadays!</li><li>Task tracking in a spreadsheet with no collaborative project management software.</li></ol><h3><strong>How could you have preserved code from becoming bad?</strong></h3><p>Key suggestions one can take into account to avoid bad code are:</p><ol><li><strong>Documentation.</strong> Documenting your process helps you think through all the details of the system, as well as identify the repeating parts of the system and its patterns, find meta-patterns and conceptualize better a project architecture that is abstract enough to still maintain good extensibility. Think roadmaps, sets of job stories, information architecture documents, technical architecture documents, technical specs, brand books and style guides, code guides, test cases documentation, release notes templates and many more.</li><li><strong>Seniority on the project.</strong> You need to have enough senior developers on the project. They should use technologies they are familiar with. Having a senior developer who had a great experience with JavaScript and reactJS, but that now decides to use angular means they have a learning curve to go through and this creates a risk for wrong architecture which you cannot let happen.</li><li><strong>Discovery and engagement sessions.</strong> No matter how good your documentation is — developers have to read it carefully. It is best of all to discuss documents with you and make sure they understand every bit of it. Oftentimes, developers are able to come up with suggestions that will save you weeks or months of efforts. It might not have happened if project documentation was not thoroughly discussed. In the context of the topic discussed, you ensure developers won’t miss important details, which could lead to the wrong architecture set in place.</li><li><strong>Peer code reviews.</strong> Employ pull requests for your team members to review each other’s code before it gets to master branch on version control system.</li><li><strong>External code reviews</strong>. It’s not uncommon to use external code reviewers to run through your code regularly and point out places worth attention and improvement. We found it relatively easy to reach out and gather world class experts in multiple technologies and involve them in our clients’ projects for a one time or regular code check.</li><li><strong>Time for ongoing refactoring.</strong> We suggest you let your developers spend 10% of their time for refactoring and code cleanup. Practically what this will mean is that they spend every second Friday solely on improving the existing code — not on developing new features.</li><li><strong>Automated tests.</strong> When you start the project, you will most probably think yourself or hear from your peers: “Screw it, we don’t have time for automated tests. We are going to be agile and change our functionality multiple times, so it makes no sense to write the tests”. And that’s fine until one day you turn back and realize, or someone else tells you, that actually you ought to cover your functionality with tests. I personally prefer to have the tests rather than not. However, limitations that force people not to introduce testing are understandable like limited time, your budget, and your knowledge.</li><li><strong>Continuous Integration Frameworks.</strong> Overall it is suggested to use CI frameworks, Jenkins for example, with all kinds of modules plugged in to check code compliance, tests coverage, documentation, etc.</li><li><strong>Keep your systems modular.</strong> You’ll try to separate functionality into modules, or services, that act more independently and communicate to each other through rather lean APIs.</li></ol><p>If we wanted to go deeper, I can refer to quite an extensive list of factors of technical debt on Wikipedia:</p><blockquote>Common causes of technical debt include (a combination of):</blockquote><blockquote><strong>Business pressures</strong>, where the business considers getting something released sooner before all of the necessary changes are complete, builds up technical debt comprising those uncompleted changes.</blockquote><blockquote><strong>Lack of process or understanding</strong>, where businesses are blind to the concept of technical debt, and make decisions without considering the implications.</blockquote><blockquote><strong>Lack of building loosely coupled components</strong>, where functions are not <a href="https://en.wikipedia.org/wiki/Modular_programming">modular</a>, the software is not flexible enough to adapt to changes in business needs.</blockquote><blockquote><strong>Lack of a test suite</strong>, which encourages quick and risky <a href="https://en.wikipedia.org/wiki/Band-aid_(Computing)">band-aids</a> to fix bugs.</blockquote><blockquote><strong>Lack of documentation</strong>, where code is created without necessary supporting documentation. That work to create the supporting documentation represents a debt that must be paid.</blockquote><blockquote><strong>Lack of collaboration</strong>, where knowledge isn’t shared around the organization and business efficiency suffers, or junior developers are not properly mentored.</blockquote><blockquote><strong>Parallel development</strong> at the same time on two or more branches can cause the buildup of technical debt because of the work that will eventually be required to merge the changes into a single source base. The more changes that are done in isolation, the more debt that is piled up.</blockquote><blockquote><strong>Delayed refactoring</strong> — As the requirements for a project evolve, it may become clear that parts of the code have become unwieldy and must be refactored in order to support future requirements. The longer that refactoring is delayed, and the more code is written to use the current form, the more debt that piles up that must be paid at the time the refactoring is finally done.</blockquote><blockquote><strong>Lack of alignment to standards</strong>, where industry standard features, frameworks, technologies are ignored. Eventually, integration with standards will come, doing sooner will cost less (similar to ‘delayed refactoring’).</blockquote><blockquote><strong>Lack of knowledge</strong>, when the developer simply doesn’t know how to write elegant code.</blockquote><blockquote><strong>Lack of ownership</strong>, when outsourced software efforts result in in-house engineering being required to <a href="https://en.wikipedia.org/wiki/Code_refactoring">refactor</a> or rewrite outsourced code.</blockquote><blockquote><strong>Poor technological leadership</strong> where poorly thought out commands handed down the chain of command increases the technical debt rather than reduce it</blockquote><blockquote><strong>Last minute specification changes</strong>; these have potential to percolate throughout a project but no time or budget to see them through with documentation and checks</blockquote><blockquote><strong>Scope Doping</strong>, unmanaged scope reduction or shedding of scope by project managers, or indeed technical staff. Subtly different to <strong>Business pressures</strong> in that, while business pressures may be a cause, Scope Doping will also cause business pressure due to unmanaged work scope that has been shed.</blockquote><h3>Now that it’s too late and your product is based on an reliable codebase, what do you do?</h3><p><strong>Now that it’s too late and your product is based on an unreliable codebase, what do you do?</strong></p><p>The polar decisions to make are:</p><ol><li>Develop the product from scratch.</li><li>Improve/refactor existing software.</li></ol><p>Before we dive into an analysis of the pros and cons of each approach, the executive summary on it is: It’s eventually your decision to make. As the conversation on choices continues, it should signalize one thing for you. The choices are more or less equal, and the worst you can do is to drag on with a decision. The key factor for a decision? Big balls!</p><h3><strong>What are you taking into consideration?</strong></h3><h4><strong>How bad is the code?</strong></h4><p>If the code is bearable — have it fixed. This can be done by giving developers time to:</p><ol><li>Cover the most critical functionality with automated tests.</li><li>Introduce more modularity and object oriented structure to the code.</li></ol><p>If the code is really bad — nothing will save you from having to make the decision to throw it away. Take it as a lesson and include it in your knowledge base, and then design your product from scratch. <em>(That might be a good opportunity to take into consideration all the feedback from users, all the plans you’ve had for a while, reconsider technology stack, dismiss a couple of team members who did not perform well etc.)</em></p><h4><strong>Constraints and Dependencies</strong></h4><p>Do you have a launch date you can’t miss? Do you have an investor demo?</p><p>Generally speaking, people tend to take into consideration the big events that should happen, and they serve as a good explanation to us as to why we should hurry, go for compromises etc. A significant event also convincingly explains why there’s no time for just freezing the existing software and build a new version from scratch.</p><p>However, in my books, businesses will always have significant events. This is the nature of any business that is succeeding. Either it’s thriving, or it’s dead. Those significant events happen with higher frequency than the time needed for redevelopment, and so you’ll end up never rebuilding your software.</p><p>The conclusion I’ve made from my experience is — technology is the most important thing in a technical business, and it should go first in terms of corporate attention.</p><h4><strong>How much money/resources do you have for your product?</strong></h4><p>That’s where you have to treat this technical debt with seriousness and firmly grasp the the interest rate you are paying on it.</p><p>Say you’ve invested 100 man-months into the project.</p><p>You are 2/3 of the way there in terms of functionality, so you suppose you are going to have to put in 50 man-months more and then the product is fully complete to the extent you have financing for.</p><p>Now, as you continue developing features, you see that velocity becomes lower and lower, and that during the last 8 sprints it has declined by 50%: your development team was only able to kill half of the features. More time was spent on debugging and closing regression tasks, as well as on figuring out the right place to write the new code on.</p><p>Thus your optimistic projection now in terms of resources needed to finish the project is 100 more man-months versus 50 you previously had, and pessimistically it will become more like 150 or 200 as the technical debt accrues. At this stage, you might make several decisions:</p><ol><li><strong>Decrease the scope by 3–4 times.</strong> It will give you an estimate of 50 man-months which will be within your capacity. You might not think much about it, but there are oftentimes ways to do that: (x) use pre-existing solutions (templates, white label solutions); (x) become a smaller piece of a bigger solution (browser or embeddable plugin inside of an ERP, CRM or CMS system).</li><li><strong>Continue with the old system accepting 150–200 man months instead of initial 50 man months estimation</strong>. You will apparently run out of resources unless you go hunt for more (get investments, do development for equity etc). I consider this to be a no-go, as it will grow as the problem snowballs and you end up with a bigger disaster later.</li><li><strong>Develop it all from scratch.</strong> This is one of my favorites. If you combine this decision with cutting the scope in a smart way, you may end up releasing something cool within even 20–40 man-months! At the end of the day, your team will be on the upward part of the learning curve with the product, domain and the architectural approach required for this product.</li><li><strong>Isolate the product and develop further functionality as separate services/modules.</strong> You’ll try as much as possible to keep hands off the current code base and to write new functionality separately. You’ll keep modules separate, so even if one of them is suboptimal it is easier to replace it without destroying the whole system. Although this method sounds great on paper, it’s usually hard to implement because integration of various systems may be complicated unless the modular thought was put in place initially, and we had previously discovered it wasn’t.</li></ol><h3>Conclusion</h3><p>In the conclusion, I can only add one thing. It’s sometimes better to make any decision than to make none. I’ve just heard this phrase yesterday:</p><blockquote>The main function of a CEO is to make decisions.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31fe30839c1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>