<?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 Pavandkhatri on Medium]]></title>
        <description><![CDATA[Stories by Pavandkhatri on Medium]]></description>
        <link>https://medium.com/@pavandkhatri?source=rss-458f2df16d90------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_XjSQMDasjDJqdz9</url>
            <title>Stories by Pavandkhatri on Medium</title>
            <link>https://medium.com/@pavandkhatri?source=rss-458f2df16d90------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:32:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pavandkhatri/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[The ABCs of Software Development: Essential Principles Explored]]></title>
            <link>https://medium.com/@pavandkhatri/the-abcs-of-software-development-essential-principles-explored-ec24d0c0b6e4?source=rss-458f2df16d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec24d0c0b6e4</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[principles-of-design]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Pavandkhatri]]></dc:creator>
            <pubDate>Thu, 14 Dec 2023 05:32:42 GMT</pubDate>
            <atom:updated>2023-12-14T05:37:29.767Z</atom:updated>
            <content:encoded><![CDATA[<h4>YAGNI, KISS, SOLID and many more</h4><p>Why are we talking about <strong>software development principles</strong> and what benefits they provide? This might be the first thought that runs through your mind so I might say you are in the right place.</p><blockquote><strong>Software development principles are pivotal in guiding the development process, ensuring the creation of high-quality, maintainable, and efficient software. These principles provide a foundation for key aspects that contribute to the overall success of a project.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*RkNI84iDiT0wyGd31lWGIw.jpeg" /></figure><p>There can be various principles you have heard of such as SOLID, LEAN Development, etc so today I will be focusing on a other few principles that will help you develop good quality code which easier for eyes to read and mind to understand and easier for words to explain.</p><p>Consistently applying those principles will make your transition from mid to senior software engineer easier. You may find out that (probably) you are applying some of them intuitively.</p><ol><li><strong>Keep It Simple Stupid [ KISS ]</strong></li></ol><p>KISS simplifies software development, emphasizing clarity, efficiency, and maintainability. By keeping it simple, developers create software that is not only functional but also elegant and easy to work with.</p><p><em>NON-KISS Example</em></p><pre>import java.util.List;<br><br>public class AverageCalculatorComplex {<br>    public Double calculateAverage(List&lt;Double&gt; numbers) {<br>        double total = 0;<br>        int count = 0;<br><br>        for (Double num : numbers) {<br>            // Unnecessary complexity: handling null values<br>            if (num != null) {<br>                total += num;<br>                count++;<br>            }<br>        }<br><br>        if (count &gt; 0) {<br>            return total / count;<br>        } else {<br>            return null;  // Returning null for an empty list<br>        }<br>    }<br>}</pre><p>In this non-KISS example, there’s unnecessary complexity in handling null values. <br>Now, let&#39;s simplify this with the KISS principle.</p><pre>import java.util.List;<br>import java.util.Optional;<br><br>public class AverageCalculatorSimple {<br>    public Double calculateAverage(List&lt;Double&gt; numbers) {<br>        return numbers.stream()<br>                .filter(num -&gt; num != null)<br>                .mapToDouble(Double::doubleValue)<br>                .average()<br>                .orElse(null);<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*t8ZkDs9V2hVkXyr99XkwmA.jpeg" /></figure><p><strong>2. SOLID</strong></p><p>SOLID, a quintessential set of object-oriented design principles, forms the bedrock of robust and maintainable software. In this article, we’ll delve into each SOLID principle, unveiling its significance. <br>We will be covering the practical examples in the next article.</p><p><strong>(S) Single Responsibility Principle :</strong><br>The SRP advocates that a class should have only one reason to change.<br><strong>(O) Open/Closed Principle :</strong><br>The OCP encourages classes to be open for extension but closed for modification.<br><strong>(L) Liskov Substitution Principle :<br></strong>The LSP asserts that objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program.<br><strong>(I) Interface Segregation Principle :<br></strong>The ISP advocates that a class should not be forced to implement interfaces it does not use<br><strong>(D) Dependency Inversion Principle :<br></strong>The DIP promotes dependency inversion by relying on abstractions rather than concretions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSH2weny5oPJnKBoj2jxuA.png" /></figure><p><strong>3. Avoid Premature Optimization [ APO ]</strong></p><p>Premature optimisation is the practice that encourages developers to perform unnecessary optimisation before it’s proven that it is needed. I think if you apply KISS and YAGNI(we will cover this in the next point) you shouldn’t fall for this.</p><p>A very easy example is scaling. You are not going to buy 40 servers because you think your new app is going to be viral. What you will do, instead, is add servers as you need them.</p><p>Eg: Consider a scenario where premature optimization complicates a straightforward Java method.</p><pre>// Premature optimization<br>public int multiplyByTwo(int number) {<br>    return number &lt;&lt; 1; // Bitwise left shift for multiplication<br>}</pre><p>In the early stages, this optimization might seem clever, but it sacrifices readability. A more straightforward version would be:</p><pre>public int multiplyByTwo(int number) {<br>    return number * 2;<br>}</pre><p><strong>4. You Aren’t Gonna Need It [ YAGNI ]</strong></p><p>YAGNI is a principle of extreme programming (XP) methodology. It embodies a pragmatic approach, advising developers to avoid implementing features or functionality until they are required by the current specifications or known future requirements.</p><p>YAGNI serves as a valuable reminder to developers that adding features should be driven by actual requirements, not speculative desires. By adhering to this principle, development teams can maintain code simplicity, reduce the risk of overengineering, and stay agile in response to evolving project needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*buaJhAeMC77o-HLzJ1Xw4Q.jpeg" /></figure><p><strong>5. Don’t Repeat Yourself [ DRY ]</strong></p><p>The DRY principle, standing for “Don’t Repeat Yourself,” is a fundamental tenet in software development that advocates for the elimination of code duplication. The concept is simple yet powerful, emphasizing the importance of maintaining a single source of truth for any piece of knowledge or logic within a codebase.</p><p>. Eliminating Code Duplication<br>. Code Maintenance and Readability<br>. Abstraction and Modularization</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McD6HMOKnjuG0dKpAT1psw.jpeg" /></figure><p>Conclusion:<br>In our exploration of the ABCs of Software Development, we’ve traversed a landscape rich with essential principles that define the artistry of coding. From the simplicity-driven KISS to the agile wisdom of YAGNI, the robust foundations of SOLID, the anti-pattern vigilance of APO, and the code-cleansing harmony of DRY, each principle contributes to a symphony of best practices.</p><p>The Essence of Simplicity with <strong>KISS</strong>: “Keep It Simple, Stupid” (KISS) has reminded us that simplicity is not just a virtue; it’s an essential element for crafting code that is elegant, efficient, and easily maintainable. By embracing clarity over complexity, developers can build software that stands the test of time.</p><p><strong>SOLID</strong> Foundations for Robust Software: The SOLID principles serve as the bedrock of object-oriented design, guiding developers to create robust, scalable, and adaptable software. As we anticipate practical examples in the next article, we’re poised to implement these principles and witness their transformative impact on our codebases.</p><p>Guarding Against Premature Optimization: The cautionary tale of Avoiding Premature Optimization (<strong>APO</strong>) reminds us to resist the urge to optimize before necessity arises. By focusing on present needs and leveraging the principles of KISS and YAGNI, we ensure our code remains efficient, readable, and adaptive.</p><p>Agility and Wisdom with <strong>YAGNI</strong>: “You Aren’t Gonna Need It” (YAGNI) stands as an agile sentinel, steering us away from the pitfalls of overengineering. By prioritizing current requirements and remaining flexible to change, development teams can adapt gracefully to evolving project needs.</p><p>The Elegance of Not Repeating Yourself: “Don’t Repeat Yourself” (<strong>DRY</strong>) emphasizes the elimination of code duplication, promoting maintainability and consistency. As we conclude our exploration, we carry with us the wisdom to create code that is concise, readable, and efficient.</p><p>In the vast cosmos of software development, these principles serve as our guiding stars. The journey from mid to senior software engineer becomes smoother by consistently applying these principles, and developers may find that they are already intuitively incorporating them into their craft. As we close this chapter, let the ABCs of Software Development be your compass, guiding you through the intricacies and joys of coding. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec24d0c0b6e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>