<?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 John Akhibi  on Medium]]></title>
        <description><![CDATA[Stories by John Akhibi  on Medium]]></description>
        <link>https://medium.com/@johnakhibi?source=rss-d2cd468ba56a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by John Akhibi  on Medium</title>
            <link>https://medium.com/@johnakhibi?source=rss-d2cd468ba56a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 15:36:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnakhibi/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[FUNCTION IN PROGRAMMING]]></title>
            <link>https://medium.com/@johnakhibi/function-in-programming-c946912f5b59?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c946912f5b59</guid>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 00:06:00 GMT</pubDate>
            <atom:updated>2026-03-14T00:06:00.684Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>FUNCTION IN PROGRAMMING</strong></p><p>Function in programing is used to arrange code, for it to be easier to read and used</p><p>It also helps the program/programmer to reuse same code as often as possible</p><p>It also makes it easier to identify where a mistake has been made when a mistake is found in a program even if it has been used multiple times</p><p><strong>WHEN TO USE A PROGRAM</strong></p><p>If a code run a specific task</p><p>If the code is to be used more than once in the program</p><p>WHEN CREATING A FUNCTION</p><p>The following needs to be put into consideration when creating a function</p><p>1) Function has to have a name for easy identification</p><p>2) Clarify the use and input</p><p>3) After naming the code, write how you want the code to function, to be use</p><p>4) Clarify the task you want the function to do</p><p>5) State how the result will be interpreted from the input date</p><p>EXAMPLE</p><p>Our function is named convertToCelsius. It takes fahrenheit as input, and returns celsius.</p><p>But to make the function run, we need to call it.</p><p>Calling a Function</p><p>To call a function you write its name together with the input, and that makes the function run.</p><p>After creating the convertToCelsius function, we can call it, converting 100°F into Celsius like this:</p><p><strong>RUN EXAMPLE</strong></p><p>function convertToCelsius(fahrenheit) {</p><p>const celsius = (fahrenheit — 40) * 5 / 9;</p><p>return celsius;</p><p>}</p><p>console.log(convertToCelsius(100));</p><p>//JavaScript</p><p><strong>RUN ANSWER</strong>3.333333333333336</p><p>33.333333333333336</p><p>Now that we have created the convertToCelsius function, we can just call that same function over and over again for each temperature in Fahrenheit we want to convert.</p><p>function convertToCelsius(fahrenheit) {</p><p>const celsius = (fahrenheit — 32) * 5 / 9;</p><p>return celsius;</p><p>}</p><p>console.log(‘Fahrenheit values 0, 20, 40, 60, 80, 100’);</p><p>console.log(‘converted to Celsius:\n’);</p><p>console.log(convertToCelsius(3));</p><p>console.log(convertToCelsius(20));</p><p>console.log(convertToCelsius(60));</p><p>console.log(convertToCelsius(70));</p><p>console.log(convertToCelsius(90));</p><p>console.log(convertToCelsius(100));</p><p>//JavaScript</p><p>RUN EXAMPLES</p><p>function convertToCelsius(fahrenheit) {</p><p>const celsius = (fahrenheit — 32) * 5 / 9;</p><p>return celsius;</p><p>}</p><p>console.log(‘Fahrenheit values 0, 20, 40, 60, 80, 100’);</p><p>console.log(‘converted to Celsius:\n’);</p><p>console.log(convertToCelsius(3));</p><p>console.log(convertToCelsius(20));</p><p>console.log(convertToCelsius(60));</p><p>console.log(convertToCelsius(70));</p><p>console.log(convertToCelsius(90));</p><p>console.log(convertToCelsius(100));</p><p>//JavaScript</p><p>RUN ANSWER</p><p>Fahrenheit values 0, 20, 40, 60, 80, 100</p><p>converted to Celsius:</p><p>-16.11111111111111</p><p>-6.666666666666667</p><p>15.555555555555555</p><p>21.11111111111111</p><p>32.22222222222222</p><p>37.77777777777778</p><p>The Benefits of Using Functions</p><p><strong>Reusability: </strong>You can use a code as many times as possible</p><p><strong>Simpler programs: </strong>it reduces the time spend on re-writing code and makes work easier</p><p><strong>Readability: </strong>it makes code readable after interpreted by the task they are to do</p><p>It is easier to understand what this line of code does:</p><p><strong>Fixing errors: </strong>it makes fixing errors easy as when you have error in multiple codes, you only need to get it fixed in one place, avoiding multiple changes in different areas</p><p><strong>Collaboration: </strong>It creates an ecosystem where people can work collaboratively.</p><p><strong>Testing: </strong>Functions can be tested independently to ensure they work correctly.</p><p><strong>Scalability: </strong>Functions make it easier to expand and add new features to your programs.</p><p><strong>Abstraction: </strong>Allows you to hide complex details and focus on what the function does instead of how it works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c946912f5b59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RECURSION IN PROGRAMMING]]></title>
            <link>https://medium.com/@johnakhibi/recursion-in-programming-f56afd553bc7?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f56afd553bc7</guid>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Thu, 12 Mar 2026 23:04:53 GMT</pubDate>
            <atom:updated>2026-03-12T23:04:53.175Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>RECURSION IN PROGRAMMING</strong></p><p><strong>Recursion</strong> is part of programming where a function can basically perform some task by itself without and external command</p><p>A BASE CASE in Recursion is where program has to get become very small to solved itself directly</p><p>RECURSION EXAMPLE</p><p>When you want a function to add two or more numbers together to its smallest or a specific number of times</p><p>Allowing the function to do the task alone with interference</p><p>EXAMPLE</p><p>function sumRange(k) {</p><p>if (k &gt; 0) { // base case</p><p>return k + sumRange(k — 1);</p><p>} else {</p><p>return 0;</p><p>}</p><p>}</p><p>const result = sumRange(5);</p><p>console.log(result); // 20</p><p>//JavaScript</p><p>RUN ANSWER</p><p>15</p><p>EXAMPLE</p><p>function countdown(n) {</p><p>if (n === 0) { // base case</p><p>console.log(“Done!”);</p><p>} else {</p><p>console.log(n);</p><p>countdown(n — 1); // recursive call</p><p>countdown(10);</p><p>//JavaScript</p><p>RUN ASWER</p><p>10</p><p>9</p><p>8</p><p>7</p><p>6</p><p>5</p><p>4</p><p>3</p><p>2</p><p>1</p><p>Done!</p><p>Factorial Example</p><p>The factorial of a number (n!) is the product of all numbers from 1 to n.</p><p>Example: 10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 3,628,800</p><p>This can be solved naturally with recursion:</p><p>function factorial(n) {</p><p>if (n === 1) { // base case</p><p>return 1;</p><p>} else {</p><p>return n * factorial(n — 1);</p><p>console.log(factorial(10));</p><p>//JavaScript</p><p>RUN ANSWER</p><p>3628800</p><p>Recursion is when a function calls itself.</p><p>A base case is needed to stop the recursion.</p><p>Recursion is useful for problems that break down into smaller, similar problems (like factorial, traversing folders, tree/graph algorithms).</p><p>Note: Recursion is powerful but can use a lot of memory if not carefully written. Always make sure you have a base case, or the recursion may go on forever!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f56afd553bc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Today i learned about operator in JavaScript, its Intresting and same time brainstorming]]></title>
            <link>https://medium.com/@johnakhibi/today-i-learned-about-operator-in-javascript-its-intresting-and-same-time-brainstorming-047de23c1a56?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/047de23c1a56</guid>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 09:40:11 GMT</pubDate>
            <atom:updated>2026-03-06T09:40:11.177Z</atom:updated>
            <content:encoded><![CDATA[<p>Today i learned about operator in JavaScript, its Intresting and same time brainstorming</p><p>In JavaScript, <strong>operators</strong> are special symbols or keywords that perform operations on values and variables (called operands). They are fundamental to the language, allowing developers to perform mathematical calculations, compare values, and control program flow.</p><p>Key types of operators in JavaScript include:</p><p>· <strong>Arithmetic Operators:</strong> Perform mathematical operations on numbers.</p><p>+</p><p>Addition</p><p>-</p><p>Subtraction</p><p>*</p><p>Multiplication</p><p>/</p><p>Division</p><p>%</p><p>Remainder/ Modulo</p><p>**</p><p>Exponentiation</p><p>++</p><p>Increment by one</p><p>—</p><p>Decrement by one</p><p>· <strong>Assignment Operators:</strong> Assign values to variables, often with a shorthand that combines an arithmetic operation.</p><p>=</p><p>Simple assignment</p><p>+=</p><p>Add and assign</p><p>-=</p><p>Subtract and assign</p><p>*=</p><p>Multiply and assign</p><p>/=</p><p>Divide and assign</p><p>%=</p><p>Remainder and assign</p><p>**=</p><p>Exponentiation and assign</p><p>· <strong>Comparison Operators:</strong> Compare two operands and return a Boolean value (true or false).</p><p>==</p><p>Equal to, with type coercion</p><p>===</p><p>Strict equal to, no type coercion</p><p>!=</p><p>Not equal to, with type coercion</p><p>!==</p><p>Strict not equal to, no type coercion</p><p>&gt;</p><p>Greater than</p><p>&lt;</p><p>Less than</p><p>&gt;=</p><p>Greater than or equal to</p><p>&lt;=</p><p>Less than or equal to</p><p>· <strong>Logical Operators:</strong> Combine or invert Boolean values to create complex conditional statements.</p><p>&amp;&amp;</p><p>Logical AND</p><p>||</p><p>Logical OR)</p><p>!</p><p>Logical NOT</p><p>??</p><p>Nullish coalescing, returns the right operand if the left is null or undefined</p><p>· <strong>String Operators:</strong> The + operator is used to concatenate (join) strings. The += operator also works for string concatenation assignment.</p><p>· <strong>Conditional (Ternary) Operator:</strong> The only operator that takes three operands, providing a concise shorthand for an if-else statement.</p><p>· <strong>Unary Operators:</strong> Operate on a single operand. Examples include typeof (returns the data type), delete (deletes an object property), and the unary plus + (converts an operand to a number).</p><p>· <strong>Bitwise Operators:</strong> Perform operations on the 32-bit binary representations of numbers. (e.g., &amp; for AND, | for OR, ^ for XOR). These are less common in typical web developmen</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=047de23c1a56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You have a loop nested inside another loop. Step-by-step:]]></title>
            <link>https://medium.com/@johnakhibi/you-have-a-loop-nested-inside-another-loop-step-by-step-e9549e97eeef?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9549e97eeef</guid>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 09:30:36 GMT</pubDate>
            <atom:updated>2026-03-06T09:30:36.987Z</atom:updated>
            <content:encoded><![CDATA[<p>You have a loop nested inside another loop. Step-by-step:</p><p>let numExperiments = 1000; — you will repeat the experiment 1000 times.</p><p>let totalRolls = 0; — accumulator for the total number of dice rolls across all experiments.</p><p>Outer loop: for (let i = 0; i &lt; numExperiments; i++) { … }</p><p>Runs the whole experiment once per iteration (1000 times).</p><p>Inner loop:</p><p>let count = 0; — resets the roll count for this single experiment.</p><p>while (true) { … } — infinite loop that you exit only when you roll a 6.</p><p>let dice = Math.floor(Math.random() * 6) + 1; — simulates a fair six-sided die (1–6).</p><p>count++; — increments the number of rolls for this experiment.</p><p>if (dice === 6) { break; } — when you roll a 6, break exits the while loop.</p><p>After the inner loop ends:</p><p>totalRolls += count; — add how many rolls that experiment took to the total.</p><p>After all experiments finish:</p><p>console.log(…) prints the number of experiments and the average number of rolls to get a 6:</p><p>totalRolls/numExperiments is the sample average of rolls required to see a 6.</p><p>Notes:</p><p>The expected theoretical average rolls to get the first 6 for a fair die is 6, so your simulated average should be close to 6 (more accurate as numExperiments grows).</p><p>The inner while loop is the nested loop; the break statement is what stops each inner loop when its condition (rolling a 6) is met.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9549e97eeef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DIFFERENCE BETWEEN LOW LEVEL LANGUAGE AND HIGH LEVEL LANGUAGE]]></title>
            <link>https://medium.com/@johnakhibi/difference-between-low-level-language-and-high-level-language-d6d8bf82cebd?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6d8bf82cebd</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 19:58:28 GMT</pubDate>
            <atom:updated>2026-02-17T19:58:28.437Z</atom:updated>
            <content:encoded><![CDATA[<p>DIFFERENCE BETWEEN LOW LEVEL LANGUAGE AND HIGH LEVEL LANGUAGE</p><p>A<br>Low level language (LLL) is the Computer language <br>High level language (HLL) is the language read by man</p><p>B<br>The major difference between low-level programming language and high-level programming language is that High-level languages require the use of a compiler or an interpreter for their translation into the machine code. while Low-level language requires an assembler to directly translate the instructions of the machine language.</p><p>C<br>A High-Level Language is a computer programming language that uses English like statements to write the computer instructions. High-level languages are most widely programming languages because they are easy to understand to human being.</p><p>A Low-Level Language is also a category of computer programming language in which the computer codes are written in the binary language or machine codes. Because of this, low-level language is sometimes also known as machine language. The low-level language is less friendly for human (programmer), but more friendly for machine because the computer processor can directly process the codes written in the low-level language.</p><p>D<br>*Characteristics of Low Level language</p><p>It can be understood easily by the machine.</p><p>It is considered as a machine-friendly language.</p><p>It is difficult to understand.</p><p>It is difficult to debug.</p><p>Its maintenance is also complex.</p><p>It is not portable.</p><p>It depends on the machine; hence it can&#39;t be run on different platforms.</p><p>It requires an assembler that would translate instructions.</p><p>It is not used widely in today&#39;s times.</p><p>*Characteristics of High Level Language</p><p>can be easily interpreted as well as compiled in comparison to low-level language.</p><p>It can be considered as a programmer-friendly language.</p><p>It is easy to understand.</p><p>It is easy to debug.</p><p>It is simple in terms of maintenance.</p><p>It requires a compiler/interpreter to be translated into machine code.</p><p>It can be run on different platforms.</p><p>It can be ported from one location to another.</p><p>It is less memory efficient, i.e., it consumes more memory in comparison to low-level languages.</p><p>Examples of high-level languages include C, C++, Java, and Python.</p><p>It is widely used</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6d8bf82cebd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SUMMARY OF WHAT VARIABLES ARE AND EXAMPLES]]></title>
            <link>https://medium.com/@johnakhibi/summary-of-what-variables-are-and-examples-3157f80efea7?source=rss-d2cd468ba56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3157f80efea7</guid>
            <dc:creator><![CDATA[John Akhibi ]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 19:57:07 GMT</pubDate>
            <atom:updated>2026-02-17T19:57:07.424Z</atom:updated>
            <content:encoded><![CDATA[<p>SUMMARY OF WHAT VARIABLES ARE AND EXAMPLES</p><p>A variable has a name, and you can store something in it. It&#39;s like a container that stores specific Items, for Reference purposes</p><p>Variables are used to hold different types of data, like whole numbers, decimal numbers, or text.</p><p>A variable used to hold numbers must have integer (int) in front of the variable names</p><p>An example of a variable like favFruit which is used to store Fruits <br>E.G favFruit= apple<br> favAnimal = sheep<br> favCars = Mercedes</p><p>Strings in Variable can be used as a combination of Variables in Numbers</p><p>Examples Using <br>Using JavaScript</p><p>const a = &#39;James&#39;;<br>console.log(&#39;Hello, my friend&#39;s name is &#39; + a);</p><p>Which will give us &quot;my friend name is James, Because &quot;a&quot; is a variable to store &quot;James&quot;</p><p>Having two Strings together means, having adding &quot;+&quot; two variables together to form a sentence / numbers</p><p>const a = &#39;Jame&#39;; <br>const b = &#39;My friend&#39;s name is &#39;; <br>console.log(b + a);</p><p>RUN ANSWER WILL BE <br>My friend&#39;s name is Jane</p><p>Numerical Variable can be used to add numbers <br>Examples <br>const a = 10<br>const b = 5;<br>console.log(a + b);</p><p>RUN ANSWER WILL BE <br>5 cos (a&lt;10&gt; + b&lt;5&gt; =15) <br> <br>Division Example <br>const a = 20;<br>const b = 4;<br>console.log(a / b);</p><p>RUN ANSWER WILL BE<br>5</p><p>Example</p><p>const a = 8;<br>const b = 2;<br>const c = a + b;<br>console.log(&#39;The sum a + b is &#39; + c);</p><p>RUN ANSWER WILL BE <br>a is 8, and b is 2<br>The sum a + b is 10</p><p>Incrementing a Variable</p><p>Is when a Number like 2 is being added to update an already created variable</p><p>Example</p><p>let a = 4;<br>a = a + 2;<br>console.log(a);</p><p>RUN ANSWER WILL BE <br>6</p><p>Incrementing variables are always used in loop scenarios</p><p>let a = 5;<br>a += 3;<br>console.log(a);</p><p>RUN ANSWER WILL BE<br>8</p><p>Decrementing a Variable<br>Is the same as the incrementing variable</p><p>let a = 8;<br>a -= 2;<br>console.log(a);</p><p>RUN ANSWER WILL BE <br>6</p><p>Using a Variable in an if Statement<br>const temperature = 39;<br>console.log(&#39;Temperature: &#39; + temperature + &#39;°C&#39;);</p><p>if (temperature &gt; 37) {<br> console.log(&#39;It is warm&#39;);<br>} else {<br> console.log(&#39;It is not warm&#39;);<br>}</p><p>RUN ANSWER WILL BE <br>Temperature: 39°C<br>It is warm</p><p>The Variable Name<br>Some of the following rules are constant in all programming languages <br>*Space between names are not allowed<br>*Numbers are not allowed to be used to start a variable but can be attached to a word/Alphabet <br>*Words like if, else, for, function etc. cannot be used to reserve variable names</p><p>For readability, it is common to use camelCase or snake_case when naming variables, so instead of myfavanimal, we can use myFavAnimal or my_fav_animal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3157f80efea7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>