<?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 Ayomide Johnson on Medium]]></title>
        <description><![CDATA[Stories by Ayomide Johnson on Medium]]></description>
        <link>https://medium.com/@royalboe1?source=rss-6c5107efcc8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*t41yMx-YWRDHkPmM</url>
            <title>Stories by Ayomide Johnson on Medium</title>
            <link>https://medium.com/@royalboe1?source=rss-6c5107efcc8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:09:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@royalboe1/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[Rules of Programming]]></title>
            <link>https://medium.com/@royalboe1/rules-of-programming-621bf42f8927?source=rss-6c5107efcc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/621bf42f8927</guid>
            <dc:creator><![CDATA[Ayomide Johnson]]></dc:creator>
            <pubDate>Sun, 29 May 2022 14:24:19 GMT</pubDate>
            <atom:updated>2022-05-29T14:24:19.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LfpTmy8kU-Z4Ehg_" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=medium&amp;utm_medium=referral">Chris Ried</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>The Rules Of Programming Languages<br></strong>Like we have rules in our normal written and spoken languages (these rules are called the syntax and semantics of the language), in English for example, we have to capitalise the first letter of every sentence, if you put a comma where a full stop is supposed to be or vice versa you are breaking some of the rules of English Language, same goes to programming languages. Every programming language has its own syntax and rules that must be followed to use the language, if you fail to follow these rules, your compiler or interpreter will complain and throw out a syntax error. There are some general rules common to a lot of programming languages but they all have specific rules and you can always read up on these rules in the documentation for the language. Let’s talk about the common rules in programming languages.<br><strong>How to write statements<br></strong>A statement is a single self-contained instruction that produces an effect. Self-contained in this context means that a statement must be specific and complete for example flip the coin, this is a complete statement in English, I can not say “flip”, this statement makes no sense and I am certain if someone says this to you, you wouldn’t understand or you would probably ask “Flip what?”. Therefore, to write a statement in a programming language, you must specify the action and what you want that action to act on in this case the action is “flip” and it is to act on the “coin”. If you fail to do this the compiler or the interpreter for that language would complain. <br>An example of a statement is:<br>Add one to count:- <br>In modern programming languages, it would be written like this: count= count+ 1<br>In older languages like Cobol: ADD 1 to count<br>In AppleScript it would be: set count to count + 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*PbGwGktQpQqWlB9RTr9itQ.png" /><figcaption>A program in kotlin that adds one to the value of count</figcaption></figure><p>Also, the way a full stop signifies the end of a sentence, a lot of programming languages require us to signify the end of a statement. The most common character is a “Semicolon”; i.e<br>statement 1;<br>statement 2;<br>statement 3;<br>Without the semicolon, the compiler will complain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*vxpwH8EHqP9XJ9su6cEc0A.png" /><figcaption>A program in C adds one to count and ends each statement with a semicolon</figcaption></figure><p><strong>Note please you do not have to memorize this, just read and understand.</strong></p><p><strong>Keywords<br></strong>Also called <strong>Reserved words, </strong>these are words that belong to a programming language, or words that come predefined with a specific function. You can not redefine a keyword to mean something else. Each programming language has its own set of keywords. Python has about 33, some languages have over 50 keywords. You need to understand how to use the keywords for you to write a valid program. Examples of keywords in python are false, true, if, is, lamdba, with etc. We usually need more than the language keywords to write a good program, we might need to introduce our own keywords, we will talk about that later.</p><p><strong>Comments<br></strong>Comments are a way to make others and future us understand our source code. A comment is not a statement, the compiler or interpreter ignores the comment, it is meant for us, not the compiler. A well-commented source code is a good practice. Comments are also used to provide remainders and also disable a statement. When you wrap a statement with the commenting characters, they are disabled and they won’t run. There are three major ways to add a comment<br>- <strong>Multiline / Block Comments: </strong>In C and other C-Styled languages like Java, Kotlin etc, these types of comments start with a /* and also ends with */. Everything in between is regarded as a comment.<br>- <strong>Inline Comments: </strong>Starts with //, everything after this in a single line becomes a comment.<br>-<strong> Documentation Comments: </strong>These start with /** and end with */. They are also multiline with each line in between starting with a *.<br>Python and Ruby use # to signify an inline comment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*pokG-wT87mcTvM4pI9Wrbg.png" /><figcaption>Comments in the C program.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*v5dLp_6T7VaDf5MdAd5IRw.png" /><figcaption>Comment in python</figcaption></figure><p><strong>White spaces and Indentations<br></strong>In most modern programming languages, white spaces are not important, the compiler or interpreter ignores them, they are there to make the source code readable. However, in python, indentations are important, they help signify to the interpreter that a block or a group of statements are together or are meant to run together.</p><p>*<strong>NOTE </strong>Some languages are also case sensitive. When you select a language to learn, you can read the documentation to know if it is case sensitive or not.</p><p><strong>Pseudocode<br></strong>Pseudocodes are human-readable statements or instructions written in human language. <strong>Coding </strong>specifically is the act of writing these instructions in a programming language of our choice.</p><p>The next article in this series will be on Variables and Data Types.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=621bf42f8927" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to programming]]></title>
            <link>https://medium.com/@royalboe1/introduction-to-programming-4106f051f852?source=rss-6c5107efcc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4106f051f852</guid>
            <dc:creator><![CDATA[Ayomide Johnson]]></dc:creator>
            <pubDate>Sun, 29 May 2022 14:15:48 GMT</pubDate>
            <atom:updated>2022-05-29T14:15:48.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A computer with an opened text editor for coding." src="https://cdn-images-1.medium.com/max/1024/0*S_Y54ekGRmO8v4CQ" /><figcaption>Photo by <a href="https://unsplash.com/@emilep?utm_source=medium&amp;utm_medium=referral">Emile Perron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This article is for people interested in programming and are curious about what it entails. I tried my best to make it as simple as possible while also introducing important concepts in simpler words.<br>The focus here will be on programming concepts and they will be explained without focusing on any particular language so that it does not matter the language you decided to start with, it would all make sense. <br>Before we start, one thing you should know is that some concepts are pretty easy to understand while some might take a little time to sink in, don’t fret and don’t rush yourself, learn at your own pace and do not get overwhelmed, you will be fine.<br>In this article and subsequent ones, we would cover a couple of buzzwords used in programming, for example, algorithms, bugs, pseudocode etc.</p><p><strong>What is programming<br>Programming</strong> can be defined as a way to tell the computer to do something or perform a particular task.</p><figure><img alt="A computer" src="https://cdn-images-1.medium.com/max/1024/0*DXC3fQ-2NXWdvoSY" /><figcaption>Photo by <a href="https://unsplash.com/@laurenmancke?utm_source=medium&amp;utm_medium=referral">Lauren Mancke</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A <strong>computer</strong> is a programmable electronic device that is capable of processing or manipulating data. It could be your smartphone, PC, tablet etc.<br>A <strong>computer program</strong> is a sequential series of specific instructions written in a language that a computer understands. Think of this as a baking recipe book that contains specific and well-defined instructions on how to make your favourite pastry.<br>The important thing about these instructions is that they have to be in order e.g to bake a cake you have to beat the eggs with the margarine before you put them in an oven. If you omit a step or you disregard the order, you will end up with something that is definitely not a cake.<br>To write a computer program, you use a programming language and examples of programming languages are Java, Python, C, C++, Kotlin, Swift, Javascript etc. An example of a programming instruction in python is print (“Hello, World!”) that outputs Hello, World!.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*RkVTRVdK3MX7_6od-igGxQ.png" /></figure><p>In the words of Harold Abelson, <em>Programs must be written for humans to read and only incidentally for computers to execute.</em> Each instruction could also be called a <strong>statement</strong>.<br>An <strong>algorithm </strong>is a set of instructions used to solve a particular problem or perform computations.</p><p><strong>How to communicate with the computer</strong><br>We communicate with the computer by giving it instructions written in a programming language. These instructions are written and saved in a file/document called the <strong>Source Code (src)</strong>. You do not need special software to write the source code as it can be written using a simple text editor like Mac’s TextEdit and Windows Notepad. Depending on the programming language you choose to write in, there are designated extensions to use e.g .kt for Kotlin, .java for Java, .c for C, .py for Python and so on. However there are specialized editors that programmers use that add functionalities like colour-coding and help correct simple errors eg Notepad++, Sublime, Brackets, Atom etc, some editors have personalized features and commands to perform tasks faster, examples are VIM, EMACS etc. Asides from simple text editors we also have more complex software for writing code/src called <strong>Integrated Development Environments(IDEs). </strong>IDEs are software for building applications. They integrate various developer tools together making the process of writing code easier. Examples of developer tools you will find in an IDE are a text editor, debugger(which helps you identify bugs/errors in your code), build tools, emulator etc. Examples of IDEs are Visual Studio Code (VS Code), Visual Studio, Android Studio, Intelliji Idea, Eclipse, PyCharm etc. IDEs are very powerful and they allow for greater productivity. Most IDEs also include functionalities like colour coding and IntelliSense(auto-complete codes) in the text editors letting you code faster while following best practices.</p><p><strong>Machine Code</strong><br>Now while it is okay to assume that a computer understands our programming languages i.e Java etc, in the real sense, computers do not understand these languages, in fact, the only language a computer understands is <strong>machine code</strong> also called <strong>binary code(0s and 1s)</strong>. These 0s and 1s represent two states which are <strong>on(1)</strong> and <strong>off(0)</strong>.</p><figure><img alt="Machine code" src="https://cdn-images-1.medium.com/max/500/1*rX1DRTEsE9UhfOl3yonn_A.png" /></figure><p>However, it is tedious and error-prone to write machine code that is why we have programming languages; they save us from having to write machine code. This means we write src in a programming language but our computers only understand machine code so how then do we communicate with the computer? Well, our src has to go through a translation process(translation) where it is translated to machine code. These common languages are also called <strong>High-Level Languages </strong>because they are closer to human-readable languages than machine code. Languages that are closer to machine code are called <strong>Low-Level Languages, </strong>example of a low-level language is Assembly Language. Source Code written in assembly language also have to be converted to machine code for it to run on a computer by an <strong>ASSEMBLER. </strong>Code written in a low-level language can only run on the machine it is written on, this is because of differences in system architecture. Originally when programmers used to write machine code and assembly code to create programs portability was a big issue because programs can only run on the machine it is created on. Now that we have high-level languages, programs are more portable easier and faster to write. However, programs written in lower-level languages run faster than programs written in high-level languages because they are closer to the language the CPU understands and they do not need to be converted or the conversion process is faster. Let’s talk about the language translation process.</p><p><strong>Language Translation</strong><br>This involves converting our instructions written in a specific programming language to machine code so that they would be executed by the computer. <br>This is done by using either a <strong>compiler</strong> or an <strong>interpreter. </strong>We have programming languages that are converted to machine code through compilation and those converted through interpretation and others through a combination of both. Examples of compiled languages are C, C++, C#, swift, objective-C etc; examples of interpreted languages are Python, Javascript, PHP, Perl etc. Java, Kotlin, Groovy etc are examples of languages that use both processes.</p><p><strong>Compilation<br></strong>This is a process where the src is compiled and a new file is generated which is called the <strong>executable or object file</strong>. This executable is the machine code that the computer — to be more specific the Central Processing Unit (CPU) — understands and can run or process. This executable file can also be transferred from one computer to another(usually one with the same Operating System(OS) — this is also called portability — eg from a computer running on windows to another running on windows) and it will still run fine even without the src but it is usually not cross-platform i.e a program compiled on Mac OS might not run on Windows. The moment the executable is generated, the src is no longer needed and if any changes are made to the src the file has to be recompiled and an executable/object file has to be generated for those changes to take effect. Compiled languages run faster than interpreted languages because compiled code executable file is already in machine code and it only needs to run.</p><p><strong>Interpretation<br></strong>Here, the src is interpreted one line/instruction at a time to machine code. No new file is generated because the conversion does not happen until you decide to run the code. To share the program with others you have to share the src unlike in compiled languages. Interpreted languages are platform-agnostic or cross-platform because the src code has to be shared, so the src can run on any platform that has an interpreter, for example, there is a Javascript interpreter on every browser. It runs slower than compiled code because the conversion to machine code has to be done first and it is done line by line, that is the interpreter translates a line of code before the CPU runs it. This means that the CPU has to wait for the interpreter to run after every execution. However, interpreted srcs are easier to debug than compiled code.</p><p><strong>Hybrid<br></strong>A lot of modern languages are hybrids of both, they are partially compiled to an intermediate language called a <strong>bytecode, </strong>most of the compilation is done in advance but not all the way to a platform-specific machine code. It leaves off a final step which is also known as <strong>Just-In-Time(JIT) compilation </strong>which is done on the computer of whoever is running the program.</p><p>However, whether a language is compiled, interpreted or hybrid is not something you need to worry about; most programming languages fall into one of these three categories. So how a language is converted to machine code shouldn’t necessarily influence your selection of a programming language.</p><p>Thank you for reading, I hope you enjoyed it. Comments, questions and criticisms are very much welcomed. In the next article, we will talk about the rules of programming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4106f051f852" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>