<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kenneth Jordan on Medium]]></title>
        <description><![CDATA[Stories by Kenneth Jordan on Medium]]></description>
        <link>https://medium.com/@Kenneththedev?source=rss-31b066bb3824------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P7ELcfsDQY-YTnjCcXnYcA.jpeg</url>
            <title>Stories by Kenneth Jordan on Medium</title>
            <link>https://medium.com/@Kenneththedev?source=rss-31b066bb3824------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 07 Jun 2026 10:35:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Kenneththedev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[npm Is Holding You Hostage: Why It’s Time to Switch to pnpm]]></title>
            <link>https://medium.com/@Kenneththedev/is-it-time-to-ditch-npm-for-pnpm-586a410736db?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/586a410736db</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[pnpm]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[npm]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 00:27:26 GMT</pubDate>
            <atom:updated>2024-11-11T00:29:30.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*6jc7GL1dANqfKIuT.jpg" /></figure><p>When it comes to JavaScript package managers, <strong>npm</strong> has been the go-to for years and for me personally. But lately, you might’ve heard whispers (or maybe loud cheers) about <strong>pnpm</strong>. Let’s break it down.</p><h4>A Quick Overview</h4><ul><li><strong>npm</strong> (Node Package Manager) has been around since Node.js became popular. It’s reliable and easy to use, making it the default package manager for most Node projects.</li><li><strong>pnpm</strong> (Performant npm) is the new kid on the block, bringing a fresh perspective on package management with a focus on speed and disk efficiency.</li></ul><p>Let’s look at why you might want to switch to <strong>pnpm</strong>, or if sticking with <strong>npm</strong> is good enough for you.</p><h4>1. Speed: The Need for Speed 🏎️</h4><p><strong>npm</strong> has gotten faster with v7 and v8, but it still installs packages in a way that can feel sluggish, especially in big projects. It puts a <strong>node_modules</strong> folder in every project with full copies of your dependencies.</p><p><strong>pnpm</strong>, on the other hand, uses a <strong>content-addressable storage</strong> system. This fancy term essentially means that it stores packages globally and uses hard links to your project. So, instead of creating a full copy, it just points to an existing package. The result? <strong>Faster installs and less disk usage</strong>.</p><p><strong>TL;DR</strong>: If speed is a concern and you’re dealing with large projects, <strong>pnpm</strong> can be a game changer.</p><h4>2. Disk Space: A Hoarder’s Nightmare 😱</h4><p>If you’ve ever run out of space because of node_modules, you’re not alone. The way <strong>npm</strong> works, every project gets its own set of dependencies, even if another project already has the same ones.</p><p>With <strong>pnpm</strong>, shared packages are stored in a single place, and hard links are used for your project. This drastically reduces disk space usage.</p><p><strong>Example</strong>: If you have five projects using React, <strong>npm</strong> will store React five times. <strong>pnpm</strong> will store it once, with pointers in each project.</p><p><strong>Disk Space Winner</strong>: <strong>pnpm</strong>.</p><h4>3. Compatibility: No Surprises, Please 🤞</h4><p>You might wonder if switching to <strong>pnpm</strong> will break your project. The good news is that <strong>pnpm</strong> is largely compatible with <strong>npm</strong> and <strong>yarn</strong>. Your package.json file stays the same, and you can use almost all the same commands (pnpm install, pnpm start, etc.).</p><p>However, there are some edge cases, especially if your project relies heavily on nested node_modules (which <strong>pnpm</strong> doesn&#39;t create by default). Most modern projects won’t face issues, but it’s something to watch out for.</p><h4>4. Workspace Support: Monorepo Magic 🧙‍♂️</h4><p>If you’re working with monorepos, <strong>pnpm</strong> shines even brighter. It natively supports <strong>workspaces</strong>, making it easy to manage multiple packages within a single repo. While <strong>npm</strong> has also introduced workspace support, <strong>pnpm</strong>’s implementation tends to be faster and more efficient because of its linking system.</p><p><strong>For Monorepo Fans</strong>: <strong>pnpm</strong> is a clear win.</p><h4>5. Ecosystem &amp; Adoption: Who’s Using What? 🤔</h4><p>Despite being the default, <strong>npm</strong> isn’t the only game in town. Many popular projects have already switched to <strong>pnpm</strong> because of its performance benefits. It’s still newer and may not have the same ecosystem maturity as <strong>npm</strong>, but it’s catching up fast.</p><p>If you’re starting a new project and want to optimize from the get-go, <strong>pnpm</strong> is a solid choice. If you’re dealing with legacy code or don’t want to rock the boat, sticking with <strong>npm</strong> is perfectly fine.</p><h4>Final Verdict: Should You Switch?</h4><p><strong>Choose npm</strong> if:</p><ul><li>You want a straightforward, time-tested package manager.</li><li>Compatibility and stability are your top priorities.</li></ul><p><strong>Choose pnpm</strong> if:</p><ul><li>You care about performance and saving disk space.</li><li>You’re working with monorepos or large projects.</li><li>You’re willing to adapt to some minor changes for the speed benefits.</li></ul><p>In the end, both <strong>npm</strong> and <strong>pnpm</strong> get the job done. It’s about picking the right tool for your needs. Personally, I’ve found <strong>pnpm</strong> to be a breath of fresh air, especially when juggling multiple projects on limited storage.</p><p><strong>Give it a try, </strong>and see if it fits your workflow. You might just be surprised at how much faster your projects install.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=586a410736db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Makes Good Documentation for Open-Source?]]></title>
            <link>https://medium.com/madhash/what-makes-good-documentation-for-open-source-65f68eda63fa?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/65f68eda63fa</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 04:36:36 GMT</pubDate>
            <atom:updated>2022-12-29T20:53:21.210Z</atom:updated>
            <content:encoded><![CDATA[<h4>Just some thoughts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TSqiowTzxo-_BOw3hLpSQ.jpeg" /><figcaption>image of code</figcaption></figure><p>Proper documentation is an important part of any open-source project. It helps users understand how to use the project, and it can also help other developers contribute to the project. Without proper documentation, it can be difficult for users and developers to get the most out of an open-source project.</p><p>One of the key benefits of open-source software is that it allows anyone to use, modify, and distribute the code. This means that open-source projects can be built on and improved by a large community of developers. But in order for this to happen, it’s important that the project’s documentation is clear and comprehensive.</p><h3>The checklist</h3><p>Great documentation for open-source projects should be:</p><ul><li><strong>Clear and straightforward: </strong>Written in a way that is easy for anyone, even those new to the project, to understand.</li><li><strong>Thorough: </strong>Covering all aspects of the project, including its code, architecture, and usage instructions.</li><li><strong>Up-to-date: </strong>Keeping pace with the project’s evolution and reflecting any changes or new features.</li><li><strong>Easy to find and navigate:</strong> Conveniently available and organized for users.</li><li><strong>Supportive:</strong> Providing guidance and support for users and contributors, and including information about available resources.</li><li><strong>Compliant with the project’s license: </strong>Clearly outlining the license’s requirements and restrictions on use and distribution.</li></ul><h4>Other notes and thoughts</h4><p>Encouraging first-time open source contributors is an important part of building and maintaining a successful open-source project. Proper documentation can play a crucial role in this by making it easier for new contributors to understand the project and get started.</p><p>Having clear and detailed documentation makes it easier for users to get started with the project, and it also helps other developers understand how the project works and how they can contribute to it. This is especially important for open-source projects, where collaboration and community involvement are key to their success.</p><p>In addition to making the project more accessible and user-friendly, proper documentation can also help to establish trust and credibility for the project. When users and developers can easily find the information they need, it helps to build confidence in the project and its capabilities.</p><h4>The wrap up</h4><p>Proper documentation is an essential part of any open-source project. It helps users and developers get the most out of the project and can also help build trust and credibility for the project. As a result, it’s important to invest time and effort in creating comprehensive and well-written documentation for your open-source project.</p><h3>References</h3><p><a href="https://blackgirlbytes.dev/conquering-the-fear-of-contributing-to-open-source">https://blackgirlbytes.dev/conquering-the-fear-of-contributing-to-open-source</a><a href="https://github.com/ProgramEquity/amplify/issues/356">issue</a>/<a href="https://github.com/ProgramEquity/amplify/pull/358">PR for photos</a></p><p>Special shoutout to <a href="https://github.com/ProgramEquity/amplify">Program Equity</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65f68eda63fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/madhash/what-makes-good-documentation-for-open-source-65f68eda63fa">What Makes Good Documentation for Open-Source?</a> was originally published in <a href="https://medium.com/madhash">Modules&amp;Methods</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[These Commands Will Increase Your Productivity]]></title>
            <link>https://medium.com/@Kenneththedev/welcome-to-kennys-corner-db55b29d6205?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/db55b29d6205</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Mon, 31 Oct 2022 16:25:42 GMT</pubDate>
            <atom:updated>2023-01-03T16:43:53.469Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome the first iteration of Kenny’s Corner. Today I will be talking about viewing the history of a project in your terminal (Command-Line Interface). Before we do that I&#39;d like to re-introduce everyone to Git. Git is a version control system allowing you to create, save and edit whatever you like. Let’s say you’re working on a project with a few friends to create a revolutionary application and you wanted to stage or upload your changes. One way to go about that:</p><p>git add .</p><p>git -m commit &quot;insert commit message here&quot;</p><p>git push</p><p>What if you wanted to view a listing of changes you or one of your collaborators made. You can do so by going to your terminal and executing</p><p>git log</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*au7PbR-9oMknFNZX7AG5WQ.png" /></figure><p>Let’s say you wanted to filter changes made by a time or author. Using --pretty=oneline is the best bet. In order to select an author or time the following must be added</p><p>git log --pretty=oneline --since=&#39;10 minutes ago&#39;</p><p>git log --pretty=oneline --author=&lt;insert author name&gt;</p><p>Thank you for reading my blog, if anyone wants to connect please do so at <a href="https://www.linkedin.com/in/kenneth-the-dev/">LinkedIn </a>or <a href="https://github.com/LoopFruits">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db55b29d6205" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero to Hero: Mastering the Big O Notation]]></title>
            <link>https://medium.com/@Kenneththedev/big-o-notation-time-complexity-2837ec62ce0c?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/2837ec62ce0c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Mon, 29 Aug 2022 14:29:54 GMT</pubDate>
            <atom:updated>2023-08-04T16:19:46.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F-CbI5gYbyABjIca" /><figcaption>Photo by <a href="https://unsplash.com/@julianhochgesang?utm_source=medium&amp;utm_medium=referral">Julian Hochgesang</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hey there! So, Big O notation had me totally baffled when I first stumbled across it. But after spending some solid hours doing a deep dive (okay, maybe not years, but it sure felt like it), I’m now feeling pretty pumped to share what I’ve learned with you.</p><p>You might ask, what’s the Big O notation all about? Well, it’s basically a way for us coders to figure out how fast (or slow) our code is gonna run.</p><p>Here’s a quick scenario for you: Imagine you need to write a function. It’s got to take a string input and spit out an array. You’ve got three solutions to pick from — which one do you reckon will get you the quickest result?</p><ol><li>O(n)</li><li>O(n²)</li><li>O(1)</li></ol><p>If you put your money on the third one, then give yourself a pat on the back — you nailed it! This guy runs at O(1) complexity, or as we call it, “Big O of 1”. What’s cool about it is that no matter how big your input gets, your algorithm won’t slow down. It’s like the Usain Bolt of algorithms — lightning fast!</p><p>Now, to break it down even more, Big O notation is like a measuring tape for your code’s performance. It shows you how much the runtime of your code will increase as your input gets bigger. Here are some examples:</p><ol><li>Linear: f(n) = n</li><li>Quadratic: f(n) = n²</li><li>Constant: f(n) = 1</li></ol><p>The first equation, f(n) = n, represents a linear time complexity or O(n). Think of a single loop going through your data — the bigger your data, the longer it’ll take.</p><p>Second up, f(n) = n², or O(n²), is quadratic time complexity. This is like having loops within loops — it’s going to take longer as your input size grows. It’s like trying to find your lost keys in a mansion!</p><p>Lastly, f(n) = 1, or O(1), shows us constant time complexity. It’s like basic arithmetic — no matter how complicated your input gets, this guy won’t slow down.</p><p>Big O notation is like your speedometer in coding. It helps you figure out how your code will perform under different conditions. It’s your key to writing efficient, high-performance code. Trust me, your future self (and your users) will thank you for taking the time to get to grips with it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2837ec62ce0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hackathon Experience]]></title>
            <link>https://medium.com/@Kenneththedev/hackathon-experience-c0c79374b050?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0c79374b050</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 14:25:09 GMT</pubDate>
            <atom:updated>2022-07-19T14:27:54.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*7xwvhS7R6-aoTrn1fxongA.jpeg" /></figure><p>Back in late April, I decided to join a Hackathon, hosted by TH.0. They have themes for Hackathons and this one was Fintech. We had 48 hours to collaborate on a product that will change the industry with a full business pitch. The entire hackathon was hosted on Discord. TH.0 had channels for each role within a team. The roles consisted of , data-scientist, security &amp; QA, UX-UI, and sales-and-marketing. Naturally I went into the developer channel, listed my skills, background of experience, location and LinkedIn. From there on it was every man/women for themselves. I decided to reach out to a team who already appeared to be active and just like that I had a team. In the end we were 7, Sales and Marketing, UX Designer Backend, Frontend and 3 other Web Developers with mobile and applied informatic skills.</p><p>We all jumped in a call on Discord and broke bread. I learned that most of my teammates lived in Europe and I was easily able to make a connection with them through what most of the world calls Football. After a few minutes of conversation we had to whip up our product, which turned out to be pretty cool and a first in the Fintech space.</p><p>In the end we built an application that offers users a convenient and simple method to access various currencies across the globe at a vastly affordable price point. We had an entire presentation that identified a problem in FinTech. How our application can solve that problem and then how we can theoretically do so with our demo, figma, and code. During that fun 48 hours there was an event that made me realize that I am flexible and have the potential to one day step into a leadership role. Midway through we were told that the most important part is our demo of the application and our presentation. So I dropped my role as a frontend developer and transitioned into a product manager. We already had demo of our application and as team, we felt there was no longer a need for front end code. I learned about how to work with a team in a Software Engineering position to create a product as well as rediscovering my ability to step into a leadership position. We ended up coming in second.</p><p>Once again shoutout to the team.</p><p>Here is our presentation:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F731386167%3Fh%3D9ba44697dc%26app_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F731386167&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1472006191-b0cf0be7558f7bbb646a2ee9c15ad6dfcccb7632f8d9962100f5a3f3d8decc30-d_1280&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/eea149cded27802caef9a308e549be4d/href">https://medium.com/media/eea149cded27802caef9a308e549be4d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Pr_U-5euUi2NuVYFSbTtA.png" /></figure><p>If anyone would like to participate in a Hackathon in the future</p><p><a href="https://thpoint0.io/hackathon/">https://thpoint0.io/hackathon/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0c79374b050" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running this command in your terminal could save you hours]]></title>
            <link>https://medium.com/@Kenneththedev/running-this-command-in-your-terminal-could-save-you-hours-2fc4d09170b7?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fc4d09170b7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 17:17:09 GMT</pubDate>
            <atom:updated>2022-04-26T21:14:40.324Z</atom:updated>
            <content:encoded><![CDATA[<p>During our phase 4 project week my group and I ran into an issue with our terminal. Suddenly we could no longer generate models, migrations or anything of that nature, the terminal became unresponsive. We scoured the internet high and low using our new found “googling” skill. After 24 hours of being stuck in the mud, unable to run rails g we decided to bite the bullet and ask our instructor of some assistance. Side note, for future Bootcamp or Flatiron School Students, don’t be afraid to ask for assistance, its okay to not no something , you’re a student and here to learn. Within seconds of detailing our error, the instructor told my teammates to run spring stop in the terminal. For some reason I didn’t have this issue, maybe there is some correlation with the fact that my teammates are both Mac users and I, a Windows user.</p><p>Personally I thought there was no way running a silly command such as spring stop will solve the issue at hand. Leading us to be on zoom for hours because, of all the developers/engineers on this planet, I was convinced we invented a new error no one had ever seen before.</p><figure><img alt="Baby Yoda holding a cup" src="https://cdn-images-1.medium.com/max/933/1*Eu5nFQvG3_1ypE811BfyTQ.jpeg" /><figcaption>Me, settling in to be on zoom for a while</figcaption></figure><p>My teammate then ran a rails g model with some random strings, and wouldn’t you know it, we have a responsive terminal. I bowed down to the big brain of my instructor just like the spectators of the Camp Nou when Messi scores a beautiful goal.</p><figure><img alt="Michael Jordan tears of joy (not my dad)" src="https://cdn-images-1.medium.com/max/600/1*SiCsRDqoLUDTT-H7Pjitdg.jpeg" /><figcaption>tears of joy, and sadness because Messi no longer plays for Barcelona</figcaption></figure><p>At that moment I had to do some research as to why that worked, here are my findings.</p><p>Spring is a Rails application preloader. It speeds up development by keeping your application running in the background, so you don’t need to boot it every time you run a test, rake task or migration.</p><p>In the event you’re coming from ruby or no backend experience at all, the spring will essentially spare you from constantly re-running your application post tests or migrations. Spring by the way is a rails gem that comes with creating a rails application.</p><p>tl;dr If you’re using Ruby on Rails and attempting to generate anything with the rails g command and getting an unresponsive terminal as a result, give spring stop a shot.</p><p>Happy coding nerds 😁</p><h3>References</h3><p><a href="https://github.com/rails/spring">GitHub - rails/spring: Rails application preloader</a></p><p>LinkedIn</p><p><a href="https://www.linkedin.com/in/kennethjordan2/">https://www.linkedin.com/in/kennethjordan2/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fc4d09170b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m Going To Rescue You From Key Strokes]]></title>
            <link>https://medium.com/@Kenneththedev/im-going-to-rescue-you-from-key-strokes-f9aa46b8412e?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9aa46b8412e</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 16:43:36 GMT</pubDate>
            <atom:updated>2022-04-20T16:43:36.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*2GIRzJDiWHlEAhXaHh_gUQ.jpeg" /></figure><p>We’ll be talking about the wonders of using the private method.</p><pre><em>Using a private method to encapsulate the permissible parameters</em><br> <em>is just a good pattern since you&#39;ll be able to reuse the same</em><br> <em>permit list between create and update. Also, you can specialize</em><br> <em>this method with per-user checking of permissible attributes.</em></pre><p>We’ll be refactoring some params into strong params. Lets say we wanted to return the rest of our CRUD(Create Read Update Destroy) actions. We could do all of that and have a decent amount of reusable code. Thankfully with the private method we no longer have to do such a thing!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*TWoFVUPBdXA_A-meIzx07A.png" /><figcaption>such wow</figcaption></figure><p>We can store all our reusable code below the private method which is only viable to us, the coders by the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*CwVxMsCmTl_vOHmo8C73Kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*Y32PAO_f3fO4y5Mf5I6CSQ.jpeg" /></figure><p>Thankfully we there are more uses to our wonderful private method. What if we wanted to return status codes when a user gets invalid data or a data that cannot be found. Fear not. Lets say we wanted to return a status code of :not_found if information we’re seeking is not in the database. Normally we could do so by adding some conditional logic inside our show or update actions as show below. However, rather than repeating some simple logic we could add</p><p>rescue_fromActiveRecord::RecordNotFound,with: :render_not_found_response</p><p>on line 2 of our file. rescue_from receives a series of exception classes or class names, and an exception handler specified by a trailing :with option containing the name of a method or a Proc object. Alternatively, a block can be given as the handler. If any of our controller actions throw an ActiveRecord::RecordNotFound exception , our render_not_found_response method will return the appropriate JSON response.</p><p>Would you rather have this block of code or a more refactored code?</p><pre>def show<br>  bird = find_bird<br>  if bird<br>    render json: bird<br>  else<br>    render_not_found_response<br>  end<br>end</pre><pre>def update<br>  bird = find_bird<br>  bird.update(bird_params)<br>  render json: bird<br>rescue ActiveRecord::RecordNotFound<br>  render_not_found_response<br>end</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*loIWC259dSuJUhOcEgJNcw.jpeg" /></figure><pre>class BirdsController &lt; ApplicationController<br>  rescue_from ActiveRecord::RecordNotFound, with: :render_not_found_response<br><br>  # GET /birds<br>  def index<br>    birds = Bird.all<br>    render json: birds<br>  end<br><br>  # POST /birds<br>  def create<br>    bird = Bird.create(bird_params)<br>    render json: bird, status: :created<br>  end<br><br>  # GET /birds/:id<br>  def show<br>    bird = find_bird<br>    render json: bird<br>  end<br><br>  # PATCH /birds/:id<br>  def update<br>    bird = find_bird<br>    bird.update(bird_params)<br>    render json: bird<br>  end<br><br>  # PATCH /birds/:id/like<br>  def increment_likes<br>    bird = find_bird<br>    bird.update(likes: bird.likes + 1)<br>    render json: bird<br>  end<br><br>  # DELETE /birds/:id<br>  def destroy<br>    bird = find_bird<br>    bird.destroy<br>    head :no_content<br>  end<br><br>  private<br><br>  def find_bird<br>    Bird.find(params[:id])<br>  end<br><br>  def bird_params<br>    params.permit(:name, :species, :likes)<br>  end<br><br>  def render_not_found_response<br>    render json: { error: &quot;Bird not found&quot; }, status: :not_found<br>  end<br><br>end</pre><p>tl;dr writting private methods allows your code be become more readable and you save time writing less repeatable code. Personally I&#39;d rather write clear code with exception handling techniques(rescue_from) and strong params.</p><p>References</p><p><a href="https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from">ActiveSupport::Rescuable::ClassMethods</a></p><p><a href="https://guides.rubyonrails.org/action_controller_overview.html#strong-parameters">https://guides.rubyonrails.org/action_controller_overview.html#strong-parameters</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9aa46b8412e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Ruby: A Deeper Dive into Class and Instance Methods]]></title>
            <link>https://medium.com/@Kenneththedev/class-vs-instance-methods-4c3156eb4a11?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c3156eb4a11</guid>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 17:58:48 GMT</pubDate>
            <atom:updated>2023-05-16T19:12:20.325Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings, Ruby learners! Today, we’re exploring two crucial aspects of Ruby’s object-oriented programming: Class and Instance methods.</p><h3>What Are Class Methods?</h3><p>Class methods, in Ruby, are methods associated with a class. They’re defined by using self. in the method name within the class definition. Here&#39;s an example:</p><pre>rubyCopy codeclass Dog<br>  def self.bark<br>    puts &quot;Woof!&quot;<br>  end<br>end</pre><pre>Dog.bark # =&gt; &quot;Woof!&quot;</pre><p>In this example, bark is a class method that we can call directly on the Dog class.</p><h3>What Are Instance Methods?</h3><p>Contrarily, instance methods are methods that belong to instances of a class, often called objects. Here’s how you define and call an instance method:</p><pre>rubyCopy codeclass Dog<br>  def bark<br>    puts &quot;Woof!&quot;<br>  end<br>end</pre><pre>fido = Dog.new<br>fido.bark # =&gt; &quot;Woof!&quot;</pre><p>Here, bark is an instance method. We first instantiate a Dog object with Dog.new, and then call the bark method on it.</p><h3>Bonus: Private Methods</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xGjxNZsVX9Nio2_Y" /><figcaption>Photo by <a href="https://unsplash.com/@dtopkin1?utm_source=medium&amp;utm_medium=referral">Dayne Topkin</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a bonus, let’s take a quick look at private methods in Ruby. Private methods are instance methods that can only be called from within the same class. They cannot be called directly from outside the class or from subclasses. You can define a private method by using the private keyword:</p><pre>class Dog<br>  def bark<br>    puts &quot;Woof!&quot;<br>    secret_message<br>  end<br>  <br>  private<br>  <br>  def secret_message<br>    puts &quot;I&#39;m a secret dog!&quot;<br>  end<br>end</pre><pre>fido = Dog.new<br>fido.bark<br># Output:<br># Woof!<br># I&#39;m a secret dog!</pre><pre>fido.secret_message # =&gt; NoMethodError: private method `secret_message&#39; called for #&lt;Dog:0x00007f8e1c8d7e18&gt;</pre><p>In this example, secret_message is a private method. It can be called within the Dog class, but attempting to call it directly on a Dog instance like fido.secret_message results in a NoMethodError.</p><p>Private methods are a great way to encapsulate behavior and keep your code clean and organized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c3156eb4a11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome To React]]></title>
            <link>https://medium.com/@Kenneththedev/welcome-to-react-6b0ad825d8d?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b0ad825d8d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Wed, 09 Mar 2022 18:02:12 GMT</pubDate>
            <atom:updated>2022-03-09T18:02:12.575Z</atom:updated>
            <content:encoded><![CDATA[<p>Congrats you’ve made it to React. Welcome to JSX, which stands for JavaScript XML. JSX allows us to write HTML in React therefore making it easier to write and add HTML in React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bTEAQN3thaGF9yTi" /><figcaption>Photo by <a href="https://unsplash.com/@von_co?utm_source=medium&amp;utm_medium=referral">Ivana Cajina</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Imperative Code</p><p>More like the struggle and peril of JavaScript. Another term that you may have heard is lower level coding. Where you have to write code in detail. You see the computer isn’t very smart and you have to tell it exactly what to do, especially when it comes to Vanilla JavaScript. When creating DOM elements using vanilla JS it would look like :</p><p>const div = document.createElement(“div”);</p><p>div.id =’card1&#39;;</p><p>div.className = ‘card’;</p><p>div.textContent = ‘hello world’;</p><p>document.body.appendChild(div);</p><p>Declarative Code</p><p>Many people find React more malleable because of declarative programming. Declarative programming enables you to write your code and tell it what you what generally like it to do. For Example</p><p>const div = (</p><p>&lt;div id = ‘card1’ className = ‘card’&gt;</p><p>hello world!</p><p>&lt;/div&gt;</p><p>);</p><p>ReactDOM.render(div,document.body);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*39QVQbPab2dzEw0hJl_XRQ.jpeg" /><figcaption>Thinking react was going to be more difficult than Vanilla JS</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b0ad825d8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This Second Language Will Get You A Job !]]></title>
            <link>https://medium.com/@Kenneththedev/this-second-language-will-get-you-a-job-52e2beeaf3f8?source=rss-31b066bb3824------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e2beeaf3f8</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Kenneth Jordan]]></dc:creator>
            <pubDate>Thu, 17 Feb 2022 17:16:37 GMT</pubDate>
            <atom:updated>2022-02-17T17:16:37.274Z</atom:updated>
            <content:encoded><![CDATA[<h3>This Second Language Will Get You A Job !</h3><p>I’m not talking about Spanish. Beuno pues… podemos hablar en Espanol si prefieres. Still with me? Well, in any case. Let’s get started on why you’re really here. It’s probably because you’re struggling to navigate the terminal for Mac or Windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ee6MdqtMvJvXRWPb" /><figcaption>Photo by <a href="https://unsplash.com/@towfiqu999999?utm_source=medium&amp;utm_medium=referral">Towfiqu barbhuiya</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have no fear because Kenny is here!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Nf1U_f1hBY5ryjZclekbdw.jpeg" /></figure><p>Let’s start with some beginner stuff. By the time you’re done reading this blog post you’ll be typing into your terminal faster than Instagram bots in the comment section.</p><p>Lets start with my favorite:</p><p>cd</p><p>Stands for ‘Change Directory’ , you can use this command to move left or right inside of the directory. In order to get where you’re going type in cd directory name . You can also use cd to return to you the home directory and cd.. to go back one.</p><p>ls<br>Good old ls is a command list which lists&#39; computer files, more specifically, files in the current directory. Lets say you&#39;ve got some files you want to access, but you don’t know for sure if it’s in your directory ls will show you what goodies are in your directory.</p><p>mkdir</p><p>Make Directory creates a directory although we have to name it right after typing mkdir. Bonus!! Right after creating a directory use the touch command to create files inside of that directory some staple names for files are main.css, index.js or .html .</p><p>pwd</p><p>Shows you the full path name of your current directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*E8OU6HUlvtE5dfUo_46tKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*njXWCLMbQLxzYzMF5U4aNg.jpeg" /><figcaption>“Don’t Let Your Dreams Be Dreams, Just Do It”</figcaption></figure><p>References</p><p><a href="https://www.digitalcitizen.life/command-prompt-how-use-basic-commands/">https://www.digitalcitizen.life/command-prompt-how-use-basic-commands/</a></p><p><a href="https://www.ibm.com/docs/en/aix/7.1?topic=p-pwd-command">https://www.ibm.com/docs/en/aix/7.1?topic=p-pwd-command</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e2beeaf3f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>