<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ software - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ software - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 18 May 2026 04:49:43 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/software/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ What is Firmware? Definition and Examples ]]>
                </title>
                <description>
                    <![CDATA[ Did you know that firmware is literally everywhere? It might be strange to think about – but it's just as common as hardware and software. In fact, it is thanks to firmware that: Printers work Defibrillators work Car radios works and more … Based o... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-firmware/</link>
                <guid isPermaLink="false">66ba536002e3361751683723</guid>
                
                    <category>
                        <![CDATA[ firmware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Tiago Capelo Monteiro ]]>
                </dc:creator>
                <pubDate>Thu, 21 Apr 2022 18:40:08 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/04/postimage.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Did you know that firmware is literally everywhere? It might be strange to think about – but it's just as common as hardware and software.</p>
<p>In fact, it is thanks to firmware that:</p>
<ul>
<li>Printers work</li>
<li>Defibrillators work</li>
<li>Car radios works</li>
<li>and more …</li>
</ul>
<p>Based on the examples above, you probably already have some idea of what firmware is. But you don't have a clear definition of it.</p>
<p>In order to truly understand what firmware is, we must first understand software, then hardware, and finally we can jump into firmware.</p>
<p>In this tutorial, I'll explain each topic with an analogy. By doing so, everyone can understand.</p>
<p>It doesn't matter if you're just getting into technology!</p>
<p>With that, I would like to make sure that everyone understands what software, hardware, and firmware is. I will not elaborate on the technical terms.</p>
<h3 id="heading-in-this-article-we-will-explore">In this article we will explore:</h3>
<ul>
<li>What exactly is software?</li>
<li>What exactly is hardware?</li>
<li>What exactly is firmware?</li>
</ul>
<h2 id="heading-what-is-software">What is Software?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/book.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@kubra-dogu-80605500?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>Kübra Doğu</strong> from &lt;a href="https://www.pexels.com/photo/food-wood-dawn-coffee-9222655/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>Imagine, if you will, that you have no idea what to make for dinner today.</p>
<p>Luckily, you find an old cookbook you have and decide to cook one of the recipes in it.</p>
<p>The cookbook has many recipes. Each of these recipes has its own instructions.</p>
<p>In the <strong>cookbook</strong>, a <strong>recipe</strong> can be seen as a <strong>set of steps</strong> (or instructions) that together make a <strong>meal</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/cooking-instruction.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Photo by <a target="_blank" href="https://www.pexels.com/photo/open-bible-2294878/">Luis Quintero on Pexels</a></em></p>
<p>You can also create your own meals based on your experience in cooking many different recipes, right?</p>
<p>Software is no different.</p>
<p><strong>Software programs</strong> can be seen as a <strong>set of instructions</strong> that work together to form a <strong>program</strong>.</p>
<pre><code class="lang-assembly"> global  _main
    extern  _printf

    section .text
_main:
    push    message
    call    _printf
    add     esp, 4
    ret
message:
    db  'Hello, World', 10, 0
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/HelloWorld.asm.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then, applications are a big sets of instructions that perform specific tasks.</p>
<p>Operating systems are big sets of instructions that coordinate software and hardware resources.</p>
<ul>
<li>Cookbook = software</li>
<li>Dinner cookbook = type of software (application or operating system)</li>
<li>Recipe = program</li>
</ul>
<p>You need a recipe to make dinner. You must follow each step in the cookbook to create a recipe.</p>
<p>Once you have completed all the steps, your dinner is ready.</p>
<p>You need software to accomplish a particular task. A computer has to follow all instructions for the software to function. </p>
<p>Therefore, the software is running either while the instructions are being followed or after they have been completed.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/recipie---cooking-instructions.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-what-is-hardware">What is Hardware?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/food.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@elevate?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>ELEVATE</strong> from &lt;a href="https://www.pexels.com/photo/chef-preparing-vegetable-dish-on-tree-slab-1267320/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>In order to make dinner, you need a series of steps from the cookbook that tell you how to make a particular meal.</p>
<p>You also need various tools to cook with - like pots and pans, knives, and the food itself. This is like hardware.</p>
<p>So a cookbook gives you instructions that allow you to cook.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/cooking-process-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For hardware to work, it needs software (a set of instructions) to tell it what to do.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/CPU-process-2.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Software then, gives instructions to hardware that lets it work.</p>
<ul>
<li>Meal prep tools = hardware</li>
<li>Recipe = software</li>
</ul>
<p>Without software, you can't make hardware work.</p>
<p>Without a recipe, you won't know what to do with your various tools and ingredients to make a meal.</p>
<p>Like hardware without software, you can also eat a meal with just uncooked food. Gross.</p>
<p>In the same way that there are various types of meals, there are also various types of computer hardware.</p>
<p>For example:</p>
<ul>
<li>CPU</li>
<li>RAM</li>
<li>GPU</li>
<li>and so much more…</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/04/comparason-of-processes.png" alt="Image" width="600" height="400" loading="lazy">
<em>Comparison of processes</em></p>
<h2 id="heading-what-is-firmware">What is Firmware?</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/dessert.jpeg" alt="Image" width="600" height="400" loading="lazy">
_Photo by [<strong>Pexels</strong>](https://www.pexels.com/@ella-olsson-572949?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels" rel="noopener"&gt;<strong>Ella Olsson</strong> from &lt;a href="https://www.pexels.com/photo/close-up-photo-of-chocolate-mousse-3026810/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm<em>source=pexels" rel="noopener)</em></p>
<p>A program is a set of instructions read by a computer.</p>
<p>Let's say you just want to make a snack or dessert. You probably don't need as many ingredients as when making a dinner for your family, right?</p>
<p>Let's say you want software that runs on a microwave. You don't need all the hardware the computer has to make the microwave work, right? You just need that specific to making the microwave work.</p>
<p>Or say you want software running on a printer. You don't need all the hardware the computer has to make the printer work right? Just the software for the printer.</p>
<ul>
<li>Microwave software = firmware</li>
<li>Printers software = firmware</li>
</ul>
<p>So this means that firmware is nothing more than software, but in a hardware device. Not in a computer.</p>
<p>Firmware lets very specific hardware complete very specific tasks.</p>
<h2 id="heading-wrapping-up">Wrapping up</h2>
<p>Thanks for reading! Now you know more about:</p>
<ul>
<li>Software</li>
<li>Hardware</li>
<li>Firmware</li>
</ul>
<p>Microprocessor photo by <strong><a target="_blank" href="https://www.pexels.com/@pok-rie-33563?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pok Rie</a></strong> from <strong><a target="_blank" href="https://www.pexels.com/photo/dell-motherboard-and-central-processing-unit-1432675/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></strong> </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Your Developer Career Questions Answered ]]>
                </title>
                <description>
                    <![CDATA[ Will AI ever replace developers? Which programming language should you learn first? What's the best way to learn programming? Learn the answers to these questions and more from a group of experienced developers and technical course creators. We just ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/your-developer-career-questions-answered/</link>
                <guid isPermaLink="false">66b2072c125aeccef6f65d1a</guid>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Wed, 09 Feb 2022 16:54:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/02/questions10.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Will AI ever replace developers? Which programming language should you learn first? What's the best way to learn programming?</p>
<p>Learn the answers to these questions and more from a group of experienced developers and technical course creators.</p>
<p>We just published a video on the freeCodeCamp.org YouTube channel where experienced developers answer the top questions asked by people new to the software field. </p>
<p>You will get wisdom from the following people:</p>
<ul>
<li>Gerald Versluis, Senior Software Engineer at Microsoft</li>
<li>Mama Samba Braima Nelson, Software Engineer</li>
<li>Gwendolyn Faraday, Principal Software Engineer at Relevize</li>
<li>Ania Kubow, Software Developer and Course Creator</li>
<li>Marius Espejo, Senior Software Engineer</li>
<li>Ave Coders, ML Engineer</li>
<li>Jack Herrington, Principal Web Developer</li>
<li>Nana Janashia (TechWorld with Nana), DevOps Engineer &amp; Trainer</li>
<li>Gift Egwuenu, Frontend Developer &amp; Content Creator</li>
<li>Jesse (codeSTACKr), Developer Advocate</li>
<li>James Perkins, Developer Advocate</li>
<li>Gio (ProgramWithGio), Full-Stack Web Developer</li>
<li>Delia Lazarescu, Software Engineer at Google</li>
<li>Islem (CoderOne), Full-Stack Developer and Content Creator</li>
</ul>
<p>Watch the video below or <a target="_blank" href="https://youtu.be/GwHX6FM-BHw">on the freeCodeCamp.org YouTube channel</a> (1-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/GwHX6FM-BHw" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Software Definition ]]>
                </title>
                <description>
                    <![CDATA[ Software, or computer software, is a generic term for instructions and/or data that run on a computer. Software is synonymous with the terms program and application. Software can describe an operating system like Windows 10 or macOS, or their underly... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/software-definition/</link>
                <guid isPermaLink="false">66c35f19e9895571912a0d22</guid>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tech Terms ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 01 Apr 2021 02:40:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/606d1b79d5756f080ba95600.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Software, or computer software, is a generic term for instructions and/or data that run on a computer.</p>
<p>Software is synonymous with the terms program and application.</p>
<p>Software can describe an operating system like Windows 10 or macOS, or their underlying processes. Software can also describe things like Microsoft Word or Adobe Photoshop.</p>
<p>The term software is often contrasted with hardware.</p>
<p>Computer hardware, is physical or "hard", and is difficult to change once it's produced.</p>
<p>Software runs on computer hardware, and is "soft", or easy to change in comparison to hardware.</p>
<h2 id="heading-related-tech-terms">Related Tech Terms:</h2>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/hardware-definition/">Hardware Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/macintosh-definition/">Macintosh Definition</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/pc-definition/">PC Definition</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Setup an LED Light and Make it Blink with Code ]]>
                </title>
                <description>
                    <![CDATA[ Coding an LED Light is introductory project that shows you how software and hardware interact with each other. It's a simple project you can complete in a weekend that'll help you learn some basic aspects of hardware. By the end of the project, you w... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/code-behind-an-led-light/</link>
                <guid isPermaLink="false">66d45f33230dff0166905811</guid>
                
                    <category>
                        <![CDATA[ Electronics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hardware ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ilknur Eren ]]>
                </dc:creator>
                <pubDate>Mon, 08 Jun 2020 21:50:21 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/05/Screen-Shot-2020-05-25-at-4.15.01-PM-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Coding an LED Light is introductory project that shows you how software and hardware interact with each other. It's a simple project you can complete in a weekend that'll help you learn some basic aspects of hardware.</p>
<p>By the end of the project, you will code your own LED light, have the knowledge to manipulate the LED to on/off in intervals you choose, and learn basic principles of hardware.</p>
<p>The <a target="_blank" href="https://www.amazon.com/ELEGOO-Project-Tutorial-Controller-Projects/dp/B01D8KOZF4">Elegoo Uno</a> starter kit has all the hardware as well as instructions you need to make a simple LED Light. The LED Light is the first project offered with their kit.</p>
<p>Elegoo Uno comes with many other projects and takes you through from beginner to advanced projects. Each project in the box advances your skills in a simple, easy to follow way.</p>
<h2 id="heading-components-youll-need">Components You'll Need</h2>
<h3 id="heading-elegoo-uno-r3">Elegoo Uno R3</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Screen-Shot-2020-05-24-at-7.49.14-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><em>Elegoo Uno R3</em></p>
<p>The Elogoo Uno R3 is a microcontroller board. Microcontrollers are embedded inside devices to control the actions and features of a product. They are compact integrated circuits designed to control operations.</p>
<p>The microcontroller that is included in the Elogoo Uno R3 has 14 digital input/output pins, 6 analog inputs, a USB connection, a power jack, and a reset button. This board has everything you need to support the microcontroller. Simply plug in the USB Cable to turn the microcontroller on.</p>
<h3 id="heading-usb-cable">USB Cable</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Screen-Shot-2020-05-24-at-7.49.22-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><em>USB Cable</em></p>
<p>You need a USB Cable to connect the Elegoo Uno R3 to your computer and turn it on. USB stands for Universal Serial Bus. The USB is used to connect your computer to devices such as digital cameras, printers, scanners, and external hard drives.</p>
<p>In our project, we will use a USB cable to connect our microcontroller to our computer.</p>
<h3 id="heading-leds">LEDs</h3>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/image-161.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><em>LED Light</em></p>
<p>LED stands for light emitting diode. It has a positive and negative lead. The longer side is the positive lead.</p>
<h2 id="heading-how-to-assemble-the-components">How to assemble the components</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Screen-Shot-2020-05-25-at-4.15.01-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>In this project, we are only going to make the LED blink.</p>
<p>First, we need to plug in the USB Cable to the board and then the computer.</p>
<p>Then we need to plug in the LED to GND (GND is the reference point in an electrical circuit from which voltages are measured, and is a common return path for electric current) and the 13 input on the board.</p>
<h3 id="heading-code-to-make-the-led-flash-onoff">Code to make the LED flash on/off:</h3>
<p>After the microcontroller board is plugged into the computer and the LED is on the board itself, we need to write some simple code to make the LED blink.</p>
<pre><code class="lang-php"><span class="hljs-comment">// the setup function runs once when you press reset or power the board</span>

<span class="hljs-keyword">void</span> setup() {
  <span class="hljs-comment">// initialize digital pin LED_BUILTIN as an output.</span>
  pinMode(LED_BUILTIN, OUTPUT);
}

<span class="hljs-comment">// the loop function runs over and over again forever</span>
<span class="hljs-keyword">void</span> loop() {
  digitalWrite(LED_BUILTIN, HIGH);   <span class="hljs-comment">// turn the LED on </span>
  delay(<span class="hljs-number">1000</span>);                       <span class="hljs-comment">// wait for a second</span>
  digitalWrite(LED_BUILTIN, LOW);    <span class="hljs-comment">// turn the LED off</span>
  delay(<span class="hljs-number">1000</span>);                       <span class="hljs-comment">// wait for a second</span>
}
</code></pre>
<p>The code above basically turns the LED on for 1 second and then turns it off for one second.</p>
<p>This function is in a continuous loop. The <code>digitalWrite</code> is a function that takes in 2 parameters, <code>LED_BUILTIN</code> and <code>HIGH || LOW</code> . The loop basically takes in the LED, and then turns the volt to <code>HIGH</code> which turns it on. Then after 1 second it turns the same LED off by turning the volt to <code>LOW</code> .</p>
<h3 id="heading-heres-the-final-product">Here's the Final Product:</h3>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/D6IkSkKcY5s" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<p>The goal of this little LED Light Coding project was to introduce you to elementary principles of how hardware and software can be combined. I hope you enjoyed it!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Kanban? The Agile Methodology Defined, and How to Use it For Your Software Development Team ]]>
                </title>
                <description>
                    <![CDATA[ By Bertil Muth Kanban was invented in the Japanese automotive industry in the first half of the 20th century. Inspired by how supermarkets stock their shelves based on demand, Toyota's goal was to reduce inventory and to improve the flow throughout t... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-kanban-the-agile-methodology-defined-and-how-to-use-it-for-your-software-development-team-2/</link>
                <guid isPermaLink="false">66d45df8bc9760a197a10368</guid>
                
                    <category>
                        <![CDATA[ agile ]]>
                    </category>
                
                    <category>
                        <![CDATA[ kanban ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Scrum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 19 May 2020 11:12:13 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/05/grafik-8.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Bertil Muth</p>
<p>Kanban was invented in the Japanese automotive industry in the first half of the 20th century. Inspired by how supermarkets stock their shelves based on demand, Toyota's goal was to reduce inventory and to improve the flow throughout their whole production system.</p>
<p>In his book <em>Kanban: Successful Evolutionary Change for Your Technology Business</em>, David Anderson described how to apply the Kanban principles to software development. These principles are:</p>
<ul>
<li>Start with what you do now</li>
<li>Agree to pursue incremental, evolutionary change</li>
<li>Respect the current process, roles, responsibilities, and titles</li>
</ul>
<h2 id="heading-what-does-that-mean-for-agile-software-development">What does that mean for agile software development?</h2>
<p>In my training courses, I ask the attendees what they already know about <a target="_blank" href="https://agilemanifesto.org/">agile software development</a>. Common answers are: "Work in Sprints", "There's a product owner", "Manage user stories in a backlog." People are influenced by the arguably most popular agile framework today, Scrum. </p>
<p>Scrum comes with its own predefined roles, events and artifacts. Scrum requires you to follow the rules defined in the <a target="_blank" href="https://www.scrumguides.org/">Scrum Guide</a>, if you want to call what you're doing Scrum. Kanban is different.</p>
<p>Kanban starts with the process that you follow in your company now. Visualize the steps on a Kanban board. They can include everything you do, from idea to delivery. </p>
<p>Each step becomes the title of a column on the board.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/grafik-7.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To track your day to day work, it's best to break it down into small items. Maybe user stories that can be implemented in, at most, 2 days. Write each item on a stickie note, and hang it on the board. You can use the vertical order on the board for prioritization.</p>
<p>The cards move from left to right. The people doing the work pull items that have been finished by the previous process step. When they have capacity to do so. So the developers in the example pull the <em>Upload Image</em> card into <em>Dev</em> when they have the capacity to implement it.</p>
<h2 id="heading-pursuing-incremental-evolutionary-change">Pursuing incremental, evolutionary change</h2>
<p>So you have created a Kanban board that shows your process? You are making your work visible, which is a great start!</p>
<p>To get the benefits of Kanban, you need to do some more things. You need to:</p>
<ul>
<li>Limit work in process and queues</li>
<li>Observe and improve flow</li>
<li>Collaborate effectively</li>
</ul>
<h3 id="heading-limit-work-in-process-and-queues">Limit work in process and queues</h3>
<p>Limiting work in process means: you set a maximum for the number of items you work on. That's called the Work-in-Process limit, or in short WiP limit. Here's the Kanban board with a WiP limit for some process steps.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/grafik-9.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The developers can work on 5 items at a time. At most. If their column contains 5 items, they are not allowed to pull items any more. This has two consequences.</p>
<p>First of all: it encourages people to finish their work, instead of starting more work. Started work that isn't finished bears risks. How happy will your customers be when you can't release your software as planned? Because you started to work on all these great ideas, but you didn't go through with them? </p>
<p>The second consequence of limiting work in process: bottlenecks become visible. When a process step starts work that it can't finish, people will feel it immediately. Because the next process step won't be able to pull items.</p>
<p>Apart from limiting the work in process, you should limit queue sizes, too. In the board above, they are shown as the dotted lines between the columns. It works the same way as limiting the work in process.</p>
<p>In summary: <em>Stop starting, start finishing</em> is the motto. From concept to delivery in as little time as possible.</p>
<h3 id="heading-observe-and-improve-flow">Observe and improve flow</h3>
<p>Observing a bottleneck can be painful at first. But at least you know where the major problems are in your process. And Kanban encourages you to improve the flow by removing the bottleneck.  A consistent flow enables you to deliver more reliably, and that's good for all stakeholders, including developers.</p>
<p>To observe the flow, you record the time at which a card enters a process step. And the time at which you complete the process step. So you know how much time the card spends in each step, and in each queue between the steps.</p>
<p>Based on the data, you can set up metrics that help you to improve the flow. Common metrics include:</p>
<ul>
<li>Cycle time: the time a card takes from the moment a team starts working on it (i.e. <em>Dev</em>) to delivery (i.e. <em>Release</em>). Improving this metric can help you improve your time to market.</li>
<li>Throughput: the number of cards that move through the system in a given time. Improving this metric can help you improve the performance of your delivery organization.</li>
</ul>
<p>A common way to get an overview of how many cards are in which process step over time is a cumulative flow chart. Ideally, the number of cards in each step but the last stays roughly the same over time. The number of released cards should mount. When the chart deviates from that, you might have a bottleneck.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/Cumulative_Flow_Chart.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-collaborate-effectively">Collaborate effectively</h3>
<p>The Kanban metrics are a powerful tool to analyze and improve what you're doing. But they are worthless without the people doing the work. Everybody involved in the process steps should be open to the transparency that Kanban creates. </p>
<p>People should work together constructively to remove bottlenecks, instead of blaming individuals. Look at the current state regularly. Are there any bottlenecks? Is there too much or too little work available for a certain process step? Is throughput sufficient? Are there other sources of discontent? What needs to be improved?</p>
<p>Agree on experiments that try out small changes to the system. Realize the changes. Later, look if the experiments worked out as expected. To be able to implement the changes, management support is often crucial.</p>
<h2 id="heading-when-to-use-kanban">When to use Kanban</h2>
<p>Kanban is very flexible. It can be used in combination with Scrum, which is called <a target="_blank" href="https://en.wikipedia.org/wiki/Scrumban">Scrumban</a>. It can be used outside of product development. You can even use it to plan a trip or organize what you do in your free time.</p>
<p>I found it especially helpful when working in Scrum Sprints is not possible or is difficult. Example: two companies where one is customer, and the other is supplier, and a hand-off is inevitable. Another example is when you're working on a product that involves both software and hardware, and multiple engineering disciplines are involved. </p>
<p>Kanban can also be used inside your company when development works in an agile fashion, but not all of the rest of the company does.  It can be used to facilitate the cooperation between strategic planning and software development.</p>
<p>Don't think that just because you have trouble implementing Scrum, there's no way to become more agile. Kanban starts with what you do now. And if you take it seriously, it will help you improve. One small step at a time.</p>
<p><em>To</em> <a target="_blank" href="https://skl.sh/2Cq497P"><em>learn more about agile software development</em></a><em>, visit my online course. To keep up with what I’m doing or drop me a note, follow me on</em> <a target="_blank" href="https://dev.to/bertilmuth"><em>dev.to</em></a><em>,</em> <a target="_blank" href="https://www.linkedin.com/in/bertilmuth/"><em>LinkedIn</em></a> <em>or</em> <a target="_blank" href="https://twitter.com/BertilMuth"><em>Twitter</em></a><em>. Or visit my</em> <a target="_blank" href="https://github.com/bertilmuth/requirementsascode"><em>GitHub project</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is Agile and How You Can Become an Epic Storyteller ]]>
                </title>
                <description>
                    <![CDATA[ Running a team of developers is hard. Trying to coordinate a mountain of work while keeping everyone productive is a challenge itself. But on top of that, you have to keep open communications with a client. How can we use agile to relieve some of tho... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-agile-and-how-youcan-become-an-epic-storyteller/</link>
                <guid isPermaLink="false">66b8e3940cedc1f2a4f706a1</guid>
                
                    <category>
                        <![CDATA[ Software Requirements ]]>
                    </category>
                
                    <category>
                        <![CDATA[ agile ]]>
                    </category>
                
                    <category>
                        <![CDATA[ agile development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ development process  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ project management ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Scrum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Software Engineering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Colby Fayock ]]>
                </dc:creator>
                <pubDate>Tue, 12 May 2020 14:45:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/05/intro-to-agile-1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Running a team of developers is hard. Trying to coordinate a mountain of work while keeping everyone productive is a challenge itself. But on top of that, you have to keep open communications with a client. How can we use agile to relieve some of those pain points?</p>
<ul>
<li><a class="post-section-overview" href="#heading-what-is-agile">What is agile?</a></li>
<li><a class="post-section-overview" href="#heading-what-are-some-concepts-you-should-know">What are some concepts you should know?</a></li>
<li><a class="post-section-overview" href="#heading-stories">Stories</a></li>
<li><a class="post-section-overview" href="#heading-epics">Epics</a></li>
<li><a class="post-section-overview" href="#heading-sprints">Sprints</a></li>
</ul>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/1GPYnoG_nkE" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-what-is-agile">What is agile?</h2>
<p>Agile is a software development methodology that stems from the idea of breaking up large amounts of work into smaller pieces. This gives product managers, developers, and any stakeholder a better understanding of the work.</p>
<p>Historically, software development was a slow process where major changes to requirements could put large strains on teams. </p>
<p>When following the agile methodology, the smaller chunks of work help teams become more flexible, and dare I say <em>agile</em>. And in the process it helps them deliver features faster and respond to changes quicker.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/jira-project-board.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Example Jira project board from <a target="_blank" href="https://www.atlassian.com/software/jira">atlassian.com/software/jira</a></em></p>
<p>These ideas have been broken up into different frameworks of approaching this methodology. Two of the common ones are <a target="_blank" href="https://www.scrum.org/resources/what-is-scrum">Scrum</a> and <a target="_blank" href="https://en.wikipedia.org/wiki/Kanban_(development)">Kanban</a>. </p>
<p>For this walkthrough, most of these concepts follow along the Scrum framework, but there are certainly concepts that apply to both and others.</p>
<h2 id="heading-what-are-some-concepts-you-should-know">What are some concepts you should know?</h2>
<p>I'd argue half of being productive as a developer in an agile world is simply understanding the terms. Typically the project manager runs the show, so if you can be on the same page with what they're talking about, it will make the process a lot easier.</p>
<p>There are books, courses, and certifications based around learning the nuances of the agile methodology. I'm not going to go deep into some of the philosophical aspects or some of the deeper parts, but I'm going to cover a good set of key concepts that will help you hit the ground running when you start your new job with an agile team.</p>
<h2 id="heading-stories">Stories</h2>
<p>A story is typically the smallest defined piece of work. This usually comes in the form of a new ticket that you create in the project tool you're using whether it's <a target="_blank" href="https://www.atlassian.com/software/jira">Jira</a> or even <a target="_blank" href="https://help.github.com/en/github/managing-your-work-on-github/about-issues">Github Issues</a>.</p>
<h3 id="heading-expressing-stories">Expressing stories</h3>
<p>When working on a project, you'll probably run into a variety of ways people express stories. But a good guideline is to work through the concept of the word "story" itself and explain the work that needs to be done in that way.</p>
<p>For instance, if you would like to provide the ability for the people who use your website to share a blog post on Twitter, you may want to write the story as: As a reader, I want to share the post I just read to Twitter.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/jira-story-summary.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Creating a new story in Jira</em></p>
<p>Using that pattern of "as a [person], I want to [action]" helps provide context as what state somebody may be in when visiting their site and what they're trying to achieve. This can be particularly helpful if you're developing features for people who are logged in that are different from guests.</p>
<h3 id="heading-details-and-requirements">Details and requirements</h3>
<p>While the title of a story is an important representation of the work, you'll also want to provide additional specifics. </p>
<p>At a minimum, that should be done by adding a thorough description and a set of acceptance criteria that can help give the developer context and requirements. Depending on the team, this can also include tools like tags or categorizations that make it easier for the team to visualize groups of work.</p>
<p>Providing a strong set of requirements helps both the developer working on the story and the person reviewing it have a measurement to determine if it's actually complete. Without it, everyone's just guessing.</p>
<p>A good way to phrase these are: verify [requirement]. Back to my example of sharing a post on Twitter, maybe some of the requirements to that story would be:</p>
<ul>
<li>Verify when clicking the share button a new tweet is created</li>
<li>Verify the tweet includes a link to the current blog post</li>
</ul>
<h3 id="heading-amount-of-work-or-level-of-difficulty">Amount of work or level of difficulty</h3>
<p>Each story is represented by a number of points. Those points are a way to express how much effort a team of developers expects one story to be. That effort can mean a variety of things though whether it's simply how difficult the team expects the work to be or the amount of risk or uncertainty a particular story has.</p>
<p>One way teams represent this is with the <a target="_blank" href="https://en.wikipedia.org/wiki/Fibonacci_number">fibonacci sequence</a>, where the amount of points can be 1, 2, 3, 5, 8, etc. Where a negligible text update might be 1 point, adding a new form to a page could be 3 points.</p>
<p>Typically you'll want to avoid pointing stories too high, as you get above 5 points, there's more than likely a way you can break up the work to make it more manageable. While you could easily create a massive 13 point story to accomplish all aspects of a feature, it usually makes sense to tackle the work in smaller, more focused chunks.</p>
<p>Either way, these points all add up together to give your team a rough estimate of how much work a group of stories would take to complete.</p>
<h2 id="heading-epics">Epics</h2>
<p>While stories have a goal of defining a bite-sized piece of work, epics are a way to group those pieces of work together to represent a feature.</p>
<h3 id="heading-defining-stories-as-a-feature">Defining stories as a feature</h3>
<p>A good way to explain this is with another example. If you're working on an application that requires the integration of authentication, you may want to create a new epic simply called "Authentication". </p>
<p>Inside that epic, you could find stories like:</p>
<ul>
<li>As a guest, I want to sign into the application with my email address</li>
<li>As an authenticated user, I want to change my password</li>
<li>As the security team, I want to prevent spam and abuse of user authentication</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/jira-epic-authentication.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Example of an Authentication epic in Jira</em></p>
<p>With your epic defined, you're giving your team a path to calling a feature complete while also understanding the entire scope of that work. This is important when it comes to planning out the work to be done.</p>
<p>Defining your stories in your epic gives you a sense of how much work something takes, but it doesn't help you figure out how long it would take, which is where sprints come in.</p>
<h2 id="heading-sprints">Sprints</h2>
<p>Sprints are a way of planning out how the work will actually get done. While similar to epics in that they are a way to group chunks of work, sprints typically represent a period of time in which a particular chunk of work will be done.</p>
<h3 id="heading-time-per-sprint">Time per sprint</h3>
<p>A common way of defining a sprint is two weeks of work. During those two weeks, your team will have a particular velocity, or average amount of work you can complete, for an individual sprint. This velocity is represented by a number of points that is a sum of the average velocity of each of the developers working on that sprint.</p>
<h3 id="heading-points-per-sprint">Points per sprint</h3>
<p>Though many fiercely argue you shouldn't use time to represent that velocity, points will roughly translates to an average amount of time of work for each developer. While 1 point for an experienced developer could be 1 hour, that same 1 point could mean 3 hours for a less experienced developer.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/jira-project-roadmaps.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Example project roadmap from <a target="_blank" href="https://www.atlassian.com/software/jira">atlassian.com/software/jira</a></em></p>
<p>But once you have this number of points that your team averages in a sprint, you'll know how many story points you can expect to plan to be completed. This planning goes sprint to sprint as you spread out a group of stories or an epic so you can predict when a feature will be complete.</p>
<h2 id="heading-how-agile-fits-with-your-team">How agile fits with your team</h2>
<p>Try to remember that the Agile methodology through Scrum, Kanban, or any other framework is just that – a framework. While it's probably a good idea to follow the process when you first start out, listen to your team and try to mold it to your own experiences.</p>
<p>Each team works a little bit differently and forcing a process onto that team can cause more harm than good, but there will always be a learning curve for any process. Fight the eye rolls until everyone gets the hang of it and have frequent retrospectives to see what works and what doesn't.</p>
<p>At the end of the day, the processes your team follows should mostly be invisible, working for you instead of against you. Find what works best for your team and share your experiences for others to learn!</p>
<h2 id="heading-whats-your-teams-process">What's your teams process?</h2>
<p><a target="_blank" href="https://twitter.com/colbyfayock">Share with me on Twitter!</a></p>
<div id="colbyfayock-author-card">
  <p>
    <a href="https://twitter.com/colbyfayock">
      <img src="https://res.cloudinary.com/fay/image/upload/w_2000,h_400,c_fill,q_auto,f_auto/w_1020,c_fit,co_rgb:007079,g_north_west,x_635,y_70,l_text:Source%20Sans%20Pro_64_line_spacing_-10_bold:Colby%20Fayock/w_1020,c_fit,co_rgb:383f43,g_west,x_635,y_6,l_text:Source%20Sans%20Pro_44_line_spacing_0_normal:Follow%20me%20for%20more%20JavaScript%252c%20UX%252c%20and%20other%20interesting%20things!/w_1020,c_fit,co_rgb:007079,g_south_west,x_635,y_70,l_text:Source%20Sans%20Pro_40_line_spacing_-10_semibold:colbyfayock.com/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_68,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_145,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_222,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/w_300,c_fit,co_rgb:7c848a,g_north_west,x_1725,y_295,l_text:Source%20Sans%20Pro_40_line_spacing_-10_normal:colbyfayock/v1/social-footer-card" alt="Follow me for more Javascript, UX, and other interesting things!" width="2000" height="400" loading="lazy">
    </a>
  </p>
  <ul>
    <li>
      <a href="https://twitter.com/colbyfayock">? Follow Me On Twitter</a>
    </li>
    <li>
      <a href="https://youtube.com/colbyfayock">?️ Subscribe To My Youtube</a>
    </li>
    <li>
      <a href="https://www.colbyfayock.com/newsletter/">✉️ Sign Up For My Newsletter</a>
    </li>
  </ul>
</div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Why Your Legacy Software is Hard to Maintain - and What to Do About it. ]]>
                </title>
                <description>
                    <![CDATA[ By Alfrick Opidi Believe it or not, some organizations still rely on legacy software to carry out operations even though newer and more versatile options are available. We know that “old is gold”, but legacy applications cannot glitter forever. As su... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/legacy-software-maintenance-challenges/</link>
                <guid isPermaLink="false">66d45d9dc7632f8bfbf1e3db</guid>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 28 Feb 2020 17:06:30 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9c5f740569d1a4ca31cb.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Alfrick Opidi</p>
<p>Believe it or not, some organizations still rely on legacy software to carry out operations even though newer and more versatile options are available. We know that “old is gold”, but legacy applications cannot glitter forever. As such, these old and outdated programs have become hard to maintain.</p>
<p>Recently, the U.S. Government Accountability Office (GAO) gave a <a target="_blank" href="https://www.gao.gov/products/gao-19-471#summary">report</a> that pointed out the most critical federal legacy systems that need to be modernized. This is because they are based on antiquated programming languages, are prone to security loopholes, and are difficult to maintain.</p>
<p>Are you in the same shoes?</p>
<p>In this article, I’m going to talk frankly about the challenges you'll face when maintaining legacy software applications, and how you can overcome them.</p>
<h2 id="heading-legacy-systems-are-inefficient">Legacy systems are inefficient</h2>
<p>Software maintenance is important – it helps enhance the efficiency of the product and narrows the margin for error. Without sufficient maintenance, an application can become inefficient and difficult to operate.</p>
<p>First of all, maintaining <a target="_blank" href="https://www.freecodecamp.org/news/conquer-legacy-code-f9e23a6ab758/">a legacy system</a> can be difficult because the code used is old when compared to the code used in any modern software. Old code usually tends to be bulky, lengthy, and incompatible with most modern systems.</p>
<p>For example, JavaScript arrow functions, which were introduced in ES6 in 2015, offer developers a way to write shorter and cleaner function syntax, which is easier to maintain.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> total = <span class="hljs-function">(<span class="hljs-params">x, y</span>) =&gt;</span> x + y;

<span class="hljs-comment">/* This arrow function is a shorter form of:
let total = function(x, y) {
  return x + y;
};
*/</span>

<span class="hljs-built_in">console</span>.log(total(<span class="hljs-number">5</span>, <span class="hljs-number">2</span>) ); 
<span class="hljs-comment">// 7</span>
</code></pre>
<h2 id="heading-high-maintenance-costs">High maintenance costs</h2>
<p>Another challenge facing most legacy systems is the high cost of maintenance, which may be out of reach for most enterprises. </p>
<p>For example, according to the GAO report mentioned above, the U.S. government planned to spend more than $90 billion in 2019 on IT services, most of which went towards maintaining aging systems.</p>
<p>Furthermore, as technology is evolving, compliance is becoming a major issue for the protection of consumer-facing applications. Achieving compliance with legacy systems is time-consuming and expensive. It will not happen as quickly compared to new applications who are often compliant by default. It also requires a lot of testing to ensure a legacy infrastructure is compliant with the given regulations.</p>
<p>The cost of maintaining a legacy system often increases with time, as it slowly becomes obsolete due to technological enhancements. Also, modification of an existing system is a risky venture, which requires a lot of time and resources.</p>
<h2 id="heading-lack-of-sufficient-skill-sets">Lack of sufficient skill sets</h2>
<p>For legacy software to be maintained, you need a developer conversant with its operations. However, most developers are future-proofing their applications with new technologies. So, getting someone who can work with an old system can be a challenge.</p>
<p>In some cases, you might need to re-train developers on how the legacy system works, which increases a company’s operating costs. </p>
<p>Furthermore, managing and controlling changes occurring in the software can be difficult. A lot of time and effort is required to keep the systems operational, which is expensive and time-consuming.</p>
<h2 id="heading-incompatibility-with-other-it-solutions">Incompatibility with other IT solutions</h2>
<p>Currently, there are modern tools that can be used to enable fast and smooth maintenance of software. However, most legacy IT infrastructure is incompatible with such solutions, which complicates their maintenance. </p>
<p>If the features in a legacy system are not compatible with those of new IT solutions, developers may find it difficult to integrate them into their environments.</p>
<p>The difficulty of introducing new features to legacy systems also adds to the challenges in their maintenance. Since most legacy systems break easily, trying to restructure and make them more maintainable may not work as expected.</p>
<h2 id="heading-solutions-to-the-challenges">Solutions to the challenges</h2>
<p>To compete favorably in today’s dynamic IT landscape, legacy technologies need modernization. Updated legacy applications lead to more user productivity, reduced maintenance costs, and more helpful experiences.</p>
<p>According to recent research by <a target="_blank" href="https://www.avanade.com/en/media-center/press-releases/it-modernization-research">Avanade</a>, modernizing IT systems can lead to a revenue growth of about 14%. Therefore, choosing <a target="_blank" href="https://www.scnsoft.com/services/application/modernization">different software modernization options</a> could lead to significant benefits to your business.</p>
<p>It’s important to note that software should not be declared obsolete just because it’s old. Some of the ‘old’ software may still contain rich features, which can be useful to the optimal functioning of an application.</p>
<p>Therefore, to overcome the challenges of maintaining aging software, developers can opt to refactor the source code of the system. This way, they can use clean and modern code that is reusable and easy to debug.</p>
<p>In refactoring, you alter your software system to enhance its internal structure. But you don't interfere with the external behavior of the code. This way, the features of the software are optimized due to the code's internal improvements.</p>
<p>When refactoring legacy code, updates and modifications should be sufficiently tested to avoid breakages and poor functioning of the application. For example, regression tests can be done to ensure that everything is working as desired.</p>
<p>Additionally, where resources permit, developers can opt to rewrite the entire source code of the software, while employing modern programming approaches.</p>
<p>If you want to continue maintaining your legacy code without breaking it, you can use any of the following three methods:</p>
<ol>
<li>Identifying change points in the code</li>
<li>Isolating your code</li>
<li>Wrapping the code</li>
</ol>
<p>Let's talk about each of the methods.</p>
<h3 id="heading-identify-change-points-in-the-code">Identify change points in the code</h3>
<p>As pointed out earlier, maintaining legacy code can be challenging. Sometimes the issue can be caused by a section that has been poorly programmed. Therefore, you can overcome this by identifying a location that can allow you to change the application's behavior without altering the source code. </p>
<p>For example, let's say you have the following JavaScript code in a legacy application that connects to a database:</p>
<pre><code class="lang-js"><span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DataConnection</span> </span>{
     <span class="hljs-comment">//some code here</span>

  connector() {
    <span class="hljs-comment">// some code to connect to database</span>
  }
}
</code></pre>
<p>If you want to run some tests on the above code but the the <strong>connector()</strong> method is causing problems, you can identify where to modify the code behavior without affecting the source code.</p>
<p>In this case, you can extend the <strong>DataConnection</strong> class and stop it from establishing a connection to an actual database:</p>
<pre><code class="lang-js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">FakeConnection</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">DataConnection</span> </span>{

    connector() {
    <span class="hljs-comment">// solve the issues of making calls to DB</span>

    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Establishing a connection"</span>)
  }
}
</code></pre>
<p>Consequently, after modifying the code behavior without affecting the source code, you can run tests on the code and maintain it without any problems. </p>
<h3 id="heading-isolate-your-code">Isolate your code</h3>
<p>Another technique that can allow you to maintain your legacy code easily is to isolate and make any changes on a different environment. You just need to identify an insertion point where you can call that changed code from the existing legacy code. </p>
<p>Here is an example:</p>
<pre><code class="lang-js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">BooksData</span> </span>{
  <span class="hljs-comment">// some code here</span>

  addBooks(books) {
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> book <span class="hljs-keyword">of</span> books) {
      book.addDate()
    }

    <span class="hljs-comment">// some code here</span>

    booksRecords.getNumberOfBooks().add(books)
  }

  <span class="hljs-comment">// some code here</span>
}
</code></pre>
<p>Let's say you want to optimize the <strong>books</strong> reference in the above legacy code, but <strong>addBooks()</strong> is giving you problems. </p>
<p>So, you can isolate the code in another new method, like <strong>newBooks().</strong> </p>
<p>Then you can run tests on this new method successfully because it is separate from the rest of the code. Afterwards, you can include a call to the new method in the existing, non-changed code. This way, there'll be minimal changes and minimal risks to the legacy code. </p>
<p>Here it is:</p>
<pre><code class="lang-js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">BooksData</span> </span>{
  <span class="hljs-comment">// some code here</span>

  newBooks(books) {
    <span class="hljs-comment">// some smart and testable logic to optimize books</span>
  }

  addBooks(books) {
    <span class="hljs-keyword">const</span> newBooks = <span class="hljs-built_in">this</span>.newBooks(books)

    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> book <span class="hljs-keyword">of</span> newBooks) {
      book.addDate()
    }

    <span class="hljs-comment">// some code here</span>

     booksRecords.getNumberOfBooks().add(books)
  }

  <span class="hljs-comment">// some code here</span>
}
</code></pre>
<h3 id="heading-wrap-the-code">Wrap the code</h3>
<p>If you want to make changes that should take place before or after the existing code, wrapping it can also be another solution. </p>
<p>You can achieve this by giving the old method you intend to wrap a new name, adding a new method with the same name and signature just like the old method, and calling the new method from the new method. Lastly, you should place the new logic before or after the previous method call. </p>
<p>With the new logic, you can run tests or make any changes you want – without affecting the source code. </p>
<p>For example, here is the code we used previously:</p>
<pre><code class="lang-js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">BooksData</span> </span>{
  <span class="hljs-comment">// some code here</span>

  addBooks(books) {
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> book <span class="hljs-keyword">of</span> books) {
      book.addDate()
    }

    <span class="hljs-comment">// some code here</span>

    booksRecords.getNumberOfBooks().add(books)
  }

  <span class="hljs-comment">// some code here</span>
}
</code></pre>
<p>Here is how to solve the problem through wrapping:</p>
<pre><code class="lang-js"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">BooksData</span> </span>{
  <span class="hljs-comment">// some code here</span>

  addBooks(books) {
    <span class="hljs-comment">// some smart logic to get books</span>
    <span class="hljs-built_in">this</span>.addMoreNewBooks(moreBooks)
  }

  addMoreNewBooks(books) {
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> book <span class="hljs-keyword">of</span> books) {
      book.addDate()
    }

    <span class="hljs-comment">// some code here</span>

    booksRecords.getNumberOfBooks().add(books)
  }

  <span class="hljs-comment">// some code here</span>
}
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Although modernizing antique software is complicated, demanding, and risky, the results are usually worth the risk. Continuing to rely on legacy IT systems is the same as continuing to use the post office to send an urgent message, while an email could do the trick at the click of the button.</p>
<p>Furthermore, as a programmer, do you equip yourself with modern coding skills? Or, do you still rely on old approaches?</p>
<p>For example, in the exciting world of JavaScript programming, we’ve witnessed a surge of frameworks, like React and Angular, which are defining the future of the language. Spending some time learning about them could prevent you from falling into obsoleteness.</p>
<p>Do you agree?</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ SDLC Guide – Software Development Life Cycle Phases and Methodologies ]]>
                </title>
                <description>
                    <![CDATA[ By Jonathan Sexton When I decided to teach myself how to code almost four years ago I had never heard of, let alone thought about, the software development life cycle. As a brand new developer I was focused on learning the technologies that would hel... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/get-a-basic-understanding-of-the-life-cycles-of-software-development/</link>
                <guid isPermaLink="false">66d45f6a36c45a88f96b7cef</guid>
                
                    <category>
                        <![CDATA[ agile development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 24 Feb 2020 12:00:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/02/suzanne-d-williams-VMKBFR6r_jg-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Jonathan Sexton</p>
<p>When I decided to teach myself how to code almost four years ago I had never heard of, let alone thought about, the software development life cycle.</p>
<p>As a brand new developer I was focused on learning the technologies that would help me land that coveted first developer job, not the nuances of how those teams operated.</p>
<p>When I did learn of them, I thought they would be useless to me because I considered myself a web developer not a software developer.</p>
<p>I've since learned that this couldn't be further from the truth and these principles/practices play a large role in my day-to-day activities (whether I realize it or not).</p>
<p>I'm fortunate enough to see how the code I write, the features I build, and the bugs I inadvertently introduce (more than I care to admit) affect the end user and their experience. That experience has helped shape how I think about the process of building products and solving problems for my users.</p>
<p>I've had some time to think about the differences (and similarities) each of these approaches offer. At their core, each is focused on delivering high quality software as efficiently and as cost effectively as possible.</p>
<p>Professionally, I've only used one or two of these methodologies. But I still find value in at least a basic understanding of all of them.</p>
<p>All of these methodologies follow a series of phases similar to this diagram:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/02/SDLC_-_Software_Development_Life_Cycle.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Requirement Analysis -&gt; Design -&gt; Implementation -&gt; Testing -&gt; Evolution</em></p>
<p>So, here are the software development life cycle methods (in no particular order):</p>
<ul>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/Lean_software_development">Lean</a></li>
<li><a target="_blank" href="https://www.agilealliance.org/agile101/">Agile</a></li>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/Waterfall_model">Waterfall</a></li>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/Iterative_and_incremental_development">Iterative</a></li>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/Spiral_model">Spiral</a></li>
<li><a target="_blank" href="https://en.wikipedia.org/wiki/DevOps">Dev Ops</a></li>
</ul>
<p>Let's dig in to the differences and similarities of each method.</p>
<h2 id="heading-lean">Lean</h2>
<p>The Lean methodology relies heavily on and is comprised of seven principles. </p>
<p>In no specific order they are:</p>
<ol>
<li>Eliminate Waste</li>
<li>Amplify Learning</li>
<li>Decide As Late As Possible</li>
<li>Deliver As Fast As Possible</li>
<li>Empower The Team</li>
<li>Build Integrity</li>
<li>See/Optimize The Whole</li>
</ol>
<p>Each principle has a specific purpose with benefits that compliment each other.</p>
<p><em>Eliminating waste</em> (extra features, incomplete work, managerial engagements, etc) creates more value for the customer which, in turn, enhances satisfaction.</p>
<p><em>Amplifying learning</em> allows teams to reinvest in their ability to deliver products to customers.</p>
<p><em>Deciding as late as possible</em> refers to all major decisions, giving teams an option based or a set based approach.  This allows teams to gather facts rather than opinions to help influence decisions when made.</p>
<p><em>Delivering as fast as possible</em> is self explanatory - build the product as quickly as possible to deliver it to customers for evaluation/iteration.</p>
<p>In a typical scenario, the managers dole out assignments/work to the developers. In the Lean methodology developers "teach" managers how to listen to the "people in the trenches" thus influencing the decisions/choices of management.</p>
<p>This helps teams feel more <em>empowered</em> to speak up about ides and solutions.</p>
<p>Making <em>integrity</em> a rule instead of an exception means that the customer is confident in the system being built. The customer knows the system is being built to withstand the appropriate amount of growth and "stretching" if need be.</p>
<p>I like to think of the integrity part along the same lines as sitting in a chair. When you sit in the chair you believe it was constructed with the best material that will hold you up every time you sit in it for the life of the chair. The customer needs to that same confidence in the product being built.</p>
<p>Lastly, <em>seeing and optimizing the whole</em> refers to the entirety of the system being built. By optimizing for the whole we look at software not as a sum of many components, but as one large entity that is optimized for efficiency.</p>
<p>This means that during development, the product is broken into manageable pieces and that inadvertent bugs are not only discovered but resolved swiftly.</p>
<h2 id="heading-agile">Agile</h2>
<p>This is the "fail fast" approach to building software.</p>
<p>It places emphasis on small, incremental releases with on-going release cycles. With each iteration teams strive to identify and address small issues before they become big problems.</p>
<p>This also means that the teams must engage stakeholders (people/organizations that the code can ultimately affect such as managers, technical leads, CTOs, and customers) to get their feedback.</p>
<p>If you're a freelance, your stakeholder(s) would be your customers - ultimately you need to ensure their satisfaction with the work before moving on.</p>
<p>Agile is technically an offshoot of the Lean methodology with some notable differences - mainly it prioritizes customer satisfaction from the outset and allows teams to respond quickly to customer feedback.</p>
<p>Although it is beyond the purview of this article, there is another more complex framework within Agile that is called <a target="_blank" href="https://en.wikipedia.org/wiki/Scrum_%28software_development%29">SCRUM</a>. This methodology is used for large, extremely complex projects and has even been used outside of software development.</p>
<h2 id="heading-waterfall">Waterfall</h2>
<p>The waterfall methodology is, by most accounts, the oldest one in the list. It was never meant to be a model for software development and got its start in the construction and manufacturing worlds.</p>
<p>This approach is simple in its structure - finish all parts of a phase before moving on to the next phase with more momentum building towards the project finish as stages are completed. Each stage's beginning (except for the first) and completion is contingent on the previous stage's completion/transfer of information.</p>
<p>Under the waterfall approach each stage has its own rigid project plan that finishes off with testing for previously completed work. It should be noted that this approach is not recommended for larger/longer lasting projects because of the aforementioned rigidity.</p>
<p>Think about the genesis of this methodology and you'll understand it more. It came from the construction/manufacturing world where it is common to complete one phase at a time. During the building of a house you wouldn't start putting in the plumbing before the frame has been put up.</p>
<p>That's not the way software development works generally. As we all know it sometimes becomes necessary to revisit a phase that was previously thought to be finished.</p>
<h2 id="heading-iterative">Iterative</h2>
<p>This is known as the "repetitive approach" or the "make it better the next go around" approach because of the different opportunities it provides to improve the product with each cycle iteration.</p>
<p>I'm biased (as we all are :D) but this happens to be my favorite life cycle for development.  I believe it works best for my current situation  both in my freelance and career path because it allows me to constantly "move forward while making things better."</p>
<p>With the iterative approach, teams implement a solution, test that solution, evaluate its effectiveness/throughput, and then pinpoint further areas for improvement. This happens for each cycle (iteration) of the development process.</p>
<p>With each version released comes another iteration until the final product is completed and ready for rollout to users.</p>
<p>One of the great features of the iterative approach is you and your team get a working version of software early on in the development process.  This can be especially useful to show to stakeholders to gauge their response/feedback.</p>
<p>One of the big drawbacks to this approach is it can consume a large amount of resources very quickly. Imagine all of the people, hours, bug fixes and wages that go into each iteration of the development cycle and you'll get a good picture of the resource usage.</p>
<p>Within this approach is a subset of principles developed by Rational Software Corporation (bought by IBM) called the <a target="_blank" href="https://en.wikipedia.org/wiki/Rational_Unified_Process">Rational Unified Process (R.U.P.)</a> which consists of 4 phases:</p>
<ul>
<li>Inception</li>
<li>Elaboration</li>
<li>Construction</li>
<li>Transition (product release)</li>
</ul>
<p>This set of principles is meant to be flexible and tailored to the needs of each team using it.</p>
<h2 id="heading-spiral">Spiral</h2>
<p>The spiral methodology is likely the most flexible out of the six.  It's a methodology built on risks - identifying and negating them. Risk (identification &amp; aversion) drives every decision in this model. It is broken into four sub-phases:</p>
<ul>
<li>Planning (objectives)</li>
<li>Risk Analysis (identify possible roadblocks)</li>
<li>Develop &amp; Test (current &amp; next version)</li>
<li>Evaluation (review of current phase &amp; plan for next phase)</li>
</ul>
<p>Each iteration of each phase begins with planning for the next phase. This way potential risks are identified before they are encountered. This also allows for a plan of action when said risks arise.</p>
<p>During phases teams also work to mitigate these risks and their impact on future iterations of the spiral development.</p>
<p>As the development process continues, each of these four sub-phases is repeated in spiral fashion. This allows for multiple rounds of refinement for each sub-phase until completion.</p>
<h2 id="heading-dev-ops">Dev Ops</h2>
<p>If you do a quick search, you will find no shortage of information on this development life cycle method. It is the new kid on the block that brings software development and information-technology operations teams into the same fold.</p>
<p>These teams work in conjunction to provide small, but impactful, updates to products that come at a frequent pace. In turn, this creates a continuous feedback and improvement loop that drives development.</p>
<p>This particular methodology is known for automating the manual parts of development as well (think deployment).</p>
<p>The overall goal of this methodology is, like most others, the shorten the development life cycle and provide quality products.</p>
<p>One of the drawbacks to this methodology is the significant mindset and culture changes within an organization. Teams that may have been accustomed to working on many things find their tasks narrowed to only one or two.</p>
<p>For example, a general purpose developer may find they are now being tasked with only the testing portion or the end-user experience portion.</p>
<h2 id="heading-bringing-it-all-home">Bringing It All Home</h2>
<p><img src="https://jonathansexton.me/blog/wp-content/uploads/2020/02/clever-visuals-iMwiPZNX3SI-unsplash-1024x690.jpg" alt="a light bulb on a book" width="600" height="400" loading="lazy">
_Photo by [Unsplash](https://unsplash.com/@clever_visuals?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"&gt;Clever Visuals on &lt;a href="https://unsplash.com/s/photos/bright-idea?utm_source=unsplash&amp;utm_medium=referral&amp;utm<em>content=creditCopyText)</em></p>
<p>I hope you can now see the importance and the benefits of each of these methodologies. Each of these possess their own strengths and weaknesses.</p>
<p>They are, at their most basic level, a set of guidelines and principles that seek to deliver high quality, efficient work to stakeholders.</p>
<p>When I first started learning to code I didn't have a mentor. By sharing what I've learned I hope to help those who are learning to code when/where they can.</p>
<p>I want to share as much information and experience as I possibly can with other developers.  If you are teaching yourself to code or if you're a seasoned developer I hope this article helps, even if in a small way.</p>
<p>Check out my <a target="_blank" href="https://jonathansexton.me/blog">blog</a> where I frequently post articles about web development.</p>
<p>While you're there why not sign up for my newsletter? You can do  that at the top right of the main blog page.  I like to send out  interesting articles (mine and others), resources, and tools for  developers every now and then.</p>
<p>If you have questions about this article or just in general my DMs are open -- come say hi on <a target="_blank" href="https://twitter.com/jj_goose">Twitter</a> or any of my other social media accounts which you can find below the  newsletter sign up on the main page or on my profile here :)</p>
<p>Have an awesome day and happy coding, friend!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Software Resources for Nonprofits ]]>
                </title>
                <description>
                    <![CDATA[ Please note that freeCodeCamp is not partnered with, nor do we receive a referral fee from, any of the following providers. We simply want to help guide you toward a solution for your organization. Skills-based Volunteer Organizations: FindCollabs G... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/software-resources-for-nonprofits/</link>
                <guid isPermaLink="false">66b8d57fbebc010ace8fe6da</guid>
                
                    <category>
                        <![CDATA[ nonprofit ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Quincy Larson ]]>
                </dc:creator>
                <pubDate>Sat, 09 Nov 2019 18:03:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9f79740569d1a4ca42c5.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Please note that freeCodeCamp is not partnered with, nor do we receive a referral fee from, any of the following providers. We simply want to help guide you toward a solution for your organization.</p>
<h3 id="heading-skills-based-volunteer-organizations">Skills-based Volunteer Organizations:</h3>
<ul>
<li><a target="_blank" href="https://findcollabs.com">FindCollabs</a></li>
<li><a target="_blank" href="http://givecamp.org/">Give Camp</a></li>
<li><a target="_blank" href="http://www.volunteermatch.com/">Volunteer Match</a></li>
<li><a target="_blank" href="http://www.catchafire.org/">Catchafire</a></li>
<li><a target="_blank" href="http://anyonecanhaveawebsite.com/">Anyone Can Have A Website</a></li>
</ul>
<h3 id="heading-building-a-website">Building a website:</h3>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=4AXDKWuY9QM">How to build and deploy a website without writing any code for free</a></li>
<li><a target="_blank" href="http://www.wix.com/">Wix</a></li>
<li><a target="_blank" href="https://www.squarespace.com/">Square Space</a></li>
<li><a target="_blank" href="https://wordpress.com/">WordPress</a></li>
<li><a target="_blank" href="https://xprs.imcreator.com/">Imcreator.com</a></li>
</ul>
<h3 id="heading-donor-and-volunteer-management-systems">Donor and Volunteer Management Systems:</h3>
<ul>
<li><a target="_blank" href="http://causesignal.com/">Cause Signal</a></li>
<li><a target="_blank" href="https://www.thedatabank.com/">The Data Bank</a></li>
<li><a target="_blank" href="http://www.donorsnap.com/">Donor Snap</a></li>
<li><a target="_blank" href="http://www.donorperfect.com/">Donor Perfect</a></li>
<li><a target="_blank" href="https://www.blackbaud.com/fundraising-crm/etapestry-donor-management">E Tapestry</a></li>
<li><a target="_blank" href="http://www.z2systems.com/">Z2 Systems</a></li>
<li><a target="_blank" href="http://www.regpacks.com/volunteer-management">Reg Packs</a></li>
<li><a target="_blank" href="http://sumac.com/">Sumac</a></li>
<li><a target="_blank" href="http://www.volgistics.com/">Volgistics</a></li>
</ul>
<h3 id="heading-inventory-management-systems">Inventory Management Systems:</h3>
<ul>
<li><a target="_blank" href="https://www.ordoro.com/">Ordoro</a></li>
<li><a target="_blank" href="http://www.unleashedsoftware.com/">Unleashed Software</a></li>
<li><a target="_blank" href="https://www.ezofficeinventory.com/industries/non-profits">EZ Office Inventory</a></li>
</ul>
<h3 id="heading-e-learning-platforms">E-Learning platforms:</h3>
<ul>
<li><a target="_blank" href="http://www.dokeos.com/">Dokeos</a></li>
<li><a target="_blank" href="http://www.efrontlearning.net/">E Front Learning</a></li>
<li><a target="_blank" href="https://moodle.org/">Moodle</a></li>
<li><a target="_blank" href="https://sakaiproject.org/">Sakai Project</a></li>
</ul>
<h3 id="heading-community-management">Community Management:</h3>
<ul>
<li><a target="_blank" href="https://civicrm.org/">CiviCRM</a></li>
<li><a target="_blank" href="http://tcmgr.com/">Total Community Manager</a></li>
</ul>
<h3 id="heading-electronic-forms">Electronic Forms:</h3>
<ul>
<li><a target="_blank" href="http://www.typeform.com/">Typeform</a></li>
<li><a target="_blank" href="http://www.google.com/forms">Google Forms</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to boost your front-end application’s performance ]]>
                </title>
                <description>
                    <![CDATA[ By Dimitris Kiriakakis If your website takes longer than 3 seconds to load, you could already be losing nearly half of your visitors. Yes this is a fact, proven by several research studies. Long loading times can have a devastating impact on your app... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-boost-your-front-end-applications-performance-72ce872b08c/</link>
                <guid isPermaLink="false">66d45e3dd1ffc3d3eb89ddd5</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ performance ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 18 Apr 2019 19:19:17 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*Vmq3ETGdUZPZe9vZu6CkVg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dimitris Kiriakakis</p>
<p>If your website takes longer than 3 seconds to load, you could already be losing nearly half of your visitors.</p>
<p>Yes this is a fact, proven by several research studies. Long loading times can have a <strong>devastating</strong> impact on your application’s conversion rates. On the other hand, optimising page load time leads to noticeable improvements in customer experience, conversion rates, SEO and ultimately, your product’s <strong>success</strong>.</p>
<p>So let’s say that you have recently built a website or a frontend application using a modern JS framework (Angular, React, VueJS etc.). How can we make sure that performance is not going to hold it back from success?</p>
<p>First things first. We have to somehow gather some <strong>data</strong>. When it comes to measuring a frontend application’s performance, the tools I trust the most are:</p>
<ul>
<li>Google chrome’s <a target="_blank" href="https://developers.google.com/web/tools/lighthouse/">Lighthouse</a></li>
<li><a target="_blank" href="https://speedcurve.com/">Speedcurve</a></li>
</ul>
<p>Both tools can help you keep track of all the major performance KPIs (Pagespeed Index, Time to Interactive, First Contentful Paint, etc.).</p>
<p><strong>Lighthouse</strong> is included in your Chrome’s dev-tools, and by analysing your website/web-app, it can give you some really useful hints on how to boost it up.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/To1jGG1giiJeWCpEVTGl1v2Hznyz4eKcRncT" alt="Image" width="800" height="331" loading="lazy">
<em>Chrome’s lighthouse can give you some really helpful hints</em></p>
<p>With <strong>Speedcurve</strong> you can have all these KPIs, plus the ability to monitor them across time.</p>
<p>So now that we are able to measure our success, let’s move on with optimising the parts of our website that play the biggest role.</p>
<h3 id="heading-images">Images</h3>
<p>Images are a key part of every website. On average, images make up for more than 60% of data that are loaded on web pages. Being such a critical component of almost all websites, image optimisation is, in my opinion, the most important, and perhaps the lowest hanging fruit.</p>
<h4 id="heading-1-resize-your-images-and-make-them-responsive">1. Resize your images and make them responsive.</h4>
<p>The most important thing to check is that you are not using a bigger resolution than the one you really need. So you have to resize your images to fit exactly the requirements of your layout.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/PqV7uCLjZMyaZwwkQbMDtml61iC9UktvPOjm" alt="Image" width="639" height="380" loading="lazy">
<em>Responsive layouts need responsive images</em></p>
<p>Furthermore, you have to make sure that your images are as <strong>responsive</strong> as your layout is. There is a great tool that I have been using lately, which can help you generate all the different versions of the images that you might need and also generate the HTML5 code that can utilise them. It’s called <a target="_blank" href="https://www.responsivebreakpoints.com/">Responsive Image Breakpoints Generator</a>. I usually prefer generating 8–10 different images.</p>
<p>Of course you can use the generated HTML5 code in any frontend app or website. In addition, if you are into gulp, you could automate this process with the <a target="_blank" href="https://github.com/mahnunchik/gulp-responsive">gulp-responsive</a> plugin.</p>
<h4 id="heading-2-make-sure-they-are-lazy-loaded">2. Make sure they are lazy loaded.</h4>
<p>Lazy loading basically means that we defer the loading of images that are not required immediately. Typically, any image that is not visible to the users on their current viewport, can be loaded at a later point in time, when the image enters or is about to enter the viewport.</p>
<p>No matter which framework you are using, you can find a plugin that can lazy-load the images for you (e.g. <a target="_blank" href="https://github.com/alexjoverm/v-lazy-image">v-lazy-image</a> in VueJS), however you could build your own implementation too. Just make sure that you are utilising the modern way to detect when an element enters or exits the browser’s viewport, the <a target="_blank" href="https://github.com/alexjoverm/v-lazy-image">IntersesectionObserver API</a>.</p>
<h4 id="heading-bonus-use-a-cdn-for-image-delivery">Bonus: Use a CDN for image delivery</h4>
<p>If you have already optimised the size and the number of images that your website loads, and especially if it’s going to be available globally, you could also use a <strong>content delivery network</strong> (CDN) to serve them.</p>
<p>In a few words, a CDN caches your images on its globally distributed network of servers. So if a user from Australia requests an image from your website, instead of retrieving that image from your server in Europe, the CDN is going to deliver it from another one, closer to that user in Australia. This cuts down the round trip time needed to load the image.</p>
<h3 id="heading-css-js-and-html">CSS, JS and HTML</h3>
<p>All modern frameworks optimise your code during the production build time (code-splitting, tree-shaking, minification, etc.). What you can do on top of that?</p>
<h4 id="heading-1-optimise-the-main-html-document">1. Optimise the main HTML document</h4>
<p>HTML is the backbone of nearly every web app. When it comes to referencing resources within your HTML document there are a few best practices you should follow. It is recommended to:</p>
<ul>
<li>Place CSS references at the top of your HTML document’s header in order to ensure progressive rendering.</li>
<li>Place JavaScript attributes at the bottom of your HTML body and <a target="_blank" href="https://www.w3schools.com/tags/att_script_async.asp">prefer async script loading</a>. This will prevent any <code>&lt;scri</code>pt&gt; tags from blocking the HTML rendering process.</li>
</ul>
<h4 id="heading-2-make-sure-you-only-load-what-you-need">2. Make sure you only load what you need</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/YjYDfAVFIYx91chGjMBSGUhruQJs4vWHxMKB" alt="Image" width="560" height="315" loading="lazy">
<em>Lazy loading components and modules</em></p>
<p>Angular, React, and VueJS all provide you with lazy-loading features. You only have to split your code properly, according to your own needs and load only the modules that you need, as soon as you really need them. For instance, if you have an e-commerce app, you have to make sure that the Basket module or the Payments module are not loaded when the user is in the home page.</p>
<h3 id="heading-compression-amp-caching">Compression &amp; Caching</h3>
<p>In general, for all the assets that are essential to your frontend (images &amp; code) you should apply compression and cache them properly.</p>
<p>File compression will make your app’s assets a bit lighter and decrease the round trip time needed to serve them. One of the most commonly used file compression methods is <strong>Gzip</strong>, an excellent method for shrinking code chunks, documents, images and audio files.</p>
<p><a target="_blank" href="https://github.com/google/brotli"><strong>Brotli</strong></a> is another file compression algorithm, and it’s growing in popularity. This open source algorithm is regularly updated by software engineers from Google and other organisations. It has proven itself to compress files at a <strong>much better ratio</strong> than other existing methods.</p>
<p>You can enable your preferred compression method on nginx, apache or whichever server you are using, by modifying their configuration files (<a target="_blank" href="https://www.howtoforge.com/tutorial/how-to-install-nginx-with-brotli-compression-on-ubuntu-1804/">enabling brotli on nginx</a> or <a target="_blank" href="https://ayesh.me/apache-brotli">enabling brotli on apache</a>).</p>
<p>When it comes to caching, the most commonly used caching technique (also recommended by Lighthouse) is called <strong>Leverage Browser Caching</strong>. Again, you can enable it by modifying your server’s configuration files (<a target="_blank" href="https://www.keycdn.com/blog/leverage-browser-caching">enabling Leverage Browser Caching</a>).</p>
<h3 id="heading-summary">Summary</h3>
<p>When it comes to websites and frontend applications, performance is a huge topic and we should take it seriously.</p>
<p>I hope this article helped you understand and enabled you to tackle some of the most important things that we need to take care of when we want to improve an application’s performance.</p>
<p>For a detailed checklist, make sure that you check out the <a target="_blank" href="http://ront-End-Performance-Checklist">Front-End-Performance-Checklist</a>.</p>
<p>Cheers! ?</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ A Dummy’s Guide to Distributed Queues ]]>
                </title>
                <description>
                    <![CDATA[ By Zhia Hwa Chong If you’ve ever wondered what Kafka, Heron, real-time streaming, SQS or RabbitMQ are all about, then this article is for you. I’ll discuss in detail why we need a queue for today’s modern software architecture, what are some common t... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/a-dummys-guide-to-distributed-queues-2cd358d83780/</link>
                <guid isPermaLink="false">66c34276790a62b5fbf7b84a</guid>
                
                    <category>
                        <![CDATA[ coding ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Microservices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 18 Apr 2019 18:07:41 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*Zocw-AFNgC0VDbNWp8dD_g.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Zhia Hwa Chong</p>
<p>If you’ve ever wondered what <em>Kafka, Heron, real-time streaming, SQS or RabbitMQ</em> are all about, then this article is for you. I’ll discuss in detail why we need a queue for today’s modern software architecture, what are some common technologies used, and how queues are commonly used in the industry. If you enjoy this article, I have <a target="_blank" href="https://docs.google.com/document/d/1PeK69h4H82rwKjhactiE_sAIorCcZgXgXTY7k-nXpnE/edit#heading=h.hs0b333nsxch">a course</a> on scaling distributed systems where I discuss these topics in more detail.</p>
<p>OK, let’s get into it!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/K6pTed3Kg7OFpcJQ0Xnw7Et3tZfnBxE7eyYA" alt="Image" width="800" height="349" loading="lazy">
<em>A Dummy’s Guide to Queues</em></p>
<h3 id="heading-first-and-foremost-why-do-you-need-a-queuemessage-broker">First and foremost, why do you need a queue/message broker?</h3>
<h4 id="heading-the-story-of-how-a-queue-saved-the-lemonade-stands">The story of how a queue saved the lemonade stands</h4>
<p>Imagine that you are running a lemonade ? stand, and you built out a nifty little web-app that k<strong>eeps track of how often your clients return to your lemonade stand.</strong></p>
<p>Your web-app has an endpoint, say <em>yourlemonade.com/traffic,</em> and every time you click on a button, the traffic count goes up by 1. Beautiful.</p>
<p>As the traffic to your lemonade stand increases, you click the button more and more. Well, since you’re living in a relatively small neighborhood, you only get 10–20 people per day. Your sales proceed as usual, the web-app handles the traffic just fine, and everything is fine and dandy. Perfect.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/jrK32XGr77EfzxDmZeW826mPAjdk6UtC2H8M" alt="Image" width="800" height="403" loading="lazy">
<em>Your lemonade stand web-app</em></p>
<h4 id="heading-the-nightmare-of-a-booming-business">The nightmare of a booming business</h4>
<p>Now that your lemonade stand has made a name for itself, people from across the city are flocking in to get a taste of your famous lemonade. And on a beautiful Sunday morning, the local news decided to promote your stand, and the traffic <strong><em>EXPLODES</em></strong><em>.</em></p>
<p>As you can imagine, the traffic to your lemonade stand increases from 10–20 people per day to 10,000 per day. You’re tapping the traffic button furiously, which in turns triggers a call to <em>yourlemonade.com/traffic,</em> and your web app keeps incrementing the amount of traffic.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/CAfEJi3inzoxhwfo9TkAfFqZcmEufwwoDwcG" alt="Image" width="800" height="334" loading="lazy">
<em>Lemonade stand business runs into bottleneck</em></p>
<p>Unfortunately, your web-app is hosted on an 8-bit, 128MB RAM server in your house garage. With the booming business and increased traffic, your web-app cannot handle the scale of traffic any longer.</p>
<p>Eventually, your server dies. ☠️</p>
<p>With that, your entire web app is brought down. You can’t keep track of traffic anymore. People are rushing in, orders are piling up, yet your web-app is down and you can’t handle any transactions until you can start logging the traffic again.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-DgDUsY9jVdJr2WNoenY0K1gyLH1KvM9kw4m" alt="Image" width="800" height="328" loading="lazy">
<em>Traffic brought down your web-app, and business too.</em></p>
<p>What do you do?</p>
<h4 id="heading-queue-to-the-rescue">Queue to the rescue</h4>
<p>A moment of brilliance strikes you, <em>what if I place a box in front of the counter where each client can just drop a note saying they were there?</em></p>
<p>Every time a client walks through the door and places an order, you ask them politely to drop their order sheets in a small box placed in front of the payment counter. Outstanding! You have essentially introduced a mechanism to keep track of arrivals while still allowing your business to function as usual.</p>
<p>This is what we call <a target="_blank" href="https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean"><em>asynchronous processing</em></a>, and, <em>welcome to the world of queues</em>. ?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/VhVBpQZAbs0L2aVInfL57IzZdEudOuGDv2aA" alt="Image" width="800" height="348" loading="lazy">
<em>Hero to the rescue!</em></p>
<p>When you start out building software, much like the lemonade stand I mentioned above, it is common for a task to</p>
<ol>
<li>call a service, then</li>
<li>wait for the service to finish, and then</li>
<li>move on to the next task.</li>
</ol>
<p>This is what’s called <em>synchronous processing. Asynchronous processing</em>, on the other hand, allows a task to call a service, and <em>move on to the next task</em> while the service processes the request at its own pace. That’s why a queue is a beautiful, elegant way to unblock your systems because it puts a layer in front of your services and allows them to tackle the tasks at their own pace.</p>
<h4 id="heading-if-a-queue-is-so-powerful-why-dont-we-just-put-it-in-front-of-everything">If a queue is so powerful, why don’t we just put it in front of everything?</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ogAKQKM90Kep2cU2jneEkMeke7e0SMK28eHC" alt="Image" width="593" height="421" loading="lazy">
_Image courtesy of [imgflip.com](https://imgflip.com/i/2xylc5" rel="noopener" target="<em>blank" title=")</em></p>
<p>As anyone who has dabbled in distributed systems can attest to, scaling a distributed system is extremely tricky and complicated. There are a few things to know about queues that might make a queue an unattractive proposition for your system.</p>
<p>Some questions I’d ask before deciding if a queue is the right solution for you:</p>
<ul>
<li>Is your service having issues due to high traffic? If it’s not, maybe you should look into what the bottleneck is before jumping into queues. As Donald Knuth famously said, <a target="_blank" href="https://en.wikiquote.org/wiki/Donald_Knuth">premature optimization is the root of all evil.</a></li>
<li>Do you have in-house expertise in managing a queue? Or do you need to potentially hire a team to do it for you? Maintenance costs, like scaling the queue, can skyrocket if you’re not careful. There are services like <a target="_blank" href="https://aws.amazon.com/sqs/">Amazon SQS</a> (Simple Queueing Service) which offer a <em>managed</em> solution (i.e. you don’t need to maintain anything on your own).</li>
<li>Is it possible to have duplicate entries in the queue? If so, is that acceptable?</li>
<li>Do you need to keep a record of all transactions, in case a queue goes down?</li>
<li>In the case that a queue goes down, does the queue need to be able to replay all the entries? What are your backup options?</li>
</ul>
<p>There are many more concerns that might be specific to your use case, but hopefully, I’ve made my point that adding a queue isn’t as easy as snapping your fingers.</p>
<h3 id="heading-how-queues-are-used-in-modern-architecture">How Queues Are Used in Modern Architecture</h3>
<p>Queues are ubiquitous in today’s modern distributed systems architecture — adopted across various industries for different use cases, and there are more novel use cases every day.</p>
<p>Here are some of the real-world use cases for queues:</p>
<h4 id="heading-real-time-streaming">Real-time streaming</h4>
<p>When MapReduce came around, it was a huge phenomenon in the industry because it allowed mere mortals to process petabytes of data in a reasonable amount of time, anywhere from days to hours. This might seem absurd today when data’s available in almost seconds, but pre-MapReduce, it wasn’t easy to extract usable data from extremely large data sets.</p>
<p>The appetite for data analytics has grown, and we’re now looking at processing data within hours, and sometimes, <em>milliseconds</em>.</p>
<p>To achieve low-latency analytics and performance in a continuous fashion, the concept of real-time streaming was conceived.</p>
<p>A useful example here is to think of ads: ads on Twitter, for example, are shown to millions of people per day. Yet in order to make sure users don’t see the same ads multiple times within a set period of time, Twitter needs to somehow know the last time a user was exposed to a certain ad.</p>
<p>If we had relied on MapReduce to perform this action, it would not even be considered a solution because it’ll take upwards of hours to process all that data. Instead, real-time streaming allows us to process ad impressions as they arrive. This is all made possible because of queues <strong>that allow data to be continuously streamed and processed in real time.</strong></p>
<p>Some technologies you’ll often hear about in real-time streaming use cases are Kafka, Kafka streams, Redis, Spark Streaming (which is different from Spark) and so on.</p>
<h4 id="heading-event-driven-architecture">Event-driven architecture</h4>
<p>Queues are used as a critical component of an <a target="_blank" href="https://en.wikipedia.org/wiki/Event-driven_architecture">event-driven architecture</a>, or colloquially known as <strong>Pub</strong>(lisher)-<strong>Sub</strong>(scriber). Event-driven architecture is, according to Wikipedia:</p>
<blockquote>
<p>Event-driven architecture (EDA), is a software architecture pattern promoting the production, detection, consumption of, and reaction to events.</p>
</blockquote>
<p>I’d like to think of this as subscribing to a newsletter: as a producer of a newsletter, you know who’s subscribed to your newsletter and who’s not. You write the content, and then you send it to your subscribers.</p>
<p>On the other hand, as a subscriber, you might be subscribed to multiple newsletters, but you don’t know who the other subscribers are. But you don’t really care about that. This is a really nice feature because you can now write software that listens to a bunch of events and only responds to the ones you’re interested in.</p>
<p>RabbitMQ and Amazon SQS (Simple Queuing Service) are some of the technologies often used for these types of use cases.</p>
<h4 id="heading-distributed-fault-tolerant-scalable-infrastructure">Distributed, fault-tolerant, scalable infrastructure</h4>
<p>Distributed systems are prone to errors, and a queue is one of several ways to increase resiliency in the architecture. In a microservice architecture (or <a target="_blank" href="https://en.wikipedia.org/wiki/Service-oriented_architecture">service-oriented architecture</a>), multiple microservices communicate with each other through queues as shared interfaces.</p>
<p>When a microservice fails unexpectedly, a queue is still able to accept messages. This essentially <em>provides a buffer</em> for our microservice to recover. Once the microservice comes back online, it can pick up the messages from the queue and process them again.</p>
<p>Think of it as your mailbox. While you’re out on vacation in Hawaii, the mailperson will still deliver your mail into the mailbox. Once you return from vacation, you can pick up the mail and process them at your leisure.</p>
<p>Thank you for reading! I hope you’ve learned a thing or two about distributed queues from my article. If you enjoyed reading this, please leave a clap, and feel free to join my newsletter <a target="_blank" href="http://eepurl.com/dnt9Sf">here</a> where I write about software and technical interviews!</p>
<h4 id="heading-resources-i-recommend">Resources I Recommend</h4>
<p>To further your understanding of queues and various topics mentioned above, I would highly recommend these resources below. Or <a target="_blank" href="https://docs.google.com/document/d/1PeK69h4H82rwKjhactiE_sAIorCcZgXgXTY7k-nXpnE/edit#heading=h.hs0b333nsxch"><strong>join my course</strong></a> on scaling distributed systems to learn more about queues :)</p>
<ul>
<li><a target="_blank" href="https://amzn.to/2I80wup">Designing Data-Intensive Applications</a>: Awesome book for learning about scaling distributed systems! Highly recommended.</li>
<li><a target="_blank" href="https://amzn.to/2D8FUxS">Kafka the Guide</a>: I used this book as a reference guide, and enjoyed it for the high-level description.</li>
<li><a target="_blank" href="https://www.confluent.io/blog/introducing-kafka-streams-stream-processing-made-simple/">Kafka Streams</a>: This is an informative article from Confluent that talks in some high-level detail about Kafka’s implementation of stream processing.</li>
<li><a target="_blank" href="http://amzn.to/2Dcs6Qd">Elements of Programming Interviews</a>: Great for solving coding problems.</li>
<li><a target="_blank" href="http://amzn.to/2Hj91OH">Cracking The Coding Interview</a>: Great for covering foundational CS coding problems.</li>
<li><a target="_blank" href="https://www.dailycodingproblem.com/zhiachong">Daily Coding Problem.com</a>: This is a free-to-try website that offers free daily coding problems. You can sign up for interesting daily coding challenges, and you can pay for solutions if you’d like. If you use my referral link (<a target="_blank" href="http://www.dailycodingproblem.com/zhiachong">dailycodingproblem.com/zhiachong</a>), you get $10 off!</li>
</ul>
<p>(FYI, I share more resources on my website: <a target="_blank" href="http://www.zhiachong.com/resources">zhiachong.com</a> where I’ve personally tried and tested, and recommend for software engineers of all levels.)</p>
<p>Cheers!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to run GETH from a Docker container ]]>
                </title>
                <description>
                    <![CDATA[ By Vince Tabora Installing the Ethereum node client on a machine can be a tedious process. There is a simpler way this can be done using a Docker client. This is a guide for running the GETH (Ethereum-Go) node client from inside a Docker container. G... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-run-geth-from-a-docker-container-b6d30620ca74/</link>
                <guid isPermaLink="false">66c35437b1d4339762339fb5</guid>
                
                    <category>
                        <![CDATA[ Blockchain ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Docker ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ethereum ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 27 Mar 2019 18:56:55 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*QZk8YSNM8shw4Trn8YtvAA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Vince Tabora</p>
<p>Installing the Ethereum node client on a machine can be a tedious process. There is a simpler way this can be done using a Docker client. This is a guide for running the <strong>GETH</strong> (Ethereum-Go) node client from inside a Docker container. GETH is the GoLang implementation of the Ethereum protocol. There is an image available to pull from the Docker hub repository that can run the environment.</p>
<p>The <a target="_blank" href="https://geth.ethereum.org/"><strong>GoEthereum</strong></a> website lists the following available images with descriptions.</p>
<ul>
<li><code>ethereum/client-go:latest</code> is the latest develop version of Geth</li>
<li><code>ethereum/client-go:stable</code> is the latest stable version of Geth</li>
<li><code>ethereum/client-go:{version}</code> is the stable version of Geth at a specific version number</li>
<li><code>ethereum/client-go:release-{version}</code> is the latest stable version of Geth at a specific version family</li>
</ul>
<p>The following ports are opened by default when running from the container.</p>
<ul>
<li><code>8545</code> TCP, used by the HTTP based JSON RPC API</li>
<li><code>8546</code> TCP, used by the WebSocket based JSON RPC API</li>
<li><code>30303</code> TCP and UDP, used by the P2P protocol running the network</li>
<li><code>30304</code> UDP, used by the P2P protocol's new peer discovery overlay</li>
</ul>
<p>The Docker client software must be installed on the machine you are going to run the container from. Containers can only run if you have the Docker client installed. Depending on your operating system, the correct version of the client will be needed.</p>
<p>There are separate versions for Windows, Linux and the MacOS. The container can even be run on a Linux instance running on AWS, like a typical Linux installation. Once the Docker client is installed, the underlying platform doesn’t matter. The commands will be the same for all.</p>
<h2 id="heading-getting-the-image">Getting The Image</h2>
<p>Open a <strong><em>terminal</em></strong> on Linux or MacOS, or <strong><em>PowerShell</em></strong> command prompt from Windows. In the CLI prompt, type the following command:</p>
<p><strong>docker pull ethereum/client-go</strong></p>
<p>This pulls the Docker image from the hub repository where it was uploaded by the Ethereum developers. Once you have issued this command, the following verbose or similar should be displayed:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-48.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>I have already pulled the image, so the verbose may look different. When you issue the pull command it will always download the latest image available, which is good practice.</p>
<h2 id="heading-running-the-node">Running The Node</h2>
<p>Now you can start the node by issuing the following command:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-49.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We want to run the node with the flag options <strong>-i</strong> and <strong>-t</strong> to display information from our container. The <strong>-p</strong> indicates the use of a port number, in this case 30303. Likewise, the command can be run without the flags and it will simply use the default ports and settings from inside the container.</p>
<p>The following information should appear from the terminal.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-51.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The INFO line that shows the config reveals what the node client software has installed. The node client is running the latest (as of this posting) version of the Ethereum software which is Constantinople that is a user activated hard fork at block height 7280000.</p>
<p>When running in JSON-RPC API:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-52.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Take note that running the option rpcaddr “0.0.0.0” is not secure, since you are opening up your node to all traffic. If your ETH wallet were unlocked, a hacker can get to your node in this way and take your coins. I don’t cover security in this article, but you can read more about that <a target="_blank" href="https://medium.com/coinmonks/securing-your-ethereum-nodes-from-hackers-8b7d5bac8986">here</a> (securing your GETH node’s RPC ports). Always abide to safe and best practices.</p>
<p>If the node displays the following in the INFO line, there will be a problem:</p>
<p>config=”{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople:  Engine: ethash}”</p>
<p>The Constantinople:  indicates the software was not updated. There is also no line for ConstantinopleFix, which appears in the correct configuration.</p>
<h2 id="heading-persistent-data">Persistent Data</h2>
<p>For persistent blockchain data, Docker data volumes should be used with the option <strong>-v</strong>. The <code>/path/on/host</code> should be replaced with the location you specify. For this the following command must be used:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-54.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-checking-node-status">Checking Node Status</h2>
<p>You can check the container’s status using the following command:</p>
<p><strong>docker ps</strong></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-55.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This will display the Container ID with the image name, status and ports used.</p>
<pre><code>
#These are the commands to run <span class="hljs-keyword">from</span> the Docker CLI to run the Ethereum Go node client

#GETTING THE IMAGE

docker pull ethereum/client-go


#RUNNING THE NODE

docker run -it -p <span class="hljs-number">30303</span>:<span class="hljs-number">30303</span> ethereum/client-go

#RUNNING NODE USING API

docker run -it -p <span class="hljs-number">8545</span>:<span class="hljs-number">8545</span> -p <span class="hljs-number">30303</span>:<span class="hljs-number">30303</span> ethereum/client-go --rpc --rpcaddr <span class="hljs-string">"0.0.0.0"</span>

#Note, warning about using --rpcaddr <span class="hljs-string">"0.0.0.0"</span> <span class="hljs-keyword">in</span> a live environment. It is an insecure way <span class="hljs-keyword">of</span> opening your node.
#There are different ways to secure your ports, but <span class="hljs-built_in">this</span> is one thing to take note <span class="hljs-keyword">of</span> <span class="hljs-keyword">if</span> you plan to use the API.


#PERSISTENT DATA

docker run -it -p <span class="hljs-number">30303</span>:<span class="hljs-number">30303</span> -v /path/on/host:<span class="hljs-regexp">/root/</span>.ethereum ethereum/client-go
</code></pre><hr>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/08/image-56.png" alt="Image" width="600" height="400" loading="lazy">
<em>Running GETH from a Docker Container</em></p>
<p>Take note that this does not automatically mine ETH. That is a different process. For getting quick access to the Ethereum blockchain, this is the purpose for running GETH.</p>
<p>For full code source, visit: <a target="_blank" href="https://github.com/Play3rZer0/GETHDocker.git">https://github.com/Play3rZer0/GETHDocker.git</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ My journey in completing 100 days of code ]]>
                </title>
                <description>
                    <![CDATA[ By Pramono Winata Here I’ll tell you my story how I completed 100 days of code, how I started, how I keep it going, and how I finally finished it. What I have produced in my 100 days of code Starting Point About a year ago I actually heard a ]]>
                </description>
                <link>https://www.freecodecamp.org/news/my-journey-in-completing-100-days-of-code-e657428b1fa6/</link>
                <guid isPermaLink="false">66d46099d1ffc3d3eb89de3c</guid>
                
                    <category>
                        <![CDATA[ open source ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ self-improvement  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 03 Mar 2019 06:20:06 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9ca4cd740569d1a4ca6517.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Pramono Winata</p>
<p>Here I’ll tell you my story how I completed 100 days of code, how I started, how I keep it going, and how I finally finished it.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/J858KaVeHd1w82cHzm-Fq3M3kgKMf7EmXbTU" alt="Image" width="762" height="749" loading="lazy">
<em>What I have produced in my 100 days of code</em></p>
<h3 id="heading-starting-point"><strong>Starting Point</strong></h3>
<p>About a year ago I actually heard a lot about the 100 days of code challenge, but I had never thought of doing it. The very sound of <strong>one hundred days</strong> felt so intimidating for me back then that I was not sure that I could actually finish it.</p>
<p>Then one day I read <a target="_blank" href="https://android.jlelse.eu/100-days-of-code-in-open-source-3ceb38474a89">this article</a>, and after reading so many inspiring stories from people doing 100 days of code on Twitter, I finally decided that the time for me to start was now or never. And I finally started doing my 100 days of code, about 100 days ago from when I am writing this article.</p>
<h3 id="heading-managing-and-planning-my-work"><strong>Managing and Planning my work</strong></h3>
<p>First things first, I planned on what coding I would do and I decide that I would contribute to the <a target="_blank" href="https://github.com/pramonow">GitHub open-source community</a>. I would spend each day coding for about 1 hour and I would try to keep it to that timeframe — because I have got my me-time too ;)</p>
<p>My main challenge for this was actually <strong>finding out what to do</strong> every single day. For that, I always prepared <strong>two kinds of notes</strong> on my phone:</p>
<p>The first type of note was a list of my progress in 100 days of code, each and every day. Not only that, but this note also served as my note on what to do the next day. I always planned on what I was going to do at night. Then the next day I would know what to work on, so I would not waste my time thinking of what to do when I should have been coding.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/IU0FMqLNMbsxXcOpMw-EMp4B0l18II-fUyTO" alt="Image" width="800" height="711" loading="lazy">
<em>made it into two notes since there is actually a limit in android Memo App</em></p>
<p>My second note is was list of what open source things I wanted to make, something like a bucket list or a wish list, but instead it is a code list.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/5Z2HqA1kzrGE6OGnbOH5D700XVfYRt1F0BHs" alt="Image" width="270" height="480" loading="lazy">
<em>I named this open source wish list</em></p>
<p>Finding an idea for what to do was also a difficult task to do every day. That’s why I always <strong>spent my days reading Medium articles</strong> to find inspiration for what I should be exploring.</p>
<p>Since my expertise is in Android mobile application development, I started most of my repositories based on Android applications with Kotlin. Then after I started getting used to it, I finally started making repositories based on other things such as Serverless with <a target="_blank" href="https://github.com/pramonow/Serverless-go">go</a> and <a target="_blank" href="https://github.com/pramonow/Serverless-nodejs">nodejs</a>, <a target="_blank" href="https://github.com/pramonow/flutter-example">Flutter</a> and <a target="_blank" href="https://github.com/pramonow/try-rust">Rust</a>.</p>
<p>Nearing the day that I finished my 100 days of code, I also made another note which listed my leftover tasks that usually had something to do with refactoring.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/HvMmQr93dqvKzx8S48eOtpzyILhnWdXBeYIp" alt="Image" width="270" height="480" loading="lazy">
<em>refactor job, everyone loves clean code</em></p>
<h3 id="heading-keeping-myself-going"><strong>Keeping myself going</strong></h3>
<p>100 days is quite a long time. You might wonder if there were actually days where I was thinking of quitting.</p>
<p>Yes, there actually were — there have been several days where I doubted myself. Was I actually doing the right thing or was I just wasting my time doing this thing?</p>
<p>But I always kept myself going because of everything I have learned. Living in this Technology Era as a Software Engineer, I must always strive to learn new things and never stop. The moment I stop learning is the moment I stop growing as a Software Engineer. And seeing the stories about how people are finishing 100 days of code and even 360 days of code made me feel challenged since there were so many people out there doing it. If they could do it and even do more, why couldn’t I finish it?</p>
<p>It’s very important to push yourself as much as you’re able. But don’t forget to limit yourself and give yourself a break sometimes. If you reach your limit, you can then call it a day and continue on tomorrow. There were also days when all I did was refactoring and making a new repository. It is always important to keep up, but <strong>do not forget to give yourself a break</strong>.</p>
<p>And also, the most important part of keeping myself going: <strong>Consistency.</strong></p>
<h3 id="heading-completing-my-100-days-of-code"><strong>Completing my 100 days of code</strong></h3>
<p>When I finally finished my 100 days of code, the first two things I felt were feelings of <strong>accomplishment and relief</strong>.</p>
<p>People may ask me why I did it. I didn’t gain things from it — no profit, no one is looking at my mediocre GitHub repositories, no forks or stars. But of course I learned a lot of things from a technical point of view. Also, most of the people that saw me doing this 100 days of code acknowledged me for being consistent and continuing to do it.</p>
<p>One thing I always believe is that <strong>people may betray you, but hard work will not betray you. Keep sharpening yourself. At the end of the day, you will see yourself reaping the good things that you have sown</strong>.</p>
<p>Feel free to check out my <a target="_blank" href="https://github.com/pramonow">GitHub</a>! I will be very thankful for any issue opened or any PR. I have produced several android components which are usable and tested.</p>
<p><strong>So then, this ends my story on my first 100 days of code. Where is your story?</strong></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn Regular Expressions with this free course ]]>
                </title>
                <description>
                    <![CDATA[ By Beau Carnes “Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” -Jamie Zawinski For some people, using regular expressions can be a problem. But it doesn’t have to be a problem... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/learn-regular-expressions-with-this-free-course-37511963d278/</link>
                <guid isPermaLink="false">66c359caf83dfae169b2c00d</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Regex ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 21 Jan 2019 16:46:07 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*Sg2Vdih6v1wDWRPtgnX0DA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Beau Carnes</p>
<blockquote>
<p>“Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” <em>-Jamie Zawinski</em></p>
</blockquote>
<p>For some people, using regular expressions can be a problem. But it doesn’t have to be a problem for you. This article is a full course on Regular Expressions.</p>
<h3 id="heading-1-introduction">1. Introduction</h3>
<p>Regular Expressions, or just RegEx, are used in almost all programming languages to define a search pattern that can be used to search for things in a string.</p>
<p>I’ve developed a <a target="_blank" href="https://scrimba.com/g/gregularexpressions">free, full video course</a> on Scrimba.com to teach the basics of regular expressions.</p>
<p>This article contains the course in written form. But if you would prefer to watch the video version with interactive lessons, you can check it out on <a target="_blank" href="https://scrimba.com/g/gregularexpressions">Scrimba</a>. The sections in this article correspond to the sections in the Scimba course.</p>
<p>This course follows along with the <a target="_blank" href="https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions">RegEx</a> curriculum at freeCodeCamp.org. You can check that out for coding challenges and to earn a certificate.</p>
<p>These lessons focus on using RegEx in JavaScript, but the principles apply in many other programming languages you might choose to use. If you don’t already know basic JavaScript, it could be helpful if you cover it a bit first. I also have a basic JavaScript course that you can access on <a target="_blank" href="https://scrimba.com/p/pPgdYTV/cEv4Lh6">Scrimba</a> and on the <a target="_blank" href="https://www.youtube.com/watch?v=PkZNo7MFNFg">freeCodeCamp.org YouTube channel</a>.</p>
<p>So let’s get started! You’ll be saving the day in no time. ?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/mR0hvYGgyvAY9jIH9iiSUNj1gz-dI39-34RS" alt="Image" width="600" height="607" loading="lazy">
_From [https://xkcd.com/208/](https://xkcd.com/208/" rel="noopener" target="<em>blank" title=")</em></p>
<h3 id="heading-2-using-the-test-method">2. Using the Test Method</h3>
<p>To match parts of strings using RegEx, we need to create patterns that help you to do that matching. We can indicate that something is a RegEx pattern by putting the pattern between slashes <code>/</code>, like so <code>/pattern-we-want-to-match/</code>.</p>
<p>Let’s look at an example:</p>
<pre><code><span class="hljs-comment">// We want to check the following sentencelet sentence = "The dog chased the cat."</span>
</code></pre><pre><code><span class="hljs-comment">// and this is the pattern we want to match.let regex = /the/</span>
</code></pre><p>Notice how we use <code>/the/</code> to indicate that we are looking for “the” in our <code>sentence</code>.</p>
<p>We can use RegEx <code>test()</code> method to tell if a pattern is present in a string or not.</p>
<pre><code><span class="hljs-comment">// String we want to testlet myString = "Hello, World!";</span>
</code></pre><pre><code><span class="hljs-comment">// Pattern we want to findlet myRegex = /Hello/;</span>
</code></pre><pre><code><span class="hljs-comment">// result is now truelet result = myRegex.test(myString);</span>
</code></pre><h3 id="heading-3-match-literal-strings">3. Match Literal Strings</h3>
<p>Let’s now find Waldo.</p>
<pre><code><span class="hljs-keyword">let</span> waldoIsHiding = <span class="hljs-string">"Somewhere Waldo is hiding in this text."</span>;<span class="hljs-keyword">let</span> waldoRegex = <span class="hljs-regexp">/Waldo/</span>;
</code></pre><pre><code><span class="hljs-comment">// test() returns true, so result is now also truelet result = waldoRegex.test(waldoIsHiding);</span>
</code></pre><p>Note that in this example <code>waldoRegex</code> is case sensitive, so if we were to write <code>/waldo/</code> with a lowercase ‘w’, then our <code>result</code> would be false.</p>
<h3 id="heading-4-match-a-literal-string-with-different-possibilities">4. Match a Literal String with Different Possibilities</h3>
<p>RegEx also has <code>OR</code> operator which is <code>|</code> character.</p>
<pre><code><span class="hljs-keyword">let</span> petString = <span class="hljs-string">"James has a pet cat."</span>;
</code></pre><pre><code><span class="hljs-comment">// We can now try to find if either of the words are in the sentencelet petRegex = /dog|cat|bird|fish/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = petRegex.test(petString);
</code></pre><h3 id="heading-5-ignore-case-while-matching">5. Ignore Case While Matching</h3>
<p>So far, we have looked at patterns when the case of the letters mattered. How can we make our RegEx patterns to be case insensitive?</p>
<p>To ignore case we can do it by adding the <code>i</code> flag at the end of a pattern, like so <code>/some-pattern/i</code>.</p>
<pre><code><span class="hljs-keyword">let</span> myString = <span class="hljs-string">"freeCodeCamp"</span>;
</code></pre><pre><code><span class="hljs-comment">// We ignore case by using 'i' flaglet fccRegex = /freecodecamp/i;</span>
</code></pre><pre><code><span class="hljs-comment">// result is truelet result = fccRegex.test(myString);</span>
</code></pre><h3 id="heading-6-extract-matches">6. Extract Matches</h3>
<p>When we want to extract the matched value we can use <code>match()</code> method.</p>
<pre><code><span class="hljs-keyword">let</span> extractStr = <span class="hljs-string">"Extract the word 'coding' from this string."</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> codingRegex = <span class="hljs-regexp">/coding/</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> result = extractStr.match(codingRegex);
</code></pre><pre><code><span class="hljs-built_in">console</span>.log(result);
</code></pre><pre><code><span class="hljs-comment">// Terminal will show: // &gt; ["coding"]</span>
</code></pre><h3 id="heading-7-find-more-than-the-first-match">7. Find More Than the First Match</h3>
<p>Now when we know how to extract one value and it’s also possible to extract multiple values using the<code>g</code> flag</p>
<pre><code><span class="hljs-keyword">let</span> testStr = <span class="hljs-string">"Repeat, Repeat, Repeat"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> ourRegex = <span class="hljs-regexp">/Repeat/g</span>;
</code></pre><pre><code>testStr.match(ourRegex); <span class="hljs-comment">// returns ["Repeat", "Repeat", "Repeat"]</span>
</code></pre><p>We can also combine the<code>g</code> flag with the<code>i</code> flag, to extract multiple matches and ignore casing.</p>
<pre><code><span class="hljs-keyword">let</span> twinkleStar = <span class="hljs-string">"Twinkle, twinkle, little star"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> starRegex = <span class="hljs-regexp">/twinkle/ig</span>;<span class="hljs-comment">// writing /twinkle/gi would have the same result.</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = twinkleStar.match(starRegex);
</code></pre><pre><code><span class="hljs-built_in">console</span>.log(result);
</code></pre><pre><code><span class="hljs-comment">// Terminal will show: // &amp;gt; ["Twinkle", "twinkle"]</span>
</code></pre><h3 id="heading-8-match-anything-with-wildcard-period">8. Match Anything with Wildcard Period</h3>
<p>In RegEx <code>.</code> is a wildcard character that would match anything.</p>
<pre><code><span class="hljs-keyword">let</span> humStr = <span class="hljs-string">"I'll hum a song"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> hugStr = <span class="hljs-string">"Bear hug"</span>;
</code></pre><pre><code><span class="hljs-comment">// Looks for anything with 3 characters beginning with 'hu'let huRegex = /hu./;</span>
</code></pre><pre><code>humStr.match(huRegex); <span class="hljs-comment">// Returns ["hum"]</span>
</code></pre><pre><code>hugStr.match(huRegex); <span class="hljs-comment">// Returns ["hug"]</span>
</code></pre><h3 id="heading-9-match-single-character-with-multiple-possibilities">9. Match Single Character with Multiple Possibilities</h3>
<p>Matching any character is nice, but what if we want to restrict the matching to a predefined set of characters? We can do by using <code>[]</code> inside our RegEx.</p>
<p>If we have <code>/b[aiu]g/</code>, it means that we can match ‘bag’, ‘big’ and ‘bug’.</p>
<p>If we want to extract all the vowels from a sentence, this is how we can do it using RegEx.</p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"Beware of bugs in the above code; I have only proved it correct, not tried it."</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> vowelRegex = <span class="hljs-regexp">/[aeiou]/ig</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> result = quoteSample.match(vowelRegex);
</code></pre><h3 id="heading-10-match-letters-of-the-alphabet">10. Match Letters of the Alphabet</h3>
<p>But what if we want to match a range of letters? Sure, let’s do that.</p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"The quick brown fox jumps over the lazy dog."</span>;
</code></pre><pre><code><span class="hljs-comment">// We can match all the letters from 'a' to 'z', ignoring casing. let alphabetRegex = /[a-z]/ig;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = quoteSample.match(alphabetRegex);
</code></pre><h3 id="heading-11-match-numbers-and-letters-of-the-alphabet">11. Match Numbers and Letters of the Alphabet</h3>
<p>Letters are good, but what if we also want numbers?</p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"Blueberry 3.141592653s are delicious."</span>;
</code></pre><pre><code><span class="hljs-comment">// match numbers between 2 and 6 (both inclusive), // and letters between 'h' and 's'. let myRegex = /[2-6h-s]/ig;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = quoteSample.match(myRegex);
</code></pre><h3 id="heading-12-match-single-characters-not-specified">12. Match Single Characters Not Specified</h3>
<p>Sometimes it’s easier to specify characters that you don’t want to watch. These are called ‘Negated Characters’ and in RegEx you can do it by using <code>^</code>.</p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"3 blind mice."</span>;
</code></pre><pre><code><span class="hljs-comment">// Match everything that is not a number or a vowel. let myRegex = /[^0-9aeiou]/ig;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = quoteSample.match(myRegex);<span class="hljs-comment">// Returns [" ", "b", "l", "n", "d", " ", "m", "c", "."]</span>
</code></pre><h3 id="heading-13-match-characters-that-occur-one-or-more-times">13. Match Characters that Occur One or More Times</h3>
<p>If you want to match a characters that occurs one or more times, you can use <code>+</code>.</p>
<pre><code><span class="hljs-keyword">let</span> difficultSpelling = <span class="hljs-string">"Mississippi"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> myRegex = <span class="hljs-regexp">/s+/g</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> result = difficultSpelling.match(myRegex);<span class="hljs-comment">// Returns ["ss", "ss"]</span>
</code></pre><h3 id="heading-14-match-characters-that-occur-zero-or-more-times">14. Match Characters that Occur Zero or More Times</h3>
<p>There is also a <code>*</code> RegEx quantifier. This one matches even 0 occurrences of a character. Why might this be useful? Most of the time it’s usually in combination with other characters. Let’s look at an example.</p>
<pre><code><span class="hljs-keyword">let</span> soccerWord = <span class="hljs-string">"gooooooooal!"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> gPhrase = <span class="hljs-string">"gut feeling"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> oPhrase = <span class="hljs-string">"over the moon"</span>;
</code></pre><pre><code><span class="hljs-comment">// We are trying to match 'g', 'go', 'goo', 'gooo' and so on. let goRegex = /go*/;</span>
</code></pre><pre><code>soccerWord.match(goRegex); <span class="hljs-comment">// Returns ["goooooooo"]</span>
</code></pre><pre><code>gPhrase.match(goRegex); <span class="hljs-comment">// Returns ["g"]</span>
</code></pre><pre><code>oPhrase.match(goRegex); <span class="hljs-comment">// Returns null</span>
</code></pre><h3 id="heading-15-find-characters-with-lazy-matching">15. Find Characters with Lazy Matching</h3>
<p>Sometimes your pattern matches can have more than one outcome. For example, let’s say I’m looking for a pattern in a word <code>titanic</code> and my matched values must begin with a ‘t’ and end with an ‘i’. My possible results are ‘titani’ and ‘ti’.</p>
<p>This is why RegEx has a concepts of ‘Greedy Match’ and ‘Lazy Match’.</p>
<p>Greedy match finds <em>the</em> <em>longest possible match</em> of the string that fits the RegEx pattern, this is a default RegEx match:</p>
<pre><code><span class="hljs-keyword">let</span> string = <span class="hljs-string">"titanic"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> regex = <span class="hljs-regexp">/t[a-z]*i/</span>;
</code></pre><pre><code>string.match(regex);<span class="hljs-comment">// Returns ["titani"]</span>
</code></pre><p>Lazy match finds <em>the</em> <em>shortest possible match</em> of the string that fits the RegEx pattern and to use it we need to use <code>?</code>:</p>
<pre><code><span class="hljs-keyword">let</span> string = <span class="hljs-string">"titanic"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> regex = <span class="hljs-regexp">/t[a-z]*?i/</span>;
</code></pre><pre><code>string.match(regex);<span class="hljs-comment">// Returns ["ti"]</span>
</code></pre><h3 id="heading-16-find-one-or-more-criminals-in-a-hunt">16. Find One or More Criminals in a Hunt</h3>
<p>Now let’s have a look at a RegEx challenge. We need to find all the criminals (‘C’) in a crowd. We know that they always stay together and you need to need to write a RegEx that would find them.</p>
<pre><code><span class="hljs-keyword">let</span> crowd = <span class="hljs-string">'P1P2P3P4P5P6CCCP7P8P9'</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> reCriminals = <span class="hljs-regexp">/./</span>; <span class="hljs-comment">// Change this line</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> matchedCriminals = crowd.match(reCriminals);
</code></pre><p>You can find me walking through <a target="_blank" href="https://scrimba.com/p/peyvVAN/c3nEpta">the solution in this Scrimba cast</a>.</p>
<h3 id="heading-17-match-beginning-string-patterns">17. Match Beginning String Patterns</h3>
<p>RegEx also allows you to match patterns that are only at the beginning of a string. We’ve already talked about <code>^</code> creating a negating set. We can use the same symbol to find a match <em>only</em> at the beginning of a string.</p>
<pre><code><span class="hljs-keyword">let</span> calAndRicky = <span class="hljs-string">"Cal and Ricky both like racing."</span>;
</code></pre><pre><code><span class="hljs-comment">// Match 'Cal' only if it's at the beginning of a string. let calRegex = /^Cal/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = calRegex.test(calAndRicky); <span class="hljs-comment">// Returns true</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> rickyAndCal = <span class="hljs-string">"Ricky and Cal both like racing."</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> result = calRegex.test(rickyAndCal); <span class="hljs-comment">// Returns false</span>
</code></pre><h3 id="heading-18-match-ending-string-patterns">18. Match Ending String Patterns</h3>
<p>What about matching a pattern at the end of a string? We can use <code>$</code> for that.</p>
<pre><code><span class="hljs-keyword">let</span> caboose = <span class="hljs-string">"The last car on a train is the caboose"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match 'caboose' if it's at the end of a string.let lastRegex = /caboose$/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = lastRegex.test(caboose); <span class="hljs-comment">// Returns true</span>
</code></pre><h3 id="heading-19-match-all-letters-and-numbers">19. Match All Letters and Numbers</h3>
<p>Earlier in parts 10 and 11 I showed you how we can match ranges of letters and numbers. If I asked you to write a RegEx that matches all the letters and numbers and ignore their cases you probably would have written something like <code>/[a-z0-9]/gi</code> and that’s exactly right. But it’s a bit too long.</p>
<p>RegEx has something called <em>‘Shorthand Character Classes’</em>, which is basically a shorthand for common RegEx expression. For matching all letters and numbers we can use <code>\w</code> and we also get underscore <code>_</code> matched as a bonus.</p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"The five boxing wizards jump quickly."</span>;
</code></pre><pre><code><span class="hljs-comment">// Same as /[a-z0-9_]/gi to match a-z (ignore case), 0-9 and _let alphabetRegexV2 = /\w/g;</span>
</code></pre><pre><code><span class="hljs-comment">// The length of all the characters in a string// excluding spaces and the period. let result = quoteSample.match(alphabetRegexV2).length;</span>
</code></pre><pre><code><span class="hljs-comment">// Returns 31</span>
</code></pre><h3 id="heading-20-match-everything-but-letters-and-numbers">20. Match Everything But Letters and Numbers</h3>
<p>If we want to do the opposite and match everything that is not a letter or a number (also exclude underscore <code>_</code>), we can use <code>\W</code></p>
<pre><code><span class="hljs-keyword">let</span> quoteSample = <span class="hljs-string">"The five boxing wizards jump quickly."</span>;
</code></pre><pre><code><span class="hljs-comment">// Match spaces and the periodlet nonAlphabetRegex = /\W/g;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = quoteSample.match(nonAlphabetRegex).length;
</code></pre><pre><code><span class="hljs-comment">// Returns 6</span>
</code></pre><h3 id="heading-21-match-all-numbers">21. Match All Numbers</h3>
<p>Ok, what about if you want only numbers? Is there a shorthand character class for that? Sure, it’s <code>\d</code>.</p>
<pre><code><span class="hljs-keyword">let</span> numString = <span class="hljs-string">"Your sandwich will be $5.00"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match all the numberslet numRegex = /\d/g;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = numString.match(numRegex).length; <span class="hljs-comment">// Returns 3</span>
</code></pre><h3 id="heading-22-match-all-non-numbers">22. Match All Non-Numbers</h3>
<p>Would you like the opposite and match all the non-numbers? Use <code>\D</code></p>
<pre><code><span class="hljs-keyword">let</span> numString = <span class="hljs-string">"Your sandwich will be $5.00"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match everything that is not a numberlet noNumRegex = /\D/g;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = numString.match(noNumRegex).length; <span class="hljs-comment">// Returns 24</span>
</code></pre><h3 id="heading-23-restrict-possible-usernames">23. Restrict Possible Usernames</h3>
<p>So far so good! Well done for making it this far. RegEx can be tricky as it’s not the most easily readable way to code. Let’s now look at a very real-life example and make a username validator. In this case you have 3 requirements:</p>
<ul>
<li>If there are numbers, they must be at the end.</li>
<li>Letters can be lowercase and uppercase.</li>
<li>At least two characters long. Two-letter names can’t have numbers.</li>
</ul>
<p>Try to solve this on your own and if you find it difficult or just want to check the answer, <a target="_blank" href="https://scrimba.com/p/peyvVAN/cmb6nf9">check out my solution.</a></p>
<h3 id="heading-24-match-whitespace">24. Match Whitespace</h3>
<p>Can we match all the whitespaces? Of course, we can use a shorthand for that too and it’s <code>\s</code></p>
<pre><code><span class="hljs-keyword">let</span> sample = <span class="hljs-string">"Whitespace is important in separating words"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match all the whitespaceslet countWhiteSpace = /\s/g;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = sample.match(countWhiteSpace);
</code></pre><pre><code><span class="hljs-comment">// Returns [" ", " ", " ", " ", " "]</span>
</code></pre><h3 id="heading-25-match-non-whitespace-characters">25. Match Non-Whitespace Characters</h3>
<p>Can you guess how to match all non-whitespace characters? Well done, it’s <code>\S</code>!</p>
<pre><code><span class="hljs-keyword">let</span> sample = <span class="hljs-string">"Whitespace is important in separating words"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match all non-whitespace characterslet countWhiteSpace = /\S/g;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = sample.match(countWhiteSpace);
</code></pre><h3 id="heading-26-specify-upper-and-lower-number-of-matches">26. Specify Upper and Lower Number of Matches</h3>
<p>You can specify the lower and upper number of pattern matches with <em>‘Quantity Specifiers’.</em> They can be used with <code>{}</code> syntax, for example <code>{3,6}</code>, where <code>3</code> is the lower bound and <code>6</code> is the upper bound to be matched.</p>
<pre><code><span class="hljs-keyword">let</span> ohStr = <span class="hljs-string">"Ohhh no"</span>;
</code></pre><pre><code><span class="hljs-comment">// We want to match 'Oh's that have 3-6 'h' characters in it. let ohRegex = /Oh{3,6} no/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = ohRegex.test(ohStr); <span class="hljs-comment">// Returns true</span>
</code></pre><h3 id="heading-27-specify-only-the-lower-number-of-matches">27. Specify Only the Lower Number of Matches</h3>
<p>When we want to specify only the lower bound, we can do it by omitting the upper bound, for example to match at least three characters we can write <code>{3,}</code>. Notice that we still need a comma, even when we don’t specify the upper limit.</p>
<pre><code><span class="hljs-keyword">let</span> haStr = <span class="hljs-string">"Hazzzzah"</span>;
</code></pre><pre><code><span class="hljs-comment">// Match a pattern that contains at least for 'z' characterslet haRegex = /z{4,}/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = haRegex.test(haStr); <span class="hljs-comment">// Returns true</span>
</code></pre><h3 id="heading-28-specify-exact-number-of-matches">28. Specify Exact Number of Matches</h3>
<p>In the previous section I mentioned that we need a comma in <code>{3,}</code> when we specify only the lower bound. The reason is when you write <code>{3}</code> without a comma, it means that you are looking to match exactly 3 characters.</p>
<pre><code><span class="hljs-keyword">let</span> timStr = <span class="hljs-string">"Timmmmber"</span>;
</code></pre><pre><code><span class="hljs-comment">// let timRegex = /Tim{4}ber/;</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = timRegex.test(timStr); <span class="hljs-comment">// Returns true</span>
</code></pre><h3 id="heading-29-check-for-all-or-none">29. Check for All or None</h3>
<p>There are times when you might want to specify a possible existence of a character in your pattern. When a letter or a number is optional and we would use <code>?</code> for that.</p>
<pre><code><span class="hljs-comment">// We want to match both British and American English spellings // of the word 'favourite'</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> favWord_US = <span class="hljs-string">"favorite"</span>;<span class="hljs-keyword">let</span> favWord_GB = <span class="hljs-string">"favourite"</span>;
</code></pre><pre><code><span class="hljs-comment">// We match both 'favorite' and 'favourite' // by specifying that 'u' character is optionallet favRegex = /favou?rite/; // Change this line</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result1 = favRegex.test(favWord_US); <span class="hljs-comment">// Returns truelet result2 = favRegex.test(favWord_GB); // Returns true</span>
</code></pre><h3 id="heading-30-positive-and-negative-lookahead">30. Positive and Negative Lookahead</h3>
<p>‘<em>Lookaheads</em>’ are patterns that tell your JS to lookahead to check for patterns further along. They are useful when you’re trying to search for multiple patterns in the same strings. There 2 types of lookaheads — positive and negative.</p>
<p>Positive lookahead uses <code>?=</code> syntax</p>
<pre><code><span class="hljs-keyword">let</span> quit = <span class="hljs-string">"qu"</span>;
</code></pre><pre><code><span class="hljs-comment">// We match 'q' only if it has 'u' after it. let quRegex= /q(?=u)/;</span>
</code></pre><pre><code>quit.match(quRegex); <span class="hljs-comment">// Returns ["q"]</span>
</code></pre><p>Negative lookahead uses <code>?!</code> syntax</p>
<pre><code><span class="hljs-keyword">let</span> noquit = <span class="hljs-string">"qt"</span>;
</code></pre><pre><code><span class="hljs-comment">// We match 'q' only if there is no 'u' after it. let qRegex = /q(?!u)/;</span>
</code></pre><pre><code>noquit.match(qRegex); <span class="hljs-comment">// Returns ["q"]</span>
</code></pre><h3 id="heading-31-reuse-patterns-using-capture-groups">31. Reuse Patterns Using Capture Groups</h3>
<p>Let’s imagine we need to capture a repeating pattern.</p>
<pre><code><span class="hljs-keyword">let</span> repeatStr = <span class="hljs-string">"regex regex"</span>;
</code></pre><pre><code><span class="hljs-comment">// We want to match letters followed by space and then letterslet repeatRegex = /(\w+)\s(\w+)/;</span>
</code></pre><pre><code>repeatRegex.test(repeatStr); <span class="hljs-comment">// Returns true</span>
</code></pre><p>Instead of repeating <code>(\w+)</code> at the end we can tell RegEx to repeat the pattern, by using <code>\1</code>. So the same as above can be written again as:</p>
<pre><code><span class="hljs-keyword">let</span> repeatStr = <span class="hljs-string">"regex regex"</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> repeatRegex = <span class="hljs-regexp">/(\w+)\s\1)/</span>;
</code></pre><pre><code>repeatRegex.test(repeatStr); <span class="hljs-comment">// Returns true</span>
</code></pre><h3 id="heading-32-use-capture-groups-to-search-and-replace">32. Use Capture Groups to Search and Replace</h3>
<p>When we find a match, it’s sometimes handy to replaced it with something else. We can use <code>replace()</code> method for that.</p>
<pre><code><span class="hljs-keyword">let</span> wrongText = <span class="hljs-string">"The sky is silver."</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> silverRegex = <span class="hljs-regexp">/silver/</span>;
</code></pre><pre><code>wrongText.replace(silverRegex, <span class="hljs-string">"blue"</span>);
</code></pre><pre><code><span class="hljs-comment">// Returns "The sky is blue."</span>
</code></pre><h3 id="heading-33-remove-whitespace-from-start-and-end">33. Remove Whitespace from Start and End</h3>
<p>Here’s a little challenge for you. Write a RegEx that would remove any whitespace around the string.</p>
<pre><code><span class="hljs-keyword">let</span> hello = <span class="hljs-string">"   Hello, World!  "</span>;
</code></pre><pre><code><span class="hljs-keyword">let</span> wsRegex = <span class="hljs-regexp">/change/</span>; <span class="hljs-comment">// Change this line</span>
</code></pre><pre><code><span class="hljs-keyword">let</span> result = hello; <span class="hljs-comment">// Change this line</span>
</code></pre><p>If you get stuck or just want to check my solution, feel free to have a look at <a target="_blank" href="https://scrimba.com/p/peyvVAN/cZVvkH7">the Scrimba cast where I solve this challenge</a>.</p>
<h3 id="heading-34-conclusion">34. Conclusion</h3>
<p>Congratulations! You have finished this course! If you’d like to keep learning more, feel free to checkout <a target="_blank" href="https://www.youtube.com/playlist?list=PLWKjhJtqVAbleDe3_ZA8h3AO2rXar-q2V">this YouTube playlist</a>, that has a lot of JavaScript projects you can create.</p>
<p>Keep learning and thanks for reading!</p>
<p>You are now ready to play regex golf. ?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/sRhyrBTA9B-XwaBVwi00yiBYdaIX2rHopdBJ" alt="Image" width="740" height="271" loading="lazy">
_From [https://xkcd.com/1313/](https://xkcd.com/1313/" rel="noopener" target="<em>blank" title=")</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to write composable functions and correct programs ]]>
                </title>
                <description>
                    <![CDATA[ By Pavel Zaytsev An overview with monads and Kleisli arrows A few words on the traditions ? If you have not written about monads are you even a programmer? It is a well-known fact that any respectable programmer who blogs about tech must at least ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/monadic-composition-and-kleisli-arrows-1d96979bb32/</link>
                <guid isPermaLink="false">66c35b729de50ee9ca7fa709</guid>
                
                    <category>
                        <![CDATA[ Functional Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Scala ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 02 Dec 2018 11:52:18 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*CUnuyHcCX5A1KV1v3V8nTw.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Pavel Zaytsev</p>
<h4 id="heading-an-overview-with-monads-and-kleisli-arrows">An overview with monads and Kleisli arrows</h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*CUnuyHcCX5A1KV1v3V8nTw.jpeg" alt="Image" width="800" height="533" loading="lazy"></p>
<h3 id="heading-a-few-words-on-the-traditions">A few words on the traditions ?</h3>
<blockquote>
<p>If you have not written about monads are you even a programmer?</p>
</blockquote>
<p>It is a well-known fact that any respectable programmer who blogs about tech must at least once in their life write a tutorial on <strong>monads</strong>. Most of the times it starts from <strong>functors</strong> and builds all the way up. The difficult comparisons are drawn here and there with the short snippets of code sprinkled around to demonstrate a couple of applications — all seem completely orthogonal, of course.</p>
<p>The problem is that there is a gigantic conceptual gap between “What is a monad?” and “How is a monad used in programming?”</p>
<p>The main reason for this gap is that people don’t usually think of their programs in such a way that they would need a monad in the first place. If you come from the imperative background — and most of us do — even when you finally go functional, it usually takes a while to see the entire picture and understand the correct way of doing things. We often preach referential transparency and purity. We often have a general idea of what these things mean separately, but it takes some time to piece them together in one coherent concept.</p>
<p>This article is not about monads but instead about writing composable functions and correct programs. The monads appear as the by-product of this goal. The following discussion also, hopefully, will facilitate bridging the aforementioned conceptual gap.</p>
<h3 id="heading-its-all-about-that-composition">It’s all about that composition ?‍</h3>
<p>In programming, the interesting and important problems are usually too complex too to deal with as a whole. Programmers break them up into smaller comprehensible pieces that they solve one-by-one and then bring the solutions to these subproblems into a clear picture. There are many ways of doing it, but there can be clearly defined two schools of thought — declarative and imperative approaches.</p>
<p>The imperative approach views a program as a sequence of computations in time, and the unit of a program is a statement. A statement does something. For example, it can print output to a console, assign a value to a variable, or compute a result.</p>
<p>The declarative approach is global. It cares only about the initial and final state of the system, and a unit of a program is an expression. The expression <strong>always</strong> evaluates to a value. In general, it’s harder to reason about a statement rather than about an expression because a statement is far too broad and unbounded, while an expression always deterministically evaluates to the same value for all the programs it can potentially appear in.</p>
<p>If you are a functional programmer and you follow a declarative paradigm, you see a program as a composition of functions, and functions are just the expressions. You can think of a composition as just a fusion of two or more functions into one.</p>
<p>If you have a function <em>f</em> that takes an argument of type A and it returns a result of type B and another function <em>g</em> that takes an argument of type B, and it returns a result of type C, you can compose them by passing a result of <em>f</em> to <em>g</em>. What you get is a new function that accepts an argument of type A and produces the result of type C. Do a couple of these, and you get a working program. This is similar to deductive reasoning, which is just a composition of logical steps, that follow from premises to the conclusions.</p>
<p>The problem is that in real programming it’s not so simple, and many functions do not evaluate to the same value all the time even if their arguments do. These functions do network calls, they read from files and databases, they write to them, they process a lot of different data, they print to a console, etc. Functions become <strong>context-dependent,</strong> and the more context-dependent they are, the more difficult it is to compose them. So if you have to deal with functions where each one of them introduces some of this complexity here and there, you better find a way to compose them.</p>
<h3 id="heading-the-ever-lasting-problem">The ever-lasting problem ?</h3>
<p>As I have already mentioned, writing useful code entails dealing with the chaos of the outside world — a problem of handling effects and state. By effect, I mean an effect on the outside world, like writing to a database or printing to a console. Even a simple beaten-to-death <code>HelloWorld</code> program produces an effect.</p>
<p>Many situations are traditionally solved by abandoning the purity of functions, including but not limited to:</p>
<ul>
<li>computations that access/modify a state outside of the context of a program.</li>
<li>computations that may fail or never terminate</li>
<li>computations whose result might be only known sometime in the future, aka asynchronous computations</li>
<li>console input and output</li>
</ul>
<p>As you can imagine, the functions that behave like this are not so easy to compose. Let’s say a function, given some username in the form of an input string, reads from a file, finds the given user, and then passes their last name to the next function for later processing. How do you represent a function like that? <code>String =&gt; Str</code>ing? But that would not be entirely correct, as you do get a string and you do return one, but you also do something else in between and it depends on the context — a file system and a file.</p>
<p>In functional programming, we usually encode this information in the function’s return type. We place the result of a computation in a box, so to speak, and our function turns from <code>A =&gt;</code>; B <code>to A =&gt;</code> Box[B].</p>
<p>Whatever happens inside this box is implementation-specific. But the definition of a function now describes what it does and allows to handle the function's behavior and compose it, much better.</p>
<p>Let’s look at the situations above and try to come up with a box for every one of them.</p>
<h3 id="heading-box-all-the-things">Box all the things ?</h3>
<p>Disclaimer: In this article, I will be using Scala to express my ideas, as it’s arguably one of the mainstream functional programming languages out there. But the same concepts can be easily translated into any functional programming language with a strong static type system and type constructors (like Haskell and OCaml).</p>
<p>A function that reads but does not modify the external state can be thought of as a function that also accepts this external state as an argument and, given some input parameter, produces a result. An example is reading from a database or config file.</p>
<p>We also supply a <code>run</code> function to materialize a reader and compute a result. The classic use case would be to:</p>
<ul>
<li>provide a configuration file</li>
<li>stack the readers to set up an application</li>
<li>execute the <code>run</code> function in the end on the instance of the config file.</li>
</ul>
<p>In the OOP world, a similar approach goes by <strong>Dependency Injection</strong>.</p>
<p>Functions that carry along the state of a computation accept two arguments — a regular one, that participates in the actual computation, and the state that will be propagated all the way through the composition.</p>
<p>We supply a <code>run</code> function that yields the result which a current writer holds. A typical use case of <code>Writer</code> is to propagate messages and errors during the program execution, and extracts the log alongside the final result. Another use case would be to record the sequences of steps in a multi-threaded environment. Since the result of a computation is tied to a particular log, the messages don’t get intertwined.</p>
<p>A function that never terminates (for example a long running process) is lifted to a <strong>bottom type</strong> of <code>Nothing</code>. If you expect that your computation might either return a value or run forever, you can model it as a disjoint union of a result type and <code>Nothing</code>. An example would be a stream consumer that processes data indefinitely until some event makes it yield.</p>
<p>A function that might fail can be modeled as a partial function — the one that’s not defined for some values. So we do just that — for some cases return nothing and, for others, an actual value. If you want the information regarding the failure and to interop with Java APIs that throw exceptions, you can carry the information of an error with you in the disjoint union.</p>
<p>Asynchronous computations do not execute on the current call-stack or a main flow of the program. They can be modeled as a function that accepts a handler, or callback. When this handler eventually is called — for example by some other thread or a web server — the result is produced.</p>
<p><code>ExecutionContext</code> manages the details of the asynchronous execution. On JVM it is a thread-pool, but it does not have to be threads that deal with asynchrony. Function <code>run</code> takes it implicitly because callbacks need to be called asynchronously. Every function that calls <code>run</code> needs to have an <strong>implicit</strong> <code>ExecutionContext</code> in its signature as well. <code>ExecutionContext</code> also makes recursive asynchronous calls stack-safe because you introduce an <strong>asynchronous boundary</strong> every time you call a function. As I mentioned earlier, asynchronous computations do not execute on the same call-stack. Pretty neat.</p>
<p>Console input can be modeled as a two-phase process. In the first phase we <strong>describe</strong> the computation and a result that a console input might produce. In the second phase, we run or <strong>interpret</strong> this computation. The data type that holds the outcome of this computation is called <code>IO</code>. So our function takes a singleton and produces the result inside of an <code>IO</code>.</p>
<p>Notice, since I mentioned that we describe the computation first, we pass call-by-name parameters <code>=&gt;</code>; A. They execute only when we need them to.<br>Console output can be modeled throu<code>gh</code> IO as well, with o<code>ur</code> run function producing a singleton type <code>of U</code>nit.</p>
<h3 id="heading-so-now-what">So, now what ? ?</h3>
<p>We, of course, implemented all the boxes with a type parameter to account for variability in types. We transform, or map, from some stuff to other stuff by supplying a function. A mapping between a category of some things to a category of other things is called a <strong>functor</strong>.</p>
<p>Functors are cool because they allow us to transform stuff inside, while preserving the structure of the original category, without messing things up. When using a functor, following the <a target="_blank" href="https://en.wikibooks.org/wiki/Haskell/The_Functor_class#The_functor_laws">functor laws</a> proves that things work as expected. It will get clear later in the article why <strong>these</strong> laws in particular.</p>
<p>Let’s define a map method that does transformation for each of the derived data types:</p>
<p>Notice that here we have defined a function <code>pure</code> that permits us to lift a pure computation into an asynchronous value.</p>
<p>Cool, now we can map things inside of the boxes. The problem is — it’s not useful because, although we can sequence computations within a functor, we can’t compose functor-producing functions:</p>
<pre><code>F1: A -&gt; Functor[B] ==&gt; F2: A -&gt; Functor[B] ==&gt; F3: A -&gt; Functor[B]
</code></pre><p>Each of <code>F1</code>, <code>F2</code>, and <code>F3</code> may do something completely different. We need to account for that, we need to compose them. Fortunately, there is an excellent way of doing this.</p>
<h3 id="heading-oh-no-its-that-guy-again">Oh no, it’s that guy again! ?</h3>
<p>Ok, I need to write a function that composes the functions for each of the functors in <code>A =&gt; Functor</code>[B]. The mathematical definition of composition is:</p>
<pre><code>If A =&gt;; B and B =&gt; C then A =&gt; C
</code></pre><p>So in our case:</p>
<pre><code>If A =&gt; Functor[B] and B =&gt; Functor[C] then A =&gt; Functor[C]
</code></pre><p>Let’s start with a reader. Again, just follow the types:</p>
<p>We defined composition as <code>andThen</code> . We also defined <code>pure</code> , which lifts a value into a functor.</p>
<p>Composition in any category follows <strong>two simple laws</strong>.</p>
<ol>
<li><p>It is associative:</p>
</li>
<li><p>There exists such a function, called <strong>identity,</strong> that, when composed with any function from left or right, produces that function again:</p>
</li>
</ol>
<p>You can take a pen and a piece of paper and try to draw these two laws. Substituting entities with circles and connections between them as arrows, you can visually prove to yourself that this is the case. Remember functor laws earlier? It’s the same thing. These laws establish the composability in every category.</p>
<p>As programmers, we mostly deal with a category of sets — objects are sets or types, and arrows are functions. Not all mathematical structures need to have an identity, but category certainly does.</p>
<p>Identity, for example, can be used to show whether two objects, “sets,” are isomorphic, or equal. It can also provide guarantees in certain instances as we will see later in the article.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*TNDCu4w78aQktMU5aisvPg.png" alt="Image" width="544" height="338" loading="lazy">
<em>Category only has two properties — simple enough.</em></p>
<p>A functor that participates in <code>A =&gt; Functor</code>[B] and follows these composition laws, and hence composes for all the objects in the same catego<a target="_blank" href="https://blog.plover.com/prog/burritos.html">ry is not a burr</a>ito. It’s a monad.</p>
<p>Accordingly, the functions that we try to compose are actually <code>A =&gt; Monad</code>[B] . A wrapper around them, a category that is naturally associated with <code>a Monad</code>[B], is called a Kleisli categor<code>y. A =&gt; Mo</code>nad[<code>B] or K</code>leisli arrows is just a way to compose these sort of functions, nothing more.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*pd47LtHoY8Hl4g_coz9SsQ.png" alt="Image" width="502" height="317" loading="lazy">
<em>Kleisli has the same objects as the original category but arrows between a and b in Kleisli correspond to the arrows between a and Fb, where F is a functor.</em></p>
<h3 id="heading-compose-all-the-things">Compose all the things! ?</h3>
<p>We replace Java-like <code>andThen</code> with an arrow <code>&gt;</code>==&gt; . This is called a fish operator because it looks like a fish ?. We also define a func<code>tion fl</code>atMap that, giv<code>en a Mon</code>ad[A] <code>and A =&gt;</code> Monad[B], p<code>roduces A =&amp;g</code>t; Monad[B]. This will make implementing arrows easier:</p>
<h4 id="heading-monoids">Monoids</h4>
<p>For a writer to be a monad, a second type should be composable too, and it’s composable only if it’s a <strong>monoid</strong>. Something is a monoid only if it can be associatively combined and has an empty element, which is an identity element.</p>
<p>For example, integers that sum up are a monoid with an identity element of 0. Strings that concat are a monoid with identity element of an empty string. Sets that union are a monoid with an identity element of an empty set. Sets that intersect form a semigroup and not a monoid. Intersecting a non-empty set with an empty one produces an empty set. You see why identity is useful?</p>
<p>Every other monad is easy to implement:</p>
<p>We will go into detail why <code>IO</code> looks like this and have a discussion about <code>Free</code> probably in another article.</p>
<h3 id="heading-when-to-use-which">When to use which? ?</h3>
<p><code>Kleisli</code> and <code>Monad</code> are two sides of the same coin. Many functional languages support them natively, but for Scala, at least in the current version 2.12.8, you can get them from the libraries like Cats and Scalaz. They have type classes for <code>Kleisli</code> and <code>Monad</code>: <code>Kleisli[F[_], A, B]</code> and <code>Monad[A]</code> respectively.</p>
<p>Monads are better at expressing the sequencing of the computations that happen within some context. In Scala, we do this contextual sequencing usually by utilizing for comprehensions.  </p>
<p>Fun fact: If you compose <code>Kleisli</code> arrows for <code>IO</code> monad, you will get a description of your computer program. Your computer program is essentially one gigantic <code>Kleisli</code> arrow, with some input and output of <code>Unit</code> that acts as a description, and a runtime environment that executes this program works as an interpreter.</p>
<p>So every program, by default, has an <code>IO</code> context. If you have a function that produces an error, it creates a context of <code>Option</code> or <code>Either.</code> So every subsequent function should have a signature of <code>A =&gt; Option</code>[A] <code>or A =&gt; Either[</code>A, B]. With<code>in</code> an IO program <code>it’s A =&gt; IO[O</code>ption<code>[A]] and A =&gt; IO[E</code>ither[A, B]]. You decide when to collapse this context or nest it even further. Monad transformers can help with the sequencing of the nested contexts, but that is material for another article.  </p>
<p>Asynchronous computations are only sequenced with the help of monads bec<strong>ause monad</strong>s explicitly solve the problems of synchronization and ordering in time. <code>If yo</code>u use Future combinators, for example, it is within a monadic context.</p>
<p><code>Kleisli</code> is better when the arrow combinator is more suitable. For example, we can have a bunch of effectful or impure functions, and we can fuse them without wrapping the result into <code>IO</code>. You can also create a bunch of individual programs and combine them into one <code>Kleisli</code> in the end and run if you want, of course.</p>
<p><code>Reader[A]</code> is better expressed with <code>Kleisli</code> than with monadic compositions because we can easily compose small local <code>Kleisli</code> arrows into a <code>Kleisli</code> arrow that represents our program’s global configuration. The large <code>Kleisli</code> arrow depends on some environment, let’s say a configuration file for production and development. Then we can run this at the very end, and configure the entire app.</p>
<p>This approach mimics the concept of <strong>dependency injection</strong>. Here we demonstrate <code>KleisliIO</code>, an effectful <code>Kleisli</code> from <a target="_blank" href="https://github.com/scalaz/scalaz-zio">ZIO</a> that performs a reader functionality to configure the application (error type omitted to save some space):</p>
<h3 id="heading-end">End ?</h3>
<p>Whew, that was a blast. I hope you enjoyed this article and now understand what’s going a little bit better :).</p>
<p>Here are some useful links to learn more about Kleisli and composition:</p>
<ul>
<li><a target="_blank" href="http://www.cse.chalmers.se/~rjmh/Papers/arrows.pdf">www.cse.chalmers.se/~rjmh/Papers/arrows.pdf</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=qL6Viix3npA">https://www.youtube.com/watch?v=qL6Viix3npA</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
