<?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 Johnson Nyaanga on Medium]]></title>
        <description><![CDATA[Stories by Johnson Nyaanga on Medium]]></description>
        <link>https://medium.com/@johnsonyaanga?source=rss-d5b1fc6aeb03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lKO99odTuHV7-W0rs3I93w.jpeg</url>
            <title>Stories by Johnson Nyaanga on Medium</title>
            <link>https://medium.com/@johnsonyaanga?source=rss-d5b1fc6aeb03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:26:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnsonyaanga/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[Branching in Git]]></title>
            <link>https://johnsonyaanga.medium.com/branching-in-git-4d95c552ac86?source=rss-d5b1fc6aeb03------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d95c552ac86</guid>
            <dc:creator><![CDATA[Johnson Nyaanga]]></dc:creator>
            <pubDate>Fri, 11 Feb 2022 13:29:45 GMT</pubDate>
            <atom:updated>2022-02-11T13:29:45.875Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F18010083&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fgit-merge-gitmerge-gif-18010083&amp;image=https%3A%2F%2Fc.tenor.com%2FD12KYBUCOBAAAAAM%2Fgit-merge.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1bc8999fd7f58cc7a8044434b207996/href">https://medium.com/media/d1bc8999fd7f58cc7a8044434b207996/href</a></iframe><p>In a collaborative environment, its typical for several developers to work on a single source code. These developers might be concurrently building different feature of the project, others might be fixing bugs.</p><p>Branching enables each developer to branch out from the main source code and develop their feature in isolation. Later on the different isolated versions of the code base are merged together to form a complete project.</p><p>A branch is a copy of the original codebase ,you add features on it, test if everything is working correctly and merge back to main branch. If by trying to add a feature on your new branch, you mess up the whole code base , you can always switch back to the main branch that was working.</p><p><strong>Create a branch</strong></p><p>Lets say for instance you are working a school management app and you currently at the main branch. You’ve been asked to add a grading system feature. So you decide to create branch “grading”. you will write the following command:</p><p>git branch grading</p><p>To move into the new branch and start working on your feature, you write the command:</p><p>git checkout grading</p><p>There is a short-hand for the two commands, One that combines the above two commands:</p><p>git checkout -b grading</p><p>So now you are in your “grading” feature branch, you write some code and everything is working as expected. You want to match to your main branch. This is what you will do, push your code to github from “grading” feature branch , create a pull request from “grading” to “ main” branch . If there is no conflict merge the code.</p><p>To access your new version on the main branch, first switch to back to main branch on your git bash terminal by writing this two commands:</p><p>git checkout main</p><p>git pull</p><p>Git pull will fetch all the changes added from GitHub and automatically merge them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d95c552ac86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classes in Kotlin]]></title>
            <link>https://johnsonyaanga.medium.com/classes-in-kotlin-4e4a3f8c33ed?source=rss-d5b1fc6aeb03------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e4a3f8c33ed</guid>
            <dc:creator><![CDATA[Johnson Nyaanga]]></dc:creator>
            <pubDate>Wed, 26 May 2021 17:53:21 GMT</pubDate>
            <atom:updated>2021-05-26T17:53:21.439Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2viuOPvRriwxXj1gQvmxVg.gif" /><figcaption>Let’s go to class and learn about some classic classes.</figcaption></figure><p>In object oriented programming paradigm, objects are used to create applications and computer programs. A class is a blue print of an object. It contains all the shared properties and behavior in terms of members.</p><p>A typical Kotlin class contains class name, class header(specifying type parameters and primary constructor), and the body enclosed in curly braces. However in kotlin the header and curly braces are optional, if the class has no body.</p><p><strong>Simple Kotlin class</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cca6fc78cb8909b6799705dd51146ee9/href">https://medium.com/media/cca6fc78cb8909b6799705dd51146ee9/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94f0b7ec767a5d2ee1aa20ae18c04286/href">https://medium.com/media/94f0b7ec767a5d2ee1aa20ae18c04286/href</a></iframe><p><strong>Kotlin class constructors</strong></p><p>A kotlin class may contain one primary constructor and one or many secondary constructors. The primary constructor is part of the header, and it may contain optional type parameters.</p><p><em>class Animal constructor(family:String, hasHair:Boolean){}</em></p><p>The constructor key word is optional if it is not preceeded by any modifier.</p><p><strong>Kotlin class types</strong></p><p>We have different types of classes in kotlin. They are differentiated by their modifiers. Below are some of the classes we will have a deeper look at someof them:</p><ol><li>Kotlin open class</li><li>Kotlin inner class</li><li>Kotlin nested class</li><li>Kotlin data class</li><li>kotlin sealed class</li><li>Kotlin abstract class</li><li>Kotlin enum class</li></ol><p><strong>Kotlin open class</strong></p><p>By default, Kotlin classes are final: they can’t be inherited. To make a class inheritable, mark it with the <em>open</em> keyword. If the base class has a primary constructor, the it must be initialized with the parameter of base class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/273e43b2a2f97758ad2a49dca6a370e0/href">https://medium.com/media/273e43b2a2f97758ad2a49dca6a370e0/href</a></iframe><p><strong>Kotlin data classes</strong></p><p>At times you build classes whose absolute purpose is to hold data.some standard functionality and utility functions are manually derivable from the data. Kotlin uniquely recognizes these classes as <em>data classes </em>and atomates the process of deriving functionalities from constructor parameters. Compiler automatically creates the<em> equal</em>, <em>hashCode</em>, <em>toString</em>, and <em>copy </em>functions.</p><p>data classes have the following specific rules:</p><ol><li>The primary constructor must have atleast one parameter</li><li>The parameters in the primary constructor must be marked as val or var</li><li>data class cannot be sealed, inner, abstract nor open</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e645a6474d30dadae03d71d9b704839f/href">https://medium.com/media/e645a6474d30dadae03d71d9b704839f/href</a></iframe><p><strong>Kotlin inner and nested classes</strong></p><p>In Kotlin classes can be nested inside other classes. Classes that are inside other classes are called nested classes. An inner class is denoted by modifier <em>inner. </em>The difference is that, an inner class can access properties of its outer class while nested class can’t.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51fd5f08a5ba7a637050e7872e34e4e3/href">https://medium.com/media/51fd5f08a5ba7a637050e7872e34e4e3/href</a></iframe><p><strong>Kotlin Sealed Class</strong></p><p><em>Sealed</em> classes and interfaces represent restricted class hierarchies that provide more control over inheritance. A sealed class explicitly defines the objects that can inherit from it. It is denoted by modifier <em>sealed. </em>Sealed classes can have subclasses, but they must either be in the same file or nested inside of the sealed class declaration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cdf58926d90c56cc1f36a54c703495c/href">https://medium.com/media/2cdf58926d90c56cc1f36a54c703495c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e4a3f8c33ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Commands Basics]]></title>
            <link>https://johnsonyaanga.medium.com/git-commands-basics-73a7ebed4487?source=rss-d5b1fc6aeb03------2</link>
            <guid isPermaLink="false">https://medium.com/p/73a7ebed4487</guid>
            <dc:creator><![CDATA[Johnson Nyaanga]]></dc:creator>
            <pubDate>Tue, 11 May 2021 17:52:35 GMT</pubDate>
            <atom:updated>2021-05-11T20:44:46.594Z</atom:updated>
            <content:encoded><![CDATA[<p>Git and Github are a must have skill for any software developer out there. After Creating a project locally on your computer, there is a big need to make a backup. This helps to restore your work incase of computer crash or loss of your project files. The following are some of the most basic git commands you need to know in order to use git and github.</p><p>1 <strong>git init — </strong>this is to initialize\start a new repository</p><p>2 <strong>git add &lt;filename&gt; — </strong>this is used to add one or more files to the staging area. e.g “git add profile.py” . To add all files in the working directory you use</p><p>“ git add . ” .</p><p><strong>3. git commit </strong>— this is the command responsible for recording snapshot of your file/files permanently in the version history.</p><p>e.g git commit -m “any appropriate commit message”</p><p>note “git commit” can only be used after “git add” command</p><p>4. <strong>git push </strong>— this command sends the commited changes of your main branch to the remote repository.</p><p><strong>5.git status </strong>— this commands shows the current status of your working directory. show if the file that haven’t been committed yet.</p><p><strong>6. git reset</strong> — this command unstages the file afftected but preserves the content</p><p><strong>7 git rm</strong> — this command deletes a file from the working directory and stages the deletion.</p><p>e.g “git rm login.php”</p><p><strong>8. git clone</strong>— a command used to obtain a repository from and existing url.</p><p>e.g “git clone <a href="https://github.com/Johnsonnyaanga/Compose-Login-page.git">https://github.com/Johnsonnyaanga/Compose-Login-page.git</a>”</p><p>There are many git commands used in version controll of projects, but these are the very basic ones that you need to start with.Thank you. Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73a7ebed4487" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>