<?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 Akoke Anto on Medium]]></title>
        <description><![CDATA[Stories by Akoke Anto on Medium]]></description>
        <link>https://medium.com/@antoakoke_59319?source=rss-073df31a56ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bAKV4N88LSgd4KuMmP6-vg.jpeg</url>
            <title>Stories by Akoke Anto on Medium</title>
            <link>https://medium.com/@antoakoke_59319?source=rss-073df31a56ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:46:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antoakoke_59319/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[Embracing Purity in Programming: The Power of Pure Functions]]></title>
            <link>https://medium.com/@antoakoke_59319/embracing-purity-in-programming-the-power-of-pure-functions-2b2e34a426fd?source=rss-073df31a56ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b2e34a426fd</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[oop]]></category>
            <dc:creator><![CDATA[Akoke Anto]]></dc:creator>
            <pubDate>Fri, 10 Nov 2023 14:41:48 GMT</pubDate>
            <atom:updated>2023-11-10T14:41:48.561Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C7HSq690RGdVkryg" /><figcaption>Photo by <a href="https://unsplash.com/@oskaryil?utm_source=medium&amp;utm_medium=referral">Oskar Yildiz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the ever-evolving landscape of programming, the quest for code that is not only efficient but also reliable has led developers to explore and adopt various paradigms. One such paradigm gaining widespread recognition is the concept of pure functions. These functions, characterized by their deterministic nature and freedom from side effects, introduce a sense of clarity and predictability to code. Pure functions appeal to both seasoned developers and those embarking on the complexities of programming for the first time. Embark on the journey of pure functions with me, where the pursuit of simplicity and reliability transforms the way I approach software development.</p><p>Two things make a function pure:</p><ol><li>Deterministic — A pure function, when given the same inputs will consistently produce the same outputs. This not only makes your code comprehensible, it also makes it reliable.</li></ol><pre>const convert_naira_to_kobo = (amountInNaira) =&gt; {<br>  return amountInNaira * 100;<br>}<br></pre><p>In this simple JavsScript example, convert_naira_to_kobo , the output solely is determined by the input amountInNaira. If you provide the function with the same value of amountInNaira, it will consistently return the result of multiplying the value by 100. For instance</p><pre>const result_1 = convert_naira_to_kobo(2) // Output: 200<br>const result_2 = convert_naira_to_kobo(10) // Output: 1000</pre><p>No matter how many times you call convert_naira_to_kobo(10) , you can reliably expect the output to be 100. This deterministic behaviour is a key characteristic of pure functions, contributing to the predictability and consistency crucial in building robust and reliable software systems.</p><p>2. No side effects — A pure function avoids the temptation of meddling with external states or variables, steering clear of side effects that could introduce unpredictability and compromise the integrity of code. Using this function convert_naira_to_kobo as an example, we expect our function to perform the calculation and return a result without impacting anything outside of its scope. The absence of side effects ensures that the function’s execution does not introduce any unexpected changes to the program’s state, aligning with the principle of pure functions.</p><h3>Key benefits of pure functions</h3><ol><li>Predictability — Since a pure function always produces the same output for the same input, it is predictable and easier to reason about.</li><li>Testability — Pure functions are easier to test because they do not rely on any external state. You can test them by providing inputs and checking the outputs.</li><li>Concurrency — Pure functions are inherently safe to use in multithreaded environments, and they can be effortlessly adapted for parallel programming. This makes them a great fit for scenarios where multiple tasks need to be executed simultaneously.</li></ol><p>In conclusion, pure functions offer a paradigm shift in code simplicity, predictability, and reliability. Their inherent safety in multithreaded scenarios makes them crucial in modern-day software engineering. Embracing purity is not just a technical choice but a strategic move toward resilient and scalable software development.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b2e34a426fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>