<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nevulo</title>
    <description>The latest articles on DEV Community by Nevulo (@nevulo).</description>
    <link>https://dev.to/nevulo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F633071%2F8851e7d8-5efd-4797-91c4-d68f0efe8526.jpg</url>
      <title>DEV Community: Nevulo</title>
      <link>https://dev.to/nevulo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nevulo"/>
    <language>en</language>
    <item>
      <title>Learning how to unblock yourself in projects</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 16 Jun 2022 13:33:23 +0000</pubDate>
      <link>https://dev.to/nevulo/learning-how-to-unblock-yourself-in-projects-3l2m</link>
      <guid>https://dev.to/nevulo/learning-how-to-unblock-yourself-in-projects-3l2m</guid>
      <description>&lt;p&gt;Being &lt;a href="https://project-management.com/how-to-avoid-blockers-on-a-project/#:~:text=A%20project%20blocker%20is%20anything,are%20also%20almost%20always%20predictable."&gt;blocked&lt;/a&gt; (a phrase used in project management, especially software development in agile teams) typically means there’s something external, outside your control, that is preventing you from making progress in a particular task or project. When this is the case, it can be frustrating, but some blockers are almost impossible to get around.&lt;/p&gt;

&lt;p&gt;Think about bringing a new person on the team and bringing them up to speed with the codebase (which will &lt;em&gt;inevitably&lt;/em&gt; take some time), or contacting a third party who has long reply times.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.trello.com/most-common-project-blockers"&gt;There’s all different types of blockers&lt;/a&gt;. Some blockers can’t be solved for. However, some can be. Think about &lt;em&gt;technical&lt;/em&gt; blockers, which typically happen when developing or planning a solution in software, and you’re having trouble progressing. Unlike dealing with an external entity that is largely out of our control, we’re really only dealing with ourselves here.&lt;/p&gt;

&lt;p&gt;Don’t get me wrong, not all blockers are like this. Regarding technical blockers, you might be faced with technical debt or architectural problems that really do need your attention and take time away from deadlines because that’s ultimately what’s best for the project. There’s a fine balance between quality and producing what you require as fast as possible.&lt;/p&gt;

&lt;p&gt;Let’s break this all down. What does being blocked &lt;em&gt;actually&lt;/em&gt; look like, and what are some actionable tips for ensuring good flow in a project?&lt;/p&gt;

&lt;h2&gt;
  
  
  What does being blocked or impeded look like?
&lt;/h2&gt;

&lt;p&gt;A quick note, what I’m mentioning isn’t necessarily industry standard or anything, but a practical approach to the way I, personally, see blockers. Some can potentially be solved quickly, some probably can’t. Ultimately, to stay productive, we want to try to identify when we’re blocked but also &lt;em&gt;what type of block&lt;/em&gt; we’re experiencing.&lt;/p&gt;

&lt;p&gt;A lot of my experiences are project management in the eyes of a software engineer, but I’m hoping they apply broadly to other roles.&lt;/p&gt;

&lt;h3&gt;
  
  
  External blockers
&lt;/h3&gt;

&lt;p&gt;I see external blockers as &lt;strong&gt;true blockers&lt;/strong&gt;. At the end of the day, if you’re relying on a third party to complete something, and it’s a &lt;em&gt;must-have&lt;/em&gt;, there’s probably not much you can do in a practical sense.&lt;/p&gt;

&lt;p&gt;A good example of this is a SaaS (software-as-a-service) provider that you’ve made an agreement with, but doesn’t offer exactly what you need.&lt;/p&gt;

&lt;p&gt;With some blockers that last a few hours or days, or when you have obligations, it’s not really sensible to entirely change around your approach just to get around one thing.&lt;/p&gt;

&lt;p&gt;External blockers give you a good opportunity to pick up new work though to keep up the general flow of the project, ideally work with a turn-around rate that is within the timeframe you’re roughly expecting to be unblocked in.&lt;/p&gt;

&lt;p&gt;In a complete worst-case scenario, you can try a few other pragmatic actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reducing the scope of the project to avoid particular requirements leading to the blocker&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;increasing&lt;/em&gt; the scope/time-frame of the project, and looking into developing your own solutions to avoid an external entity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Internal blockers
&lt;/h3&gt;

&lt;p&gt;Internal blockers occur &lt;em&gt;internally&lt;/em&gt; within an organisation or team. Common internal blockers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new people coming on the team&lt;/li&gt;
&lt;li&gt;dependencies, such as approval from teams that take longer than planned&lt;/li&gt;
&lt;li&gt;communication break-downs or misunderstandings&lt;/li&gt;
&lt;li&gt;technical problems, like needing to address a severe problem in a different area of the project, taking time away from what you’re working on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of these blockers boil down to the need for more planning. Playing devil’s advocate, there’s also a downside to &lt;em&gt;&lt;a href="https://blog.weekdone.com/planning-reporting/"&gt;over-planning&lt;/a&gt;&lt;/em&gt; if you have a strict deadline. If you’re trying to get something done in 3 months, you typically don’t want to spend 2 months planning.&lt;/p&gt;

&lt;p&gt;It also comes down to resource and priority management within your team; making sure you’re not spending too much time doing things that don’t bring value to the final results of the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Personal blockers
&lt;/h3&gt;

&lt;p&gt;This is where you can often put power in your hands and take action towards blockers.&lt;/p&gt;

&lt;p&gt;There’s the argument that a personal blocker isn’t really worth noting down as a blocker, but the truth is, we’re all human, and occasionally, we unintentionally go down a rabbit hole, get stuck, or have many priorities.&lt;/p&gt;

&lt;p&gt;Some examples that come to my mind for personal blockers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;up-skilling yourself for a task, like navigating around a new service or diving into areas that you’re not super knowledgable in&lt;/li&gt;
&lt;li&gt;getting stuck on a certain problem to solve some requirement for the project&lt;/li&gt;
&lt;li&gt;focusing attention in areas which aren’t directly contributing to the end goals for the overall project&lt;/li&gt;
&lt;li&gt;time-management and task-management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s true that even some personal blockers take longer than we might expect to get around. But often, I find with personal blockers, there are a few key things I ask myself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is there a different, sensible approach to get to the same solution?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Sometimes, we need to settle with a solution for the sake of time that works now, but we might want to change down the line. This can lead to technical debt – and though you don’t want too much, a little isn’t bad. Don’t overshoot for perfection, especially with a strict deadline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is there a quicker way to do this?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Instead of doing something manually, could I automate it? If it’s practical, could I get the help from somebody else to solve this faster (through pairing or reviews, for example)?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What resources are available to me to get around this blocker?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Such as asking team members for help, getting in touch with a support person, looking online for documentation to get clarification, etc.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Actionable tips to unblock you and your team to keep moving forward
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Identify if you’re blocking &lt;em&gt;yourself&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Often, the first thing I’ll do if I’m blocked is try to see if I’m actually blocking myself, as mentioned earlier. If you are, set out to follow a series of logical steps to find a way to unblock yourself.&lt;/p&gt;

&lt;p&gt;Ensure you’re not spending too much time in a certain area, and keep track of your personal flow to find room for improvements. Remember – it’s always okay to ask for help!&lt;/p&gt;

&lt;h3&gt;
  
  
  Allocate strict time/effort resources, like a budget
&lt;/h3&gt;

&lt;p&gt;You want to avoid spending too much time in the wrong areas. Use tools like &lt;a href="https://clockify.me/timeboxing#:~:text=Timeboxing%20is%20a%20simple%20time,activity%20within%20that%20time%20frame."&gt;time boxing&lt;/a&gt; to ensure you’re allocating a specific amount of time to certain tasks, or a system like &lt;a href="https://www.visual-paradigm.com/scrum/what-is-story-point-in-agile/"&gt;story points&lt;/a&gt; to know ahead of time the amount of effort, risk, or complexity involved with a certain task.&lt;/p&gt;

&lt;h3&gt;
  
  
  As a last resort: work through a different problem
&lt;/h3&gt;

&lt;p&gt;There are a few benefits to picking up new work to get around a blocker in existing work. There’s some research around the fact that &lt;a href="https://www.psychologytoday.com/us/blog/the-refugee-experience/202103/can-taking-break-lead-aha-moments"&gt;taking a break can help you find the solution to problems quicker&lt;/a&gt;, and I’ve personally found this to be true when working through a different problem. Usually, I’ll be able to come back to the original work that was blocked and see with “clearer eyes” 👁&lt;/p&gt;

&lt;p&gt;The main thing to watch out for is &lt;em&gt;&lt;a href="https://www.rhythmsystems.com/blog/calculate-your-teams-bandwidth-before-quarterly-planning"&gt;team bandwidth&lt;/a&gt;&lt;/em&gt;, which tracks how much time team members &lt;em&gt;actually have&lt;/em&gt; to complete tasks given other priorities they’re already working through. In other words – you want to avoid overloading anyone.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>management</category>
      <category>product</category>
      <category>leadership</category>
    </item>
    <item>
      <title>Top tools to help you stay productive as a developer</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 16 Jun 2022 12:59:51 +0000</pubDate>
      <link>https://dev.to/nevulo/top-tools-to-help-you-stay-productive-as-a-developer-hho</link>
      <guid>https://dev.to/nevulo/top-tools-to-help-you-stay-productive-as-a-developer-hho</guid>
      <description>&lt;p&gt;I’m obsessed with squeezing out productivity wherever possible. Over the years, I’ve developed a workflow that helps me get work done effectively and efficiently. I’m a massive fan of having lots of information available at my disposal, while also remaining organised and clean (sometimes, at least 😅).&lt;/p&gt;

&lt;p&gt;I’m also a big believer in tools and &lt;em&gt;apps&lt;/em&gt;. In some cases, I think finding the right tool for the job (or in my case, a well-made application) can help you optimise your workflow to help you be more efficient and productive.&lt;/p&gt;

&lt;p&gt;Everybody’s got a different definition of what it means to be productive. I’ll be mentioning 7 different types of applications I use daily as a software engineer to help me stay productive, why it helps me personally, as well as alternative applications to try to fit your needs!&lt;/p&gt;

&lt;h2&gt;
  
  
  Terminal — iTerm
&lt;/h2&gt;

&lt;p&gt;iTerm is a terminal for macOS which has all the features you could ever want. It describes itself as a “replacement” for the terminal, but I think it’s more of a re-imagination of the terminal and what’s possible to squeeze the most functionality out of a terminal for your productivity.&lt;/p&gt;

&lt;p&gt;Here’s just &lt;em&gt;some&lt;/em&gt; of my favourite features iTerm offers out of hundreds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Splitting panes horizontally and vertically for maximum space-to-productivity ratio&lt;/li&gt;
&lt;li&gt;Powerful search (with regex support)&lt;/li&gt;
&lt;li&gt;Instant replay (travel back in time to recover lost text, super cool!)&lt;/li&gt;
&lt;li&gt;Auto-completion with a suggestion window&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xq2nmGGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/iterm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xq2nmGGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/iterm.png" alt="A window showing the iTerm terminal, with 2 panes, split vertically. The first pane shows the &amp;quot;top&amp;quot; command being executed, along with &amp;quot;echo 'Yeah boy'&amp;quot;. The second pane shows &amp;quot;cat test.txt&amp;quot; being executed, the output being &amp;quot;This is a cool little terminal!&amp;quot;." width="880" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As for auto-completion and suggestions, an honourable mention goes to &lt;a href="https://fig.io/"&gt;Fig&lt;/a&gt;, a tool that integrates with your existing terminal to display smart suggestions and information when you’re stuck in the command line. Forgot certain commands or the structure of arguments? Fig is there to help.&lt;/p&gt;

&lt;p&gt;Some fine alternatives to iTerm include &lt;a href="https://www.warp.dev/"&gt;Warp&lt;/a&gt;, a terminal built for the 21st century that looks and feels buttery-smooth. Very aesthetic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zGavXUyY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/warp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zGavXUyY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/warp.png" alt="A window showing Warp with 2 panes visible, split vertically. The first pane shows the command &amp;quot;top&amp;quot; being executed, then an invalid command, then &amp;quot;echo 'Yeah boy'&amp;quot;. The second pane shows the command &amp;quot;cd Desktop&amp;quot; being executed, along with &amp;quot;cat test.txt&amp;quot;, the output being &amp;quot;This is a cool little terminal!&amp;quot;" width="880" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both of these are unfortunately only available for macOS currently (Warp is &lt;a href="https://zachlloyd.typeform.com/to/lWeDTQnr?utm_source=www&amp;amp;typeform-source=www.warp.dev"&gt;planning for a Windows/Linux release&lt;/a&gt;, however).&lt;br&gt;
If you’re on Windows, the next best thing is probably the &lt;a href="https://github.com/microsoft/terminal"&gt;Windows Terminal&lt;/a&gt;, in my opinion. Not your standard “Command Prompt”; this is redesigned from the ground up to give you major customisation options with features similar to iTerm, while remaining performant with GPU acceleration.&lt;/p&gt;

&lt;h2&gt;
  
  
  IDE — Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;Visual Studio Code is an integrated development environment (IDE) from Microsoft that focuses on simplicity while opening the door for extreme customisation, extension support and other advanced features to help you stay productive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_ejLayTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/vscode.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_ejLayTc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/vscode.png" alt='A window of Visual Studio Code. TypeScript code is shown, the respective file being "parse.ts" showing a "parseAsStringArray" method with some intentional errors and the autocompletion menu visible. The full code can be found in the Nevvulo/dev-to-publisher repository on GitHub.' width="880" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can try out VS Code without downloading anything, &lt;a href="https://vscode.dev"&gt;right in your browser&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Not interested in using software from a big corporation or buying into the hype? &lt;a href="https://lapce.dev/"&gt;Lapce&lt;/a&gt; is an adequate alternative focused on great performance. Full disclosure—in my testing, things weren’t working so great, such as TypeScript syntax highlighting or opening certain files, and it is still under heavy development.&lt;/p&gt;

&lt;p&gt;A more robust, battle-tested solution is &lt;a href="https://www.sublimetext.com/"&gt;Sublime Text&lt;/a&gt;. Initially released in 2008 and designed by &lt;a href="http://www.sublimetext.com/about"&gt;ex-Google engineer Jon Skinner&lt;/a&gt;, who had the goal of making a better text editor, Sublime Text has many similar features to VS Code, focused on speed and extensibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  Note-taking — Notion
&lt;/h2&gt;

&lt;p&gt;I like to consider Notion to be a digital, opinionated piece of paper. You’re free to do whatever you want in whatever format you’d like, whether that’s note-taking, tracking expenses, formal specifications/documentation for a project, and so much more.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mImGskoJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/notion.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mImGskoJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/notion.png" alt='A Notion page, title is "Nevuletter", with 6 pages in a grid pattern: "Distribution", "Marketing", "Known Issues", "Archive", "Workflow" and "Idea Dump". Below the pages is a calendar view with the title "Content Distribution Timeline", showing one item in June 3rd' width="880" height="933"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At its core, Notion has different types of “blocks” that build up pages that can be arranged in countless unique ways. Notion integrates with lots of different services which allows you to create &lt;em&gt;rich&lt;/em&gt; documents with embeds, maps, drawings, whatever your heart desires.&lt;/p&gt;

&lt;p&gt;Another great alternative is going back to basics; pen and paper! There’s absolutely nothing wrong with taking notes in your notebook or on a loose piece of paper. I like the digital aspect, so I can search through old notes, link my thinking, and organise things when necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calendar — Cron
&lt;/h2&gt;

&lt;p&gt;It’s about time. According to Cron, at least.&lt;br&gt;
&lt;a href="https://cron.com/"&gt;Cron&lt;/a&gt; is a “next-generation calendar for professionals and teams”. I’ve been using Cron for about 3 months, and there’s a lot of little, nice things that help you juice that extra bit of productivity in your life.&lt;/p&gt;

&lt;p&gt;Some notable things I, personally, love about Cron:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quick access to join meetings attached to an event with one click&lt;/li&gt;
&lt;li&gt;Integrates with the menu bar on macOS for easy access to see your next event&lt;/li&gt;
&lt;li&gt;See all the information you could ever need when planning new events/meetings, including the availability of invitees&lt;/li&gt;
&lt;li&gt;Automatically create Zoom links when creating meetings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w6u4Tnet--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/cron.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w6u4Tnet--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/cron.png" alt="A window showing Cron. The user is creating an event with 2 other people, showing a drop-down menu for available meeting rooms." width="880" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love the simplicity of Cron while remaining extremely functional. Cron is great at what it does; being a calendar. It’s great for time-management, blocking out time and giving me great access to information to make informed decisions around booking time with others.&lt;/p&gt;

&lt;p&gt;As of writing, Cron is currently in early access, but with its recent acquisition by none other than &lt;a href="https://www.notion.so/product"&gt;Notion&lt;/a&gt; mentioned earlier, it won’t be long before you can have access too!&lt;/p&gt;

&lt;p&gt;In the meantime, there are two alternatives which also might help you be more productive and save time. If you find yourself spending more time organising your calendar than getting stuff done, why not let artificial intelligence take the wheel?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://reclaim.ai/"&gt;Reclaim&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href="https://www.usemotion.com/"&gt;Motion&lt;/a&gt;&lt;/strong&gt; use the power of AI to automate your planning and create a more efficient, effective workflow to help you get around to everything you want to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  To-do tracker — Todoist
&lt;/h2&gt;

&lt;p&gt;Life is basically one big to-do list. I’ve dedicated a lot of my time to finding a good to-do tracking application. Probably too much time.&lt;/p&gt;

&lt;p&gt;In the end, for now, I’ve settled with &lt;strong&gt;&lt;a href="https://todoist.com/home"&gt;Todoist&lt;/a&gt;&lt;/strong&gt;. It simply has everything I need and more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The ability to track multiple projects (such as work, personal tasks, etc.)&lt;/li&gt;
&lt;li&gt;Setting deadlines and due dates, with the ability to set reminders&lt;/li&gt;
&lt;li&gt;Attach priority levels to tasks, so you know what’s important at a glance&lt;/li&gt;
&lt;li&gt;Works great with teams, allowing you to assign people to tasks as well as add labels&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most important thing for me personally, however, is the speed at which I can add new tasks and check off existing items. I’ve noticed as a software engineer, my day moves around a lot, and I’ve got many priorities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FGy3I6ES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/todoist.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FGy3I6ES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/todoist.png" alt='Todoist application with 26 tasks under the "blog improvement + features" section. 3 incomplete tasks are visible, the first task is "Email autofill field in newsletter subscribe box", the second task is "Add newsletter subscription banner on homepage". The final task is "Add favourite functionality with stars", which is due on July 5th and has 4 sub-tasks. The description for this task reads "Users should be able to upvote a discussion on GitHub relating to the blog post through custom interface". The 4 sub-tasks are: "Fetch star count for each post on build, revalidate when stale (1 hour)", "Allow authenticated users to star a blog post, sending upvote request to respective discussion on GitHub", "Allow users to remove star from post", "Add animation when starring posts".' width="880" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve also often got a lot of “sub-tasks” to complete before I can call something truly done. Todoist provides a simple interface to give rich detail where necessary, while also allowing me to jot down new tasks when things change quickly.&lt;/p&gt;

&lt;p&gt;There are so many alternatives to any to-do tracking app that I couldn’t possibly list them here. In the past, I’ve also made good use of &lt;a href="https://trello.com/"&gt;Trello&lt;/a&gt;, which has a lot of the same features, showing your tasks as cards in columns (known as a &lt;a href="https://www.atlassian.com/agile/kanban"&gt;kanban&lt;/a&gt; board).&lt;/p&gt;

&lt;h2&gt;
  
  
  Design — Figma
&lt;/h2&gt;

&lt;p&gt;A lot of the applications listed so far are focused on simplicity with power under the hood to allow you to move quickly when needed, but also get the same value when it’s time to switch gears.&lt;/p&gt;

&lt;p&gt;Figma is a wonderful example of this philosophy. It’s lightweight and gets out of your way, so you can draft up wireframes or sketches quickly, while giving you the power to create incredible, modern, and professional-looking designs.&lt;/p&gt;

&lt;p&gt;Even though I’ve got practically no design skills, I was able to quickly create designs for my newsletter, &lt;a href="https://nevuletter.nevulo.xyz"&gt;Nevuletter&lt;/a&gt;, in less than an hour. It’s intuitive, and with all the functionality also accessible through their web-app, it’s a collaboration power-house.&lt;/p&gt;

&lt;p&gt;I’ve used Adobe XD in the past, and it’s an absolute headache. I feel like Creative Cloud is an ever-growing virus – even if I wiped my computer, it’d probably still somehow launch at startup 😆&lt;/p&gt;

&lt;p&gt;Jokes aside, Figma is outstanding for amateur and professional designers alike. If you’re a big fan of quickly getting ideas down into drawings or creating quick diagrams without worrying about your design skills, &lt;a href="https://excalidraw.com/"&gt;Excalidraw&lt;/a&gt; is another great tool I can recommend.&lt;/p&gt;

&lt;p&gt;I use Excalidraw for some images in my blog posts. It’s a great tool for creating quick diagrams and drawings to get your point across visually.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z2lIMwqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/excalidraw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z2lIMwqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/developer-productivity/excalidraw.png" alt='An Excalidraw drawing that reads "Excalidraw is an awesome tool for creating quick diagrams and drawings". An arrow points to this text, with more text below reading "with a hand-drawn feel!". "I made this in 2 minutes 💪". A  line graph with fake data is seen on the right.' width="880" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve found it’s also helpful for planning, or just representing an idea to somebody in a really fast, dirty way, while remaining legible and pretty. Each drawing feels like it had effort put in behind it, thanks to the hand-drawn look Excalidraw provides.&lt;/p&gt;

&lt;h2&gt;
  
  
  API Tooling — Insomnia
&lt;/h2&gt;

&lt;p&gt;This one goes out to those working with APIs. &lt;a href="https://insomnia.rest/"&gt;Insomnia&lt;/a&gt; is a dedicated API client, the main benefit being you’re able to hit any endpoint, supplying any data you need in requests to test that everything works properly and getting detailed information around the response for that request.&lt;/p&gt;

&lt;p&gt;One thing I’ll admit around Insomnia (and why I sometimes prefer Postman) is the fact that it doesn’t support &lt;a href="https://swagger.io/docs/specification/describing-parameters"&gt;path parameter variables&lt;/a&gt;. It might be a bit niche, and Insomnia does have a good community and extension support, but I think Postman nails this down better.&lt;/p&gt;

&lt;p&gt;Another alternative you might want to look into is &lt;a href="https://paw.cloud/"&gt;Paw&lt;/a&gt; – it’s a paid tool, and only available for macOS, but it has everything most people would need. The design is simplistic and modern, my only gripe is that it is so feature rich that it has a bit of a learning curve, and some basic actions felt a bit buried in the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As of today, most of the tools listed here are my go-to’s. They’re the tools I keep reaching back for, to get the job done, and documenting them here feels like solidifying my “developer toolkit”.&lt;/p&gt;

&lt;p&gt;I encourage everyone to create a short list of what you’re using today, for many reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You don’t forget what you’re using and why you’re using it&lt;/li&gt;
&lt;li&gt;To look back in the future to find improvements in your workflow (and celebrate that!)&lt;/li&gt;
&lt;li&gt;To help others find tools or workflows that you might be using in unique ways&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of the day, one thing I love is that everybody &lt;em&gt;does&lt;/em&gt; work differently, and I learn a lot when watching how other people work. I don’t use Vim or Emacs personally, but that’s just because that’s what works best &lt;em&gt;for me&lt;/em&gt;. I know that plenty of people work faster than me using those tools and many other things I probably have no idea about.&lt;/p&gt;

&lt;p&gt;What’s important to help you stay productive isn’t necessarily the &lt;em&gt;tools&lt;/em&gt;, but rather your &lt;em&gt;workflow&lt;/em&gt;, how you &lt;em&gt;use&lt;/em&gt; the tools to get you closer to your goals. At the start of this post, I mentioned that I’m a big “apps” guy. I love digital things and applications to improve my life, but it’s possible that might change, and that it’s different for you.&lt;/p&gt;

&lt;p&gt;Keeping track of the tools you’re using, and broader goals, helps you stay productive as a developer, so you can find ways to improve your workflow.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>tooling</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why learning basic programming is important</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 02 Jun 2022 17:02:17 +0000</pubDate>
      <link>https://dev.to/nevulo/why-learning-basic-programming-is-important-5cdc</link>
      <guid>https://dev.to/nevulo/why-learning-basic-programming-is-important-5cdc</guid>
      <description>&lt;p&gt;I’ve written about how &lt;a href="https://nevulo.xyz/blog/command-line"&gt;having fundamental knowledge on the command line can help you&lt;/a&gt; outside of landing an engineering role. It can help give you better visibility around what’s happening on your computer, on top of automating common, mundane tasks.&lt;/p&gt;

&lt;p&gt;What about programming in general, though? What benefits do non-engineers gain from learning how to give instructions to a computer through code, and how can it help you in your day-to-day life, regardless of who you are or what you do?&lt;/p&gt;

&lt;p&gt;With the rise of “no-code” tools, on the surface it seems like engineers might even be obsolete. Unfortunately, I can assure you that &lt;a href="https://www.alexhudson.com/2020/01/13/the-no-code-delusion/"&gt;while these tools seem attractive&lt;/a&gt;, they’re all powered by one thing under the hood despite the name: code.&lt;/p&gt;

&lt;p&gt;Learning basic computer programming fundamentals (not anything crazy, like how to invert a binary tree 🤓) is super important in this growing digital age. Even if the benefits aren’t clear now, in just the few years I’ve spent programming and building up my knowledge over time, it’s thoroughly changed the way I think and approach the real world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Abstract &amp;amp; logical thinking
&lt;/h2&gt;

&lt;p&gt;Programming promotes logical and creative thinking. There’s always more than one way to solve a particular problem and satisfy requirements.&lt;/p&gt;

&lt;p&gt;Like many software solutions, something as benign as &lt;a href="https://nevulo.xyz/blog/getting-started-with-csharp"&gt;creating a basic quiz&lt;/a&gt; can be broken down into many smaller problems, building up to bigger functionality:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Showing the question to be answered by the user&lt;/li&gt;
&lt;li&gt;Prompting the user for their answer &amp;amp; storing their input&lt;/li&gt;
&lt;li&gt;Comparing the user's answer to the correct answer
etc…&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each project you build or plan will have different requirements, but fundamentally you need to think on a microscopic scale around the problems to be solved to get to the final result. Think of it like explaining what you want done to a 5-year-old.&lt;/p&gt;

&lt;h2&gt;
  
  
  Productivity &amp;amp; the power of automation
&lt;/h2&gt;

&lt;p&gt;They say great programmers are &lt;a href="https://www.forbes.com/sites/forbestechcouncil/2018/01/08/developers-are-lazy-and-thats-usually-a-good-thing"&gt;lazy&lt;/a&gt;, and I’m no exception. The word “lazy” might have a negative connotation, but being lazy can be a good thing. You’ll rarely catch me spending 5 hours manually inputting data into an Excel sheet because &lt;em&gt;surely&lt;/em&gt;, there’s a better way.&lt;/p&gt;

&lt;p&gt;I’m obsessed with &lt;em&gt;efficiency&lt;/em&gt;. My mind is constantly looking for small &lt;em&gt;optimizations&lt;/em&gt; to increase throughput.&lt;/p&gt;

&lt;p&gt;Let’s say you’re working on an app with 50 thousand users. Your boss wants you to send through an Excel sheet containing information on how many of those 50 thousand users have signed up for a specific feature. All the data you need is available in the database, but there’s just one problem. There’s 50 thousand users.&lt;/p&gt;

&lt;p&gt;Even if you’re in a good rhythm, and it takes you ~2 seconds to get one user’s data and document it in the spreadsheet, it would take you just over a full day of work to complete that one report.&lt;/p&gt;

&lt;p&gt;It’s possible some companies would just bear the cost of hiring a few extra employees with some overtime to expedite those results. But, even when you split the work across multiple people, it’s hours of time that could be spent elsewhere. Why settle with “good enough”?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Give me six hours to chop down a tree, and I will spend the first four sharpening the axe.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A creative solution through programming can save you incredible amounts of time, allowing you to “buy back” time you would’ve spent doing the task had you not developed an automated solution. Essentially, offloading time you would’ve spent doing this dull task to a computer, so you can be more productive.&lt;/p&gt;

&lt;p&gt;Or, if you’re like me, automating tasks to get back precious time for games or YouTube. Need to manage that a bit better…&lt;/p&gt;

&lt;h2&gt;
  
  
  A more in-depth understanding of technology
&lt;/h2&gt;

&lt;p&gt;Technology is becoming an increasingly important part of our lives. We’re surrounded by technology everywhere we look, and the rate of technological developments and breakthroughs has no sign of slowing down.&lt;/p&gt;

&lt;p&gt;I think there’s benefit in having at least a surface-level, superficial understanding of how the services and tools we use work under the hood, for many reasons, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;being able to troubleshoot issues independently, saving time and potentially money&lt;/li&gt;
&lt;li&gt;not being left in the dark when others are using certain technical terminology&lt;/li&gt;
&lt;li&gt;incorporating technology in your interests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Okay, I get the idea. Where do I get started?
&lt;/h2&gt;

&lt;p&gt;Learning basic programming &lt;em&gt;is&lt;/em&gt; indispensable, but it’s definitely daunting if you’ve got no idea where to start. Even if you’re actively learning, but searching for some extra tips to supercharge your path to being a great developer, take a look at my piece on Earlywork around &lt;strong&gt;&lt;a href="https://earlywork.substack.com/p/5-secrets-self-teach-coding"&gt;5 secrets to teach yourself how to code&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;It goes into detail around why setting tangible goals is essential, planning &amp;amp; breaking down problems, but most importantly, getting your hands dirty and digging deep to solve puzzles.&lt;/p&gt;

&lt;p&gt;I’m on a personal mission to make programming more accessible and understandable for people all around the world through my newsletter, &lt;strong&gt;&lt;a href="https://nevuletter.nevulo.xyz/"&gt;Nevuletter&lt;/a&gt;&lt;/strong&gt;. Check it out, and subscribe if you’re looking for more content like this and other valuable information to hit the ground running, with a vast repository of programming knowledge around all kinds of topics.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Why do I code?</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 02 Jun 2022 16:54:06 +0000</pubDate>
      <link>https://dev.to/nevulo/why-do-i-code-2d31</link>
      <guid>https://dev.to/nevulo/why-do-i-code-2d31</guid>
      <description>&lt;p&gt;Learning how to read and write code is a versatile skill. I recently wrote about why I &lt;a href="https://nevulo.xyz/blog/why-programming-is-important"&gt;believe learning how to program is a vital skill&lt;/a&gt; that everybody should look to achieve.&lt;/p&gt;

&lt;p&gt;This is for those who are looking to start out, or those who are in the space but struggling to find the motivation to continue. I want to share some inspiration around reasons &lt;em&gt;why&lt;/em&gt; I code, why I &lt;em&gt;love it&lt;/em&gt;, and how you can shift your mindset to stop programming from becoming a &lt;em&gt;chore&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I started coding
&lt;/h2&gt;

&lt;p&gt;I’ve been interested in computers since before the age of 10, but I can attribute one of my earliest experiences with programming with Visual Basic .NET (also known as VB.NET).&lt;/p&gt;

&lt;p&gt;Somewhere around the age of 13, Visual Basic .NET was my first exposure to object-oriented programming. No need to go into my backstory, all I was excited about was being able to create Windows applications that could do certain things when clicking on buttons.&lt;/p&gt;

&lt;p&gt;For the first time, I had the &lt;em&gt;power&lt;/em&gt; to create essentially anything I wanted to. This, combined with my constantly evolving curiosity and desire to get better, I was always asking myself “how can this be better”? What else could I create if I used the knowledge I gained since the last thing I created?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I love coding today
&lt;/h2&gt;

&lt;p&gt;There are many reasons I love coding, some of which I’ve listed later in this post. One that stands out is the fact that I’m obsessed with self-improvement, for my own sake and to give a better experience for everybody involved.&lt;/p&gt;

&lt;p&gt;Going back to the VB.NET story, below is an example of what the syntax looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;Private&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt; &lt;span class="nf"&gt;Button1_Click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sender&lt;/span&gt; &lt;span class="ow"&gt;As&lt;/span&gt; &lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="ow"&gt;As&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;Handles&lt;/span&gt; &lt;span class="n"&gt;Button1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Click&lt;/span&gt;
    &lt;span class="k"&gt;Dim&lt;/span&gt; &lt;span class="nv"&gt;message&lt;/span&gt; &lt;span class="n"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello World!"&lt;/span&gt;
    &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s what &lt;em&gt;my&lt;/em&gt; VB.NET code looked like roughly 7 years ago:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--26IafQK3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/why-do-i-code/vbnet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--26IafQK3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/why-do-i-code/vbnet.png" alt="A button click handler. If Label 5 is visible, then.. set Label 5's visibility to false. Set the visibility of &amp;quot;label 2&amp;quot; to true. Set the visibility of &amp;quot;label 3&amp;quot; to true. Set the visibility of &amp;quot;label 8&amp;quot; to false. Set the visibility of &amp;quot;label 9&amp;quot; to true. Set the visibility of &amp;quot;textbox 1&amp;quot; to false. Set the visibility of &amp;quot;textbox 2&amp;quot; to true. Set the visibility of &amp;quot;generate button&amp;quot; to false. Set the visibility of &amp;quot;label 10&amp;quot; to true. Enable &amp;quot;timer 1&amp;quot;. This pattern continues for an additional 35 lines of code in the image, the entire file being over 1500 lines long." width="808" height="1486"&gt;&lt;/a&gt;&lt;br&gt;
I probably don’t need to tell you that, &lt;em&gt;surely&lt;/em&gt;, there’s a &lt;em&gt;better way&lt;/em&gt;.&lt;br&gt;
For context, this is just one snippet of a ~1500 line file for a security manager application. When a certain button gets clicked in the app, it changes the visibility of over 30 different labels, buttons, and other “elements” in the app screen, since everything was in the same view.&lt;/p&gt;

&lt;p&gt;It was &lt;em&gt;a start&lt;/em&gt;. Years ago, this was revolutionary to me and though I was aware it was cumbersome, I was likely under the impression this is just “how things are” in programming.&lt;/p&gt;

&lt;p&gt;The truth is, well-designed programs can achieve the same result in less lines of code, while remaining &lt;a href="https://en.wikipedia.org/wiki/Scalability"&gt;scalable&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It’s not about necessarily getting things done in less lines of code. It’s about understanding &lt;em&gt;architecture&lt;/em&gt;; specifically &lt;em&gt;why&lt;/em&gt; the implementation above could be improved, ultimately delivering the best experience for those reading the code, and those using it.&lt;/p&gt;

&lt;p&gt;If I added a new button to the view with the implementation above, I’d have to add a new line to that method handling when “button 2” is clicked – and all the other buttons necessary. 😬&lt;/p&gt;

&lt;h2&gt;
  
  
  Why coding tickles my brain in just the right way
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The thrill of hard work paying off
&lt;/h3&gt;

&lt;p&gt;There’s no doubt about it, programming is difficult, and can be draining. At the end of the day, we’re just giving instructions to a computer through a terse syntax, most of which rarely resembles basic English. It often throws up new surprises, especially when you’re just starting out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bringing art to life
&lt;/h3&gt;

&lt;p&gt;I’m a strong believer that, like many things, programming is a form of art. You can think of a programmer like any content creator, whether it’d be a musician, painter, or a writer. Programmers start with a blank slate and bring something into the world that didn’t previously exist.&lt;/p&gt;

&lt;p&gt;I draw many parallels as a programmer to an artist. Most artists don’t just think about getting strokes on a paper or the screen. They think about the larger &lt;em&gt;composition&lt;/em&gt; of the work, generally tying all parts of an artwork together to create an enjoyable experience for a wide array of viewers.&lt;/p&gt;

&lt;p&gt;When all of these things come together and are done well…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;em&gt;developer&lt;/em&gt; experience (code design, readability, maintainability &amp;amp; testability)&lt;/li&gt;
&lt;li&gt;the &lt;em&gt;user&lt;/em&gt; experience (in terms of intuitiveness, functionality, and overall happiness)&lt;/li&gt;
&lt;li&gt;the &lt;em&gt;management&lt;/em&gt; experience (analytics, including tracking what’s working and what isn’t for continual improvement, as well as scalability for future state)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is when I get the true feeling of having created a masterpiece. Similar to an artist stepping away from their work to admire the hours of dedication and thought behind it for a moment, I feel the same way when &lt;em&gt;everybody&lt;/em&gt; has a good, consistent experience with a solution I’ve developed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Full creative freedom
&lt;/h3&gt;

&lt;p&gt;I love the fact that programming gives anybody the ability to create &lt;em&gt;whatever they desire&lt;/em&gt;. Think of it like having an infinite set of tools in your belt, giving you (and others) the opportunity to create astonishing, sometimes ridiculous things.&lt;/p&gt;

&lt;p&gt;We often spend more time than necessary trying to get existing technology to work the way we want. There are plenty of tools that already exist, but if you’re looking to supercharge your productivity and find a workflow that performs the way you expect with results tailored for your experience, it can be sometimes better to start from scratch and develop your own solution.&lt;/p&gt;

&lt;p&gt;More than anything, though, I love how creative some programmers can be. Here are some examples of just &lt;em&gt;how&lt;/em&gt; creative you can be with programming and automation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Ruby program that generates 128 different programs in various languages, circling back to the original Ruby implementation (&lt;a href="https://github.com/mame/quine-relay"&gt;quine-relay&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;You’ve heard of &lt;a href="https://en.wikipedia.org/wiki/Binary_number"&gt;base 2&lt;/a&gt;, &lt;a href="https://www.thoughtco.com/definition-of-base-10-2312365"&gt;base 10&lt;/a&gt;, base 16… but what about &lt;a href="https://github.com/qntm/base131072"&gt;base 131,072&lt;/a&gt;?&lt;/li&gt;
&lt;li&gt;A programming language where the entire syntax consists of just emoji, aptly named &lt;a href="https://github.com/emojicode/emojicode"&gt;Emojicode&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why do these projects exist?&lt;br&gt;
&lt;strong&gt;Why not?&lt;/strong&gt; 🤠&lt;/p&gt;

&lt;h3&gt;
  
  
  Making &lt;em&gt;people&lt;/em&gt; happy
&lt;/h3&gt;

&lt;p&gt;Forget users, I want to make &lt;em&gt;real people&lt;/em&gt; happy through software. With great power comes great responsibility. Your &lt;a href="https://www.youtube.com/watch?v=LZM9YdO_QKk"&gt;code has consequences in the real world&lt;/a&gt;, and that’s a privilege not to be taken lightly.&lt;/p&gt;

&lt;p&gt;At some point, somebody &lt;em&gt;besides you&lt;/em&gt; will use the programs you write.&lt;br&gt;
Real people use the programs developers make. Similar to how real people use the buildings that construction workers build up. We expect those building to stand the test of time, no matter the demand.&lt;/p&gt;

&lt;p&gt;Now more than ever, I’m inspired to create programs that &lt;em&gt;make the world a happier, better place&lt;/em&gt;. It’s a bold mission, but it starts simple: thinking broadly about how a wide audience might interact with your logic.&lt;/p&gt;

&lt;p&gt;There’s been too many times when I’ve used software, and it just hasn’t lived up to standards. You’ve likely had the same thing.&lt;/p&gt;

&lt;p&gt;Imagine a food ordering app where you can’t submit your payment, the inability to progress in a learning management system, poor user design in your banking app causing a 20-second task to take 2 minutes; the list goes on and on.&lt;/p&gt;

&lt;p&gt;These all lead to the same thing: a frustrating user experience. Beyond analytics and metrics leading to &lt;a href="https://cxl.com/blog/great-user-experience-ux-leads-to-conversions/"&gt;worse conversion rates&lt;/a&gt; for your product, put yourself in just &lt;em&gt;one&lt;/em&gt; potential user’s shoes who might experience frustration. Multiply that feeling by however many users you’re serving, and suddenly the scale of the issue magnifies.&lt;/p&gt;

&lt;p&gt;It’s not about being a good or bad developer, or implementing best practices. While these things matter, there’s fundamental design decisions you can think about; small wins you can implement and incorporate in your development workflow to increase user happiness, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;thinking about success/loading/error states for network requests&lt;/li&gt;
&lt;li&gt;adding deterministic, automated test cases – testing your logic to ensure confidence when making fixes or shipping new changes&lt;/li&gt;
&lt;li&gt;considering scale and performance when making changes, so things work &lt;em&gt;great&lt;/em&gt; now, and continue to work well into the future&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There’s no silver bullet to making users happy. However, I think putting real product users at the forefront of your mind when developing features or fixes to grasp sensibility and intuitiveness goes a long way to achieving that goal.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>inspiration</category>
      <category>discuss</category>
    </item>
    <item>
      <title>CSS layout &amp; how to position elements on your webpage</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Fri, 20 May 2022 01:54:01 +0000</pubDate>
      <link>https://dev.to/nevulo/css-layout-how-to-position-elements-on-your-webpage-paf</link>
      <guid>https://dev.to/nevulo/css-layout-how-to-position-elements-on-your-webpage-paf</guid>
      <description>&lt;p&gt;One of the most fundamental requirements to creating a great website is being able to move elements around on the page, instead of having everything appear in one big blob in a corner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout modes
&lt;/h2&gt;

&lt;p&gt;If you’ve styled elements with CSS, you know that it’s essentially putting a bunch of properties and values on a selected element in just the right way to make things look the way you want. Add some &lt;code&gt;color: red&lt;/code&gt; here, a dash of &lt;code&gt;background: black&lt;/code&gt; there.&lt;/p&gt;

&lt;p&gt;So, we know how to visually differentiate elements, including size, colour, etc., but how do we actually move an element to where we want, for the resolutions we want?&lt;/p&gt;

&lt;p&gt;CSS comes baked with a bunch of different &lt;em&gt;layout modes&lt;/em&gt; for adjusting the &lt;strong&gt;behaviour&lt;/strong&gt; of elements so you can lay out your page the way you want.&lt;/p&gt;

&lt;p&gt;Whether you need a grid pattern, a table, columns, and much more, you’ll just need to find the right layout mode for what you need.&lt;/p&gt;

&lt;p&gt;It’s important to understand that different layout modes will affect the way elements display differently, and not all CSS properties will work across all layout modes.&lt;/p&gt;

&lt;p&gt;The default layout mode is called “flow”, where elements flow down the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;display&lt;/code&gt; property
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;display&lt;/code&gt; CSS property is used to set whether or not an element uses &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flow_Layout/Block_and_Inline_Layout_in_Normal_Flow"&gt;“block” or “inline”&lt;/a&gt; layout, and controls what layout child elements use, such as flow layout, or flexbox.&lt;/p&gt;

&lt;h2&gt;
  
  
  Different types of layout modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Normal flow (default)
&lt;/h3&gt;

&lt;p&gt;Normal flow is the default way webpages lay themselves out when you haven’t applied any CSS to change how elements appear. Elements will appear at the top of the document and stack downwards, each one appearing on a new line below the last, as space is needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flexbox
&lt;/h3&gt;

&lt;p&gt;The flexible box layout model is a one-dimensional box where content can be positioned and distributed across an axis (horizontal or vertical).&lt;/p&gt;

&lt;p&gt;This is helpful if you want to display a collection of elements in one dimension, like all on the same row for a navigation bar for example, or in a list.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grid
&lt;/h3&gt;

&lt;p&gt;Whereas Flexbox works in only &lt;em&gt;one dimension&lt;/em&gt;, CSS Grid layout, which you can consider a successor to Flexbox, works with &lt;em&gt;two dimensions&lt;/em&gt;, and you can align elements into &lt;strong&gt;columns and rows&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The main advantage of Grid over Flexbox is that it’s much more suited for creating responsive, collapsible layouts that work in a more predictable way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Positioning with the &lt;code&gt;position&lt;/code&gt; property
&lt;/h3&gt;

&lt;p&gt;If we want to shift elements without affecting other elements on the page heavily, such as shifting a button a little bit to the left, positioning is perfect. Use the &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, &lt;code&gt;right&lt;/code&gt; and &lt;code&gt;bottom&lt;/code&gt; properties on an element with units as values to move the element.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relative positioning

&lt;ul&gt;
&lt;li&gt;Used for moving elements relative to themselves, where they’d normally be&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Absolute positioning

&lt;ul&gt;
&lt;li&gt;Used for displaying an element in an &lt;em&gt;exact&lt;/em&gt; location on the page, a certain distance from the edge of the page&lt;/li&gt;
&lt;li&gt;Other elements won’t be affected by absolutely positioned elements&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Fixed positioning

&lt;ul&gt;
&lt;li&gt;Similar to absolute positioning, but &lt;em&gt;anchors&lt;/em&gt; or &lt;em&gt;fixes&lt;/em&gt; an element in place relative to the closest positioned ancestor&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Sticky positioning

&lt;ul&gt;
&lt;li&gt;A hybrid between relative and fixed positioning. Element will act as if it were relatively positioned until it is scrolled to a certain threshold (e.g., &lt;code&gt;10px&lt;/code&gt; from the top of the container), after which it becomes fixed&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Floats
&lt;/h3&gt;

&lt;p&gt;The float layout will pretty much “pull” an element to either the left or right side of the screen, using &lt;code&gt;float: left&lt;/code&gt; or &lt;code&gt;float: right&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On a technical level, it’ll take the respective element out of the “normal flow” of the document, shifting it to the left, or right, until it touches the edge of its containing box, or another floated element.&lt;/p&gt;

&lt;p&gt;Elements and text can still wrap around floated elements, unlike &lt;em&gt;absolutely&lt;/em&gt; positioned elements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Table layout
&lt;/h3&gt;

&lt;p&gt;Specifically designed for creating tables with rows and columns, like what you’d find in Excel. Great for rendering table data and makes it easy to customise tables such as spacing between cells, alignment of elements in the cells, etc.&lt;/p&gt;

&lt;p&gt;Table layout is also a desirable fallback for older clients trying to replicate something like Flexbox or Grid where it’s not supported (ie. email clients… 😡).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>css</category>
    </item>
    <item>
      <title>Diving deep into CSS for beginners</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 19 May 2022 14:51:51 +0000</pubDate>
      <link>https://dev.to/nevulo/diving-deep-into-css-for-beginners-3467</link>
      <guid>https://dev.to/nevulo/diving-deep-into-css-for-beginners-3467</guid>
      <description>&lt;p&gt;When designing and &lt;a href="https://nevulo.xyz/blog/making-your-own-website"&gt;creating your own website&lt;/a&gt;, you’ll find yourself using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS"&gt;CSS&lt;/a&gt;, a language for creating &lt;em&gt;style sheets&lt;/em&gt;. Style sheets are used to describe the presentation of HTML documents and how elements get displayed.&lt;/p&gt;

&lt;p&gt;CSS and styling elements really is the backbone for a lot of user experiences visually speaking; raw HTML will only get you so far.&lt;/p&gt;

&lt;p&gt;This guide is top-to-bottom (mostly) explanation about what CSS really is, how it’s used, and common concepts and properties to understand, so you can make your own beautiful webpages.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CSS, and what is it used for?
&lt;/h2&gt;

&lt;p&gt;CSS stands for “Cascading Style Sheets”, which is a mechanism for adding style to web documents, such as adjusting fonts, colours, spacing, layout, and much more. (We’ll get back to that “cascading” part soon!)&lt;/p&gt;

&lt;p&gt;CSS is built up on “rulesets” which target elements in a HTML document through &lt;em&gt;selectors&lt;/em&gt;. Selecting an element to be styled looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This snippet would &lt;em&gt;select&lt;/em&gt; the &lt;code&gt;body&lt;/code&gt; element, and turn the background to “black”. &lt;code&gt;body&lt;/code&gt; can be replaced with any element you want to select, and then you can add &lt;em&gt;declarations&lt;/em&gt; through properties and values inside the &lt;em&gt;curly braces&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is what your average HTML element looks like under the hood:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P3XH8jcQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/what-is-css/box-model.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P3XH8jcQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/what-is-css/box-model.png" alt="The box model, featuring an element 750 x 150 in the middle, with padding on the element, 24 pixels on the sides and 12 pixels on the top and bottom. A 1 pixel border wraps around the element. A 12 pixel margin wraps around the border, adding external space around the element" width="880" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is known as the “&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model"&gt;box model&lt;/a&gt;”. Abstractly speaking, when making a website, you’re essentially structuring and styling numerous boxes.&lt;/p&gt;

&lt;p&gt;You’ve got the actual size of your element (in this case, 750 pixels wide by 150 pixels tall), then &lt;em&gt;padding&lt;/em&gt; on the outer edge of the element to increase its internal size.&lt;/p&gt;

&lt;p&gt;The border wraps around the padding (the space &lt;em&gt;inside&lt;/em&gt; the element), and on the very outside is the &lt;em&gt;margin&lt;/em&gt; (the space &lt;em&gt;outside&lt;/em&gt; the element).&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding CSS to a HTML document
&lt;/h2&gt;

&lt;p&gt;There are a few ways to include CSS styling in a HTML document, but the two most common methods are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;creating a &lt;code&gt;.css&lt;/code&gt; file with all of your rulesets, then referencing that CSS file as a stylesheet in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your document
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./style.css"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;including CSS rulesets directly in the HTML document in the &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; tag, also in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your document
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="nc"&gt;.class&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;pink&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating &amp;amp; building up rulesets
&lt;/h2&gt;

&lt;p&gt;When styling any element through CSS, the foundation is built up of “rulesets”, which include a &lt;em&gt;selector&lt;/em&gt; to access an element (or multiple that meet the requirements of the selector) to be styled.&lt;/p&gt;

&lt;p&gt;After the selector, everything between the curly braces is known as a “&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/CSS_Declaration_Block"&gt;declaration block&lt;/a&gt;”, which can contain one or more declarations. Declarations are a key/value pair, consisting of the &lt;em&gt;CSS property&lt;/em&gt; as the key, and a &lt;em&gt;value&lt;/em&gt; for the property.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0cMNOfA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/what-is-css/ruleset-breakdown.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0cMNOfA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/what-is-css/ruleset-breakdown.png" alt='A breakdown of a ruleset, featuring a class selector: "dot class". Inside of the curly braces after the selector is a declaration, consisting of a property and value pair. The property is "color" and the value is "pink"' width="880" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Selecting an element
&lt;/h3&gt;

&lt;p&gt;There are a few ways to “select” an element to be styled in CSS, depending on your requirements. You can find a full list of selectors &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Element type selector&lt;/strong&gt; (&lt;code&gt;element&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;Selects all elements that have the specified node name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;input { background: red; }&lt;/code&gt; will match any &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; elements on the page, making the background &lt;code&gt;red&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Class selector&lt;/strong&gt; (&lt;code&gt;.class&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;Selects all elements that have a class matching the selector&lt;/li&gt;
&lt;li&gt;HTML elements can have a &lt;code&gt;class&lt;/code&gt; attribute, including a list of “classes” delimited by spaces&lt;/li&gt;
&lt;li&gt;An element in the document like &lt;code&gt;&amp;lt;h1 class='bold'&amp;gt;&amp;lt;/h1&amp;gt;&lt;/code&gt; could be selected in CSS through &lt;code&gt;.bold&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ID selector&lt;/strong&gt; (&lt;code&gt;#id&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;Selects all elements that have an &lt;code&gt;id&lt;/code&gt; attribute matching the selector value&lt;/li&gt;
&lt;li&gt;HTML elements can have an &lt;code&gt;id&lt;/code&gt; attribute&lt;/li&gt;
&lt;li&gt;An element in the document like &lt;code&gt;&amp;lt;div id='article'&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt; could be selected in CSS through &lt;code&gt;#article&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you’ve selected an element, you can start adding &lt;em&gt;declarations&lt;/em&gt; to change its styling. Note that if you don’t select a valid element, there will be no effect. You can use “Inspect Element” to see what styling is applied on an element to troubleshoot these issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common properties for declarations
&lt;/h3&gt;

&lt;p&gt;Some inspiration for understanding what you can style through these “declarations”. You can see an entire list of CSS properties &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference#index"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Colours
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;color&lt;/code&gt;: adjusts the foreground colour of an element. The colour of text elements will depend on the &lt;code&gt;color&lt;/code&gt; value.&lt;br&gt;
&lt;code&gt;background&lt;/code&gt;: adjusts the background colour of an element&lt;/p&gt;

&lt;h4&gt;
  
  
  Fonts
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;font-size&lt;/code&gt;: changes the size of font for text, specified in pixels or other units&lt;br&gt;
&lt;code&gt;font-family&lt;/code&gt;: defines the type of font used for the text in the element (e.g., Arial, monospace font, etc)&lt;/p&gt;

&lt;h4&gt;
  
  
  Structure
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;display&lt;/code&gt;: used for adjusting the layout mode elements use, for positioning and structure&lt;br&gt;
&lt;code&gt;padding&lt;/code&gt;: adds internal space to an element, making it appear bigger&lt;br&gt;
&lt;code&gt;margin&lt;/code&gt;: adds external space around an element, pushing other elements away&lt;br&gt;
&lt;code&gt;border&lt;/code&gt;: applies a customisable border around an element&lt;/p&gt;

&lt;h4&gt;
  
  
  Sizing
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;height&lt;/code&gt;: adjusts the height of an element, specified in pixels or relative units&lt;br&gt;
&lt;code&gt;width&lt;/code&gt;: adjusts the width of an element, specified in pixels or relative units&lt;/p&gt;

&lt;h2&gt;
  
  
  Digging deeper in core concepts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cascading
&lt;/h3&gt;

&lt;p&gt;They don’t call it “Cascading Style Sheets” for nothin’!&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;cascade&lt;/em&gt; describes how CSS declarations and rulesets are applied to a HTML document, including how conflicts between two declarations on the same element get handled (i.e., one ruleset sets &lt;code&gt;margin-left&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt;, but another sets it to &lt;code&gt;12px&lt;/code&gt;), and which gets priority.&lt;/p&gt;

&lt;p&gt;It controls the order in which CSS declarations are applied, which is dictated by three other concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Importance&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Where is the declaration applied? Browsers have default styling which is applied by default, but has the &lt;em&gt;lowest importance&lt;/em&gt;, meaning they’ll be overridden.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specificity&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;How “detailed” is the selector that the declaration is in? Less &lt;em&gt;specific&lt;/em&gt; selectors will take lower priority in being applied.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source order&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Last resort, when two declarations affect the same element in the same way: which was declared &lt;em&gt;first&lt;/em&gt; within the file?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Inheritance
&lt;/h3&gt;

&lt;p&gt;Inheritance controls what happens if there’s no value for a specific property on an element. Essentially, if you set a CSS property like &lt;code&gt;color&lt;/code&gt; on an element, any child elements will &lt;em&gt;inherit&lt;/em&gt; the colour from the parent unless child elements have explicitly defined a colour.&lt;/p&gt;

&lt;p&gt;There’s a distinction between &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/inheritance#inherited_properties"&gt;&lt;em&gt;inherited&lt;/em&gt; and &lt;em&gt;non-inherited&lt;/em&gt;&lt;/a&gt; properties; non-inherited properties (such as &lt;code&gt;border&lt;/code&gt;) will use the &lt;em&gt;initial&lt;/em&gt; value for that property, &lt;a href="https://www.w3.org/TR/CSS22/cascade.html#specified-value"&gt;not to be confused&lt;/a&gt; with the browsers default style sheet. All properties specify an &lt;code&gt;initial&lt;/code&gt; value.&lt;/p&gt;

&lt;p&gt;If you want to explicitly define that an element should inherit a property from its parent, almost all CSS properties include an &lt;code&gt;inherit&lt;/code&gt; value (e.g., &lt;code&gt;color: inherit&lt;/code&gt;), which will set the value of the property to the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value"&gt;computed value&lt;/a&gt; of that property in the parent. This works for both inherited and non-inherited properties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specificity
&lt;/h3&gt;

&lt;p&gt;The more specific a selector is, the more precedence it has over other declarations. Specificity is a weight given to all declarations, determined by 3 factors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the number of element types in the selector&lt;/li&gt;
&lt;li&gt;the number of classes in the selector&lt;/li&gt;
&lt;li&gt;the number of IDs in the selector&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If multiple declarations have equal specificity, the last declaration found in the CSS gets applied to the element.&lt;/p&gt;

</description>
      <category>web</category>
      <category>design</category>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Improve your code through code reviews</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 05 May 2022 19:01:13 +0000</pubDate>
      <link>https://dev.to/nevulo/improve-your-code-through-code-reviews-4f5c</link>
      <guid>https://dev.to/nevulo/improve-your-code-through-code-reviews-4f5c</guid>
      <description>&lt;p&gt;Getting a second opinion matters.&lt;br&gt;
When you’re shipping new features to &lt;a href="https://www.pagerduty.com/resources/learn/what-is-production-environment/"&gt;production&lt;/a&gt;, it’s important that all the requirements get implemented and everything works properly under lots of different situations. Otherwise, users are going to have a poor experience.&lt;/p&gt;

&lt;p&gt;I can personally say it’s too easy for one person to miss simple problems that lead to bugs. It’s helpful to have more sets of eyes looking at the solution and seeing if it’s optimal and what comments/suggestions could be applied to improve it for everyone.&lt;/p&gt;

&lt;p&gt;Code reviews have helped a lot in my career to catch mistakes, typos or other major/minor bugs when writing code to be used by thousands.&lt;br&gt;
But, what is a code review, why is it helpful, and how can we incorporate code reviews in a project?&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a code review?
&lt;/h2&gt;

&lt;p&gt;A code review is where engineers in your team can inspect the code you’ve submitted to be shipped to production, and collaborate on comments and suggestions, before it goes live.&lt;/p&gt;

&lt;p&gt;When you’re making any change to a codebase, typically you’ll publish those changes remotely to a repository, like on GitHub.&lt;/p&gt;

&lt;p&gt;You can commit changes directly to the &lt;code&gt;main&lt;/code&gt; branch, which represents the most up-to-date copy of the code, and usually, whatever is on the main branch eventually gets sent to production, meaning real users see that change.&lt;/p&gt;

&lt;p&gt;Instead of committing directly to the main branch, we can create a new branch off the main branch and just push the changes relevant for one piece of work.&lt;/p&gt;

&lt;p&gt;When your changes are ready to go to production, you’ll create a “&lt;a href="https://www.pagerduty.com/resources/learn/what-is-a-pull-request/"&gt;pull request&lt;/a&gt;”, which is literally a &lt;em&gt;request&lt;/em&gt; to &lt;em&gt;pull&lt;/em&gt; your changes into the main branch.&lt;/p&gt;

&lt;p&gt;In this request to introduce changes to the repository, others in the organisation get the chance to view the changes you’ve made, write comments on the changes, or provide suggestions for alternative solutions.&lt;/p&gt;

&lt;p&gt;Reviewers can also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Approve&lt;/strong&gt; a pull request, meaning the changes to the code look good and this is ready for production!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request changes&lt;/strong&gt; on a pull request, meaning the changes to the code aren’t working as expected/correctly, and things need work&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comment without explicit approval&lt;/strong&gt;, meaning the reviewer hasn’t approved or denied the pull request but has left comments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n2sQ1PB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/code-review/github-review-changes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n2sQ1PB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/code-review/github-review-changes.png" alt="" width="723" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do code reviews?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The more eyes, the better
&lt;/h3&gt;

&lt;p&gt;Giving other engineers the ability to review your code gives them the opportunity to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;spot potential problems or bugs before they ship to users&lt;/li&gt;
&lt;li&gt;suggest improvements on performance so features scale properly&lt;/li&gt;
&lt;li&gt;maintain project quality and makes sure everybody agrees the code is readable and acceptable&lt;/li&gt;
&lt;li&gt;test changes before they go live, catching issues early&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No matter the &lt;em&gt;size&lt;/em&gt; of the change, developers in a code review should look to review the quality of the changes coming in and think about potential improvements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code reviews help you and your team grow
&lt;/h3&gt;

&lt;p&gt;Exposing yourself to code as much as possible is a surefire way to expand your vocabulary, identify anti-patterns, and ultimately help you and your team write better code.&lt;/p&gt;

&lt;p&gt;Offloading the review process to other developers, who can offer &lt;em&gt;different perspectives&lt;/em&gt;, helps teams remain agile and keep releasing new high-quality features quickly.&lt;/p&gt;

&lt;p&gt;It’s also a great opportunity for &lt;em&gt;others to learn&lt;/em&gt; new techniques or get suggestions to &lt;a href="https://nevulo.xyz/blog/code-quality"&gt;improve code quality over time&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Giving others opportunity to comment
&lt;/h3&gt;

&lt;p&gt;Other engineers can comment on readability, syntax, and other aspects of the code to improve the quality. These might be small changes like flipping an &lt;code&gt;if&lt;/code&gt; statement to improve the logic flow, or adding an early return.&lt;/p&gt;

&lt;p&gt;Beyond reviewing just &lt;em&gt;code&lt;/em&gt; and its literal syntax, code reviews also offer the opportunity for others to voice feedback on other aspects of changes like styling or functionality if something doesn’t seem right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AOL8ZE-z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/code-review/comments.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AOL8ZE-z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/code-review/comments.png" alt="" width="872" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Best practices for code reviews
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Develop guidelines and standards for reviews&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.atlassian.com/blog/add-ons/code-review-best-practices"&gt;Atlassian&lt;/a&gt; and &lt;a href="https://google.github.io/eng-practices/review/reviewer/looking-for.html"&gt;Google&lt;/a&gt; have written about what reviewers actually look for in a code review; things like architecture, functionality, readability, security, and much more.&lt;/p&gt;

&lt;p&gt;Ask questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does this pull request do what it says it does?&lt;/li&gt;
&lt;li&gt;Does it meet all the requirements laid out for this work?&lt;/li&gt;
&lt;li&gt;Given this code change, how will this affect users?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Make sure changes are adequately tested&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For particularly complex changes, automated tests help assert that all the requirements are being met under certain conditions. It will provide more confidence to teammates being able to see that all tests are passing in the CI/CD pipeline. This is known as “test coverage”.&lt;/p&gt;

&lt;p&gt;To learn more, &lt;a href="https://nevulo.xyz/blog/testing-software"&gt;read about how testing your software is just as important as writing it.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Keep changes short, simple and readable&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://static1.smartbear.co/support/media/resources/cc/book/code-review-cisco-case-study.pdf"&gt;Cisco has reported&lt;/a&gt; that performance is likely to drop in developers reviewing more than 300-400 lines of code, and it’s well documented that reviewing for long periods of time leads to worse performance.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codereview</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Testing your software is just as important as writing it</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 05 May 2022 18:52:55 +0000</pubDate>
      <link>https://dev.to/nevulo/testing-your-software-is-just-as-important-as-writing-it-2f4j</link>
      <guid>https://dev.to/nevulo/testing-your-software-is-just-as-important-as-writing-it-2f4j</guid>
      <description>&lt;h2&gt;
  
  
  What do we mean by “testing” software?
&lt;/h2&gt;

&lt;p&gt;Testing software involves &lt;strong&gt;examining the behaviour of software&lt;/strong&gt;, and ensuring that the output is what you’re &lt;strong&gt;expecting&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This can be done manually, where a real person tests specific cases searching for defects, or automatically, through the use of testing tools and writing code for test cases.&lt;/p&gt;

&lt;p&gt;Each method involves creating some expectation that is widely accepted on what &lt;em&gt;should&lt;/em&gt; happen, and then executing a series of steps to get to the desired state and ensure that the software is working correctly after the steps are complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Different types of tests
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Unit tests
&lt;/h3&gt;

&lt;p&gt;Unit tests involve assessing the behaviour and asserting the output of individual “units” or sections in source code. Units are small components, functions, or modules in the code. Importantly, they are isolated bits of code to be tested and verified to build up to testing bigger functionality.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--54VAFQlM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/unit-test.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--54VAFQlM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/unit-test.png" alt="" width="880" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As an example, you might have a relatively simple function that just adds two numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unit tests may look something like this (with the help of a testing library):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;should add two numbers&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// should pass&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we ran the test above, it would be failing at the moment. Why is that? Adding 1 + 0 should equal 1, right? Unfortunately, the code above has a bug. Have you spotted it?&lt;/p&gt;

&lt;p&gt;By checking using the logical “not” operator to check if either number is valid at the start of the function, JavaScript is checking if &lt;code&gt;a&lt;/code&gt; or &lt;code&gt;b&lt;/code&gt; are “&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Falsy"&gt;falsy&lt;/a&gt;” values, and &lt;code&gt;0&lt;/code&gt; counts as a “falsy” value, making the function throw an error.&lt;/p&gt;

&lt;p&gt;Asserting each unit is working as expected under different conditions or edge cases means we gain confidence whenever using it anywhere in our project.&lt;/p&gt;

&lt;p&gt;Over time, you’ll have hundreds of units tested in your code, building up confidence in each little part of your code, ensuring changes won’t affect functionality in any of the other units.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration tests
&lt;/h3&gt;

&lt;p&gt;Integration tests are where different units, modules, or components in software get tested together and ensuring they work as intended when connected to each other.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z1loRE0d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/integration-test.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z1loRE0d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/integration-test.png" alt="" width="880" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, a website that involves shopping will require the user to add an item to their cart and sign in. You could add an integration test to ensure that the user can both add an item to their cart and sign in, in sequence, as expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  End-to-end tests
&lt;/h3&gt;

&lt;p&gt;End-to-end tests ensure that the entire user journey; their experience from the beginning to the end in the application behaves as expected. It’s meant to simulate a real user scenario and validating the software works consistently when provided certain inputs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vtfovruj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/end-to-end-test.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vtfovruj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/end-to-end-test.png" alt="" width="880" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you had to verify the functionality of user account creation and deletion, and everything in between, you could program a test runner to run your application and perform the individual actions you’ve defined in code, asserting each step got executed correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is testing important?
&lt;/h2&gt;

&lt;p&gt;Writing code is crucial, but we also care about making sure end users get a good experience. Manual and automated testing can be very useful in catching bugs early in the development process, saving time and money for your team and making sure users have a lower chance of a poor experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confidence, now and for the future
&lt;/h3&gt;

&lt;p&gt;Through &lt;a href="https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration"&gt;continuous integration&lt;/a&gt;, you can create a pipeline that ensure builds cannot be published to production if tests are failing.&lt;/p&gt;

&lt;p&gt;One or more tests failing often indicate something is wrong with a proposed change. If all tests pass, it gives confidence to you and teammates that the changes implemented will work as expected and not break other areas of the experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get alerted before potential bugs go out to users
&lt;/h3&gt;

&lt;p&gt;Tests allow us to assert the behaviour of software and functions: we tell the tester what &lt;em&gt;should&lt;/em&gt; happen, and it compares the &lt;em&gt;expected&lt;/em&gt; and &lt;em&gt;actual&lt;/em&gt; output. If users don’t get what they’re expecting, they have a worse experience.&lt;/p&gt;

&lt;p&gt;Writing test cases allows developers to run software with mocked, fake values to test how they’ll behave under different conditions.&lt;/p&gt;

&lt;p&gt;If tests are failing or returning unexpected values, it’s a good indication that there’s a problem somewhere that could potentially affect real users, leading to a bad experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improves code quality
&lt;/h3&gt;

&lt;p&gt;Testing is important for keeping code quality and maintainability high. Having high test coverage ensures developers don’t need to spend time resolving issues with existing code, and gives confidence around the impact of changes when creating new features or fixes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not having tests is a ticking time-bomb
&lt;/h2&gt;

&lt;p&gt;I want to throw in a personal anecdote here. I can tell you personally that often, not having tests will kick you up the arse later down the road.&lt;/p&gt;

&lt;p&gt;The number of times I’ve said “I wish this had tests on it, and we would’ve caught this bug” is higher than I’d like to admit.&lt;/p&gt;

&lt;p&gt;The truth is, software is unpredictable, and even though you might have a simple operation, or you are 100% sure everything works as it should; there’s no telling how external factors might change how your software behaves. Having automated tests surfaces more information to you quicker.&lt;/p&gt;

&lt;p&gt;As an example, let’s say you’re using an external dependency for calculating time differences. The maintainers might make a breaking change, and if your project updates the dependency, your software isn’t working correctly, and you’ve got no indication of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to write optimal tests
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a strategy around testing
&lt;/h3&gt;

&lt;p&gt;Documenting a plan around what type of testing you need and what components are priority to test is helpful for you and others to get a sense on how test coverage works in your project. Some people might be aiming for 100%, but for some projects that may not be feasible.&lt;/p&gt;

&lt;p&gt;Determine which types of tests are right for your software. If you’re making an application used by many people, it might be worth adding end-to-end tests to assess the core experience automatically and pick up potential issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automating tests where possible
&lt;/h3&gt;

&lt;p&gt;Manually testing can chew into resources and time, and it’s easy to forget things or still have things go wrong. Automating tests in code and setting up tools to interact with your application programatically can save a lot of time and allows you to catch problems early without much effort.&lt;/p&gt;

&lt;p&gt;Depending on what language or framework you’re using, you might be able to use an external dependency to assist in asserting your code programatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid “flaky” tests
&lt;/h3&gt;

&lt;p&gt;A flaky test is an assertion on code that fails to produce the same result each time the test gets run. This leads to &lt;a href="https://en.wikipedia.org/wiki/False_positives_and_false_negatives"&gt;false positives (or sometimes false negatives)&lt;/a&gt; where code that is not problematic may cause a test to fail, or code that is problematic may not be caught due to a flaky test failing often.&lt;/p&gt;

&lt;p&gt;Flaky tests may take a long time to eventually surface and can block the continuous deployment, making feature delivery more complicated and slower than it needs to be and causing headaches for the development team.&lt;/p&gt;

&lt;p&gt;They’re typically caused by false assumptions in data being returned, race conditions, or insufficient mocking of calls to external systems to ensure they’re not influencing tests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ALtDpGRr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/flaky-tests.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ALtDpGRr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/flaky-tests.png" alt="" width="880" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test-driven development: red, green, refactor
&lt;/h3&gt;

&lt;p&gt;The idea behind &lt;a href="https://testdriven.io/test-driven-development/"&gt;test-driven development&lt;/a&gt; is that you actually &lt;em&gt;write the tests first&lt;/em&gt; based on requirements, making assertions in different scenarios, and then add the code to make the tests pass.&lt;/p&gt;

&lt;p&gt;The tests will fail at the start (&lt;em&gt;red&lt;/em&gt;) because there’s no logic. You begin to add the logic pertaining to the requirements until all tests are passing (&lt;em&gt;green&lt;/em&gt;). The last part involves &lt;em&gt;refactoring&lt;/em&gt; the code, so it is optimised for production and readable for others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vuCRhP4H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/red-green-refactor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vuCRhP4H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/testing-software/red-green-refactor.png" alt="" width="880" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>testing</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Different ways to copy an object in JavaScript</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 21 Apr 2022 15:28:26 +0000</pubDate>
      <link>https://dev.to/nevulo/different-ways-to-copy-an-object-in-javascript-38gb</link>
      <guid>https://dev.to/nevulo/different-ways-to-copy-an-object-in-javascript-38gb</guid>
      <description>&lt;p&gt;Copying any data, like an object, is a problem every developer encounters at one point or another.&lt;/p&gt;

&lt;p&gt;Here’s an example of the problem: you have an object stored in a variable called &lt;code&gt;user&lt;/code&gt; which contains information related to a user in your application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Blake&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s say the user wants to update their first name, but you also need to keep the data for what their previous name was, perhaps for an audit log.&lt;/p&gt;

&lt;p&gt;How can you retain the contents of the “old” user but make the changes required for the “new” user?&lt;/p&gt;

&lt;p&gt;You could store the users “old” name in a variable, but it becomes cumbersome when there are many changes you need to keep track of.&lt;/p&gt;

&lt;p&gt;This is one example where copying objects comes in handy – when copying data to a new variable, we don’t need to mutate the original value directly and potentially lose data. We can safely store a separate copy of the object contents in another place, and work on that object.&lt;/p&gt;

&lt;p&gt;There are a few ways in JavaScript to create a new object using the exact data from the original value. Keep reading to learn about any “gotchas” between these different methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using object spread syntax or &lt;code&gt;Object.assign&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;One of the simplest ways to copy an object in JavaScript is using &lt;code&gt;Object.assign&lt;/code&gt;, which copies all properties from one or more source objects to a single target object.&lt;/p&gt;

&lt;p&gt;In our case, we don’t really have a &lt;em&gt;target&lt;/em&gt; object, as we want to create a &lt;em&gt;new object&lt;/em&gt; as a clone.&lt;/p&gt;

&lt;p&gt;So, we can pass in an empty object for the first argument (the target object), and pass in the object we would like to clone in the second argument (the source object(s))&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;clonedObj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assign&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clonedObj&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { a: 1, b: "hi" }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A shorter way to do this is using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax"&gt;spread syntax&lt;/a&gt;, which allows for object expressions to be “expanded”. One implication of this is that we can &lt;em&gt;expand&lt;/em&gt; the key/value pairs from our original object into a new object, effectively making a clone.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;objClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// pass all key/value pairs from an object&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;objClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { a: 1, b: "hi" }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Essentially, the &lt;code&gt;...obj&lt;/code&gt; gets replaced with all the keys and values from &lt;code&gt;obj&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both methods are functionally identical, the only difference being that &lt;code&gt;Object.assign&lt;/code&gt; sets the properties on the target object, whereas using spread syntax creates a new object – meaning that &lt;code&gt;Object.assign&lt;/code&gt; would also trigger any setter functions on the object. This isn’t essential for many people, but an interesting thing to note.&lt;/p&gt;

&lt;p&gt;Another interesting thing to note is that both methods only perform a &lt;em&gt;shallow&lt;/em&gt; copy. What exactly does that mean?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abc123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// an object inside of an object&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;last&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;userClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;newId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Note that the original object is not mutated when modifying primitive values like a string&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { id: "newId", name: { first: "John", last: "Doe" } }&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { id: "abc123", name: { first: "John", last: "Doe" } }&lt;/span&gt;

&lt;span class="c1"&gt;// When modifying an object inside of a shallow copy...&lt;/span&gt;
&lt;span class="nx"&gt;userClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Johnny&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ...the original object will also be mutated&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { id: "abc123", name: { first: "Johnny", last: "Doe" } }&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { id: "abc123", name: { first: "Johnny", last: "Doe" } }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A shallow copy of an object means that when you mutate non-primitive values (like the &lt;code&gt;name&lt;/code&gt; object), it will mutate the clone as expected, but also the original object.&lt;/p&gt;

&lt;p&gt;This is because any values stored as an object are &lt;strong&gt;reference&lt;/strong&gt; values, meaning that there’s a reference to that object stored. So, when you copy an object with other objects inside, you’re really copying an object with &lt;strong&gt;references&lt;/strong&gt; to those other objects.&lt;/p&gt;

&lt;p&gt;This doesn’t apply with &lt;em&gt;primitive&lt;/em&gt; (simple) values like numbers and strings. When making a shallow copy of an object with other objects inside, you need to be wary of making sure you’re not mutating the original object unintentionally when mutating the clone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Converting an object to a JSON string and parsing it back
&lt;/h2&gt;

&lt;p&gt;This method leverages JSON (JavaScript Object Notation) which can hold information about key/value pairs and has support for most basic data types you’d need.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify"&gt;&lt;code&gt;JSON.stringify&lt;/code&gt;&lt;/a&gt; method allows us to pass an object in the first argument, which is the object to convert to string format. Once we have converted our object to a string, we can take that string and parse it back to an actual object using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse"&gt;&lt;code&gt;JSON.parse&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="c1"&gt;// create a JSON representation of an object in the form of a string, convert back to object&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;objClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;objClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// { a: 1, b: "hi" }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike the previous method, this method of cloning does support nested objects better, creating a “&lt;em&gt;deep copy&lt;/em&gt;”, meaning all values get dereferenced from the original object. With a deep copy, there’s no worry about mutating the original object.&lt;/p&gt;

&lt;p&gt;However, because JSON only supports a &lt;em&gt;limited subset of data types&lt;/em&gt; in JavaScript such as booleans, strings, arrays, etc. but not things like &lt;code&gt;Date&lt;/code&gt; objects or &lt;code&gt;Map&lt;/code&gt;s, these will not be converted properly when creating the clone unless you take additional steps to transform the incompatible values in the object first to something JSON can understand, and then transform them back to the desired data type you want in JavaScript.&lt;/p&gt;

&lt;p&gt;On top of this, &lt;code&gt;JSON.stringify&lt;/code&gt; won’t be able to convert a value to a string &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#issue_with_json.stringify_when_serializing_circular_references"&gt;if the value references itself&lt;/a&gt;. This is known as a &lt;a href="https://stackoverflow.com/questions/7923959/what-does-content-circular-mean-in-javascript"&gt;circular reference&lt;/a&gt;, and trying to convert an object that references itself would result in an infinite loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using &lt;code&gt;structuredClone&lt;/code&gt; global method
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;structuredClone&lt;/code&gt; is a fairly new, global method, meaning access it from anywhere in our code. The benefit of &lt;code&gt;structuredClone&lt;/code&gt; is that it was made for this purpose; “cloning” or copying an object.&lt;/p&gt;

&lt;p&gt;As of the writing of this post, the &lt;code&gt;structuredClone&lt;/code&gt; method has been &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/structuredClone#browser_compatibility"&gt;implemented by major browsers in recent versions&lt;/a&gt; (including Node 17+).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Create an object with a value and a circular reference to itself&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;original&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Clone it&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;structuredClone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// the objects are don't have the same identity&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// they do have the same values&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// and the circular reference is preserved&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike the &lt;code&gt;JSON.parse/stringify&lt;/code&gt; method, this does support circular references, and it preserves &lt;em&gt;most&lt;/em&gt; values and data types.&lt;/p&gt;

&lt;p&gt;Of note, &lt;code&gt;structuredClone&lt;/code&gt; will throw an error when cloning &lt;code&gt;Error&lt;/code&gt; types or DOM nodes. If your object contains functions, these will be quietly discarded from the result. Read more about &lt;a href="https://web.dev/structured-clone/#features-and-limitations"&gt;features and limitations of &lt;code&gt;structuredClone&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For most cases, though, this will create a deep copy of whatever objects you throw at it.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>oop</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to use the command line</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Thu, 21 Apr 2022 15:22:14 +0000</pubDate>
      <link>https://dev.to/nevulo/how-to-use-the-command-line-11de</link>
      <guid>https://dev.to/nevulo/how-to-use-the-command-line-11de</guid>
      <description>&lt;p&gt;Whether it’d be in movies or over the shoulder of your “hacker” friend, it’s likely you’ve seen the mysterious command-line interface at one point or another. A window on the computer purely used for typing commands and getting back results in text.&lt;/p&gt;

&lt;p&gt;Being able to use the command line with confidence opens some interesting doors and allows you to navigate your computer and automate tasks more effectively and efficiently.&lt;/p&gt;

&lt;p&gt;But, if you’re starting out, it can feel like a steep learning curve coming from purely graphical interfaces. After all, when opened, all you’re left with is a blank screen and a blinking cursor. What are you supposed to write? What does it help us accomplish?&lt;/p&gt;

&lt;h2&gt;
  
  
  First, what is the command line?
&lt;/h2&gt;

&lt;p&gt;The command line, also known as the command prompt or terminal, is ultimately a window that lets us enter text to input commands, and can display the output of commands back to us in the same window.&lt;/p&gt;

&lt;p&gt;It’s like having a text message conversation directly with your computer, where you can give more explicit instructions to the computer than you could through a normal graphical interface, or using a mouse. It’s essentially a different “mode” of interacting with your computer; anything you could typically do through a graphical interface, you can likely do on the command line as well.&lt;/p&gt;

&lt;p&gt;The command line is also at the heart of a lot of automation. This allows us to write programs through scripts, a set of instructions to be carried out by the computer in a logical order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use the command line?
&lt;/h2&gt;

&lt;p&gt;The main benefit from using the command line is providing a &lt;em&gt;consistent&lt;/em&gt; means of performing actions on your computer and the ability to &lt;em&gt;automate&lt;/em&gt; tasks. This is how your computer does a lot of the tasks it needs to do “in the background”.&lt;/p&gt;

&lt;p&gt;Your software may use the command line to perform certain tasks such as reading/writing files, changing system preferences, or running other programs.&lt;/p&gt;

&lt;p&gt;Imagine if we wanted to do a simple task like creating a folder, but we had to specify exactly where the mouse should be, and when to press the left or right mouse button. Considering the fact that everybody has different screen resolutions, different operating systems, and potentially different themes across systems, it’s pretty difficult to get it working for &lt;em&gt;everybody&lt;/em&gt; in a simple way.&lt;/p&gt;

&lt;p&gt;To create a folder through the command line, we can just write:&lt;br&gt;
&lt;code&gt;mkdir [folder name]&lt;/code&gt;&lt;br&gt;
(&lt;strong&gt;m&lt;/strong&gt; a &lt;strong&gt;k&lt;/strong&gt; e a &lt;strong&gt;dir&lt;/strong&gt;ectory, a folder, where the name is &lt;code&gt;[folder name]&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Simply put, utilising the command line can often provide more efficiency when performing complex tasks. Even though it can seem scary, it typically provides an easier and quicker way for us to do things like run applications that we make, test our software, and much more.&lt;/p&gt;

&lt;p&gt;Many servers run operating systems with a foundation called “Unix”. These systems are characterised around modular design (known as the &lt;a href="https://en.wikipedia.org/wiki/Unix_philosophy"&gt;Unix philosophy&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The idea is that the operating system provides a set of simple tools/programs, each with a well-defined function or purpose. You can construct a &lt;a href="https://en.wikipedia.org/wiki/Pipeline_(Unix)"&gt;pipeline&lt;/a&gt; which feeds the output from one command to another, which can be combined into &lt;em&gt;complex workflows&lt;/em&gt; using a shell like &lt;a href="https://nevulo.xyz/blog/what-is-bash"&gt;Bash&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you use the command line?
&lt;/h2&gt;

&lt;p&gt;The best way to start learning to use the command line is &lt;em&gt;just using it&lt;/em&gt;.&lt;br&gt;
To start using the command line, follow the instructions, depending on which system you’re using:&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;The “command prompt” is equivalent to the command line, and it can be launched just like any other program on your system. To start the Command Prompt:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tap on the Windows logo in the taskbar&lt;/li&gt;
&lt;li&gt;Start typing “cmd” (executable name for command prompt), click the first result.
You can also search directly for “Command Prompt”.
Optionally, right click and select “Run as administrator” to run with administrator privileges (take caution!)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  macOS
&lt;/h3&gt;

&lt;p&gt;Launch the Terminal just like any other program on your system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Spotlight search (Command + Space)&lt;/li&gt;
&lt;li&gt;Type “Terminal” and click the first result.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;p&gt;There are a few ways to open a terminal in Linux, but the quickest way is typically through a direct keyboard shortcut: &lt;code&gt;Ctrl + Alt + T&lt;/code&gt;.&lt;br&gt;
If the keyboard shortcut doesn’t work or is hard to remember, you can also launch the Terminal just like any other app on your system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Press the &lt;code&gt;Super&lt;/code&gt; key (acts as the “Windows” key on most keyboards)&lt;/li&gt;
&lt;li&gt;Start typing “Terminal” in the search box at the top.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Anatomy of the command line
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prompt &lt;code&gt;&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The very first thing you’ll see when booting up the command line/terminal is often an arrow, or some sequence of characters behind the text you’ll be entering. This is known as the “prompt”.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ybnDUjN---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/prompt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ybnDUjN---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/prompt.png" alt="" width="578" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It literally prompts the user to act and type a command. It indicates the fact the system is ready to take commands. Don’t be alarmed if yours looks different, or if you’re not sure what everything means.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executables and commands
&lt;/h3&gt;

&lt;p&gt;An executable file, command, or program is usually the first step in performing any kind of &lt;em&gt;action&lt;/em&gt; on the command line. Your system has hundreds, probably thousands of executables installed by default for performing common tasks, such as modifying files, running scripts, etc.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QohdaKxI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/command.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QohdaKxI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/command.png" alt="" width="562" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the image above, &lt;code&gt;echo&lt;/code&gt; is a command entered after the prompt. The purpose of the &lt;code&gt;echo&lt;/code&gt; command is to literally &lt;em&gt;echo&lt;/em&gt; back what you write; whatever you insert as &lt;em&gt;arguments&lt;/em&gt; after the &lt;code&gt;echo&lt;/code&gt; command will be printed back in the command line.&lt;/p&gt;

&lt;p&gt;“&lt;code&gt;echo Hello world!&lt;/code&gt;” would display “&lt;code&gt;Hello world!&lt;/code&gt;” in the command line after you press ENTER.&lt;/p&gt;

&lt;h3&gt;
  
  
  Arguments
&lt;/h3&gt;

&lt;p&gt;Executables can accept “arguments” or “parameters” – these are essentially &lt;em&gt;inputs provided by the user&lt;/em&gt;, so we can get the result we want.&lt;/p&gt;

&lt;p&gt;If we want to remove a &lt;em&gt;specific&lt;/em&gt; file on our system, we can perform the &lt;em&gt;action&lt;/em&gt; through an executable (in this case, &lt;code&gt;rm&lt;/code&gt; which removes files), and we can specify the file to be removed in the arguments:&lt;br&gt;
&lt;code&gt;rm hello.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BFqlZjxX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/arguments.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BFqlZjxX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Nevvulo/blog/main/posts/assets/command-line/arguments.png" alt="" width="604" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command above would remove a file called “hello.txt”, if it exists.&lt;/p&gt;

&lt;h4&gt;
  
  
  Options
&lt;/h4&gt;

&lt;p&gt;Commands can also take what are known as &lt;a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html"&gt;“flags” or “options”&lt;/a&gt;, which are intended to &lt;em&gt;modify the behaviour of the program&lt;/em&gt; in some way.&lt;/p&gt;

&lt;p&gt;For example, the &lt;code&gt;echo&lt;/code&gt; command mentioned earlier has one option you can choose to pass in: &lt;code&gt;-n&lt;/code&gt;. The purpose of this option is to change the behaviour of &lt;code&gt;echo&lt;/code&gt;, so it doesn’t print a new line after printing the user input to the command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting help with commands
&lt;/h2&gt;

&lt;p&gt;As you’ve probably noticed, the command line is a lot more focused on functionality over user experience, and it’s not super apparent what some executables/commands do on the surface, such as &lt;code&gt;rm&lt;/code&gt; or &lt;code&gt;mkdir&lt;/code&gt;. Thousands of commands are out there, and it’s challenging to remember what most of them do.&lt;/p&gt;

&lt;p&gt;If you need to get further details on what a certain command does, the easiest way to do this is often by typing &lt;code&gt;man [command]&lt;/code&gt; in the command line. &lt;code&gt;man&lt;/code&gt; is an executable used for displaying the online &lt;strong&gt;man&lt;/strong&gt;ual pages for system commands and other definitions.&lt;/p&gt;

&lt;p&gt;Some executables also include a &lt;code&gt;-h&lt;/code&gt; or &lt;code&gt;--help&lt;/code&gt; option to give more information about what’s available to you or what certain arguments do.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git&lt;/code&gt; is a great example of this; if you type in &lt;code&gt;git --help&lt;/code&gt;, you’ll get a list of common commands you can use within the &lt;code&gt;git&lt;/code&gt; executable. If you type &lt;code&gt;git branch --help&lt;/code&gt;, you’ll get even more detailed instructions about how to use the &lt;code&gt;git branch&lt;/code&gt; command specifically, and what arguments/options are available.&lt;/p&gt;

&lt;p&gt;The methods listed above may be a bit verbose in some cases, and might not help you if you want a certain command explained in a simple way. You can often use search engines to help find better definitions for commands, or if you’re trying to find out what command you need to use for a certain operation.&lt;/p&gt;

&lt;p&gt;As a rule of thumb (won’t apply to everything), the names of commands are typically just shortened versions or acronyms of the function they perform. If you want to &lt;strong&gt;m&lt;/strong&gt; o &lt;strong&gt;v&lt;/strong&gt;e a file, the command is &lt;code&gt;mv&lt;/code&gt;, &lt;strong&gt;c&lt;/strong&gt; o &lt;strong&gt;p&lt;/strong&gt;ying a file can be achieved through &lt;code&gt;cp&lt;/code&gt;, etc.&lt;/p&gt;

&lt;p&gt;A tool I’ve used lately is &lt;a href="https://www.shell.how/"&gt;shell.how&lt;/a&gt;, where you type in a command, and it’ll try to break down what each “part” of the command means.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚠️ A word of warning
&lt;/h2&gt;

&lt;p&gt;As I’ve talked about before, &lt;a href="https://nevulo.xyz/blog/what-is-xss"&gt;computers are very literal-minded&lt;/a&gt;. They really have no distinction between “good” or “malicious” instructions – they just do what we tell them to do.&lt;/p&gt;

&lt;p&gt;Thus, it’s important to be cautious when entering commands directly in the command line. Unlike graphical interfaces, executing commands often comes with no warning or ability to undo, so you should avoid executing commands if you’re unsure of what they do.&lt;/p&gt;

&lt;p&gt;The command line comes with a lot of power. It exposes low-level access to different parts of the system, so even innocuous, short commands can completely break your system or cause data loss if not used carefully.&lt;/p&gt;

&lt;p&gt;I encourage you to do research if you’re unsure about what a command is supposed to do or why you’d need to run it. Stay safe!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>cli</category>
      <category>shell</category>
    </item>
    <item>
      <title>What’s so great about performance?</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Fri, 08 Apr 2022 01:07:51 +0000</pubDate>
      <link>https://dev.to/nevulo/whats-so-great-about-performance-52b4</link>
      <guid>https://dev.to/nevulo/whats-so-great-about-performance-52b4</guid>
      <description>&lt;p&gt;Performance can make or break great software. If you’ve got a great app, but it runs at snail’s pace on my device, rendering it unusable, I may as well not even have it installed.&lt;/p&gt;

&lt;p&gt;I don’t like to wait around for no reason.&lt;a href="https://web.dev/why-speed-matters/"&gt; Most users don’t like to wait&lt;/a&gt;. It’s well documented that users will drop off quickly if your site or application loads slowly because “users” are actually real people with real lives, wanting to get stuff done.&lt;/p&gt;

&lt;p&gt;As a developer, performance can be difficult to maintain, especially when there are other priorities. The &lt;em&gt;speed&lt;/em&gt; of your application probably doesn’t rank as one of your highest priorities.&lt;/p&gt;

&lt;p&gt;Usually, I’ve found it’s beneficial to prototype a solution in code, even if it’s “sloppy” or not as performant as it could be. It’s hard for us to get the grasp of exactly what the “cost” of running all of these instructions for the computer is.&lt;/p&gt;

&lt;p&gt;So, why does it matter that we optimise for performance?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does performance matter?
&lt;/h2&gt;

&lt;p&gt;Having a speedy app or website isn’t just a fancy badge to show off. Better performance leads to happier results for everybody involved, whether you’re making open-source software, working in a business aimed at helping people, or working on personal projects!&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance for success
&lt;/h3&gt;

&lt;p&gt;One of the funny things about performance is the fact that we take it for granted. We don’t &lt;em&gt;want&lt;/em&gt; fast apps, we &lt;em&gt;expect&lt;/em&gt; fast apps, and when we don’t get what we expect, the user experience degrades.&lt;/p&gt;

&lt;p&gt;HubSpot has written about &lt;a href="https://blog.hubspot.com/marketing/page-load-time-conversion-rates"&gt;how page load times impact conversion rates for businesses&lt;/a&gt;, and it makes sense, as there’s a lot to fight for. Users are more than happy to go elsewhere if their experience is not satisfied, and &lt;a href="https://uxdesign.cc/performance-design-designing-for-the-illusion-of-speed-576110e9e558"&gt;speed matters a lot in user retention and user engagement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Performance matters at scale. Imagine you’ve got 50 thousand users who have your app installed, relying on it to work properly, every time, and importantly, &lt;em&gt;fast&lt;/em&gt;. If you’ve got an algorithm which takes 1 second to process something, and it has to run multiple times every second, you’ll quickly drain your resources, and upwards of 50 thousand real people will be having a bad time.&lt;/p&gt;

&lt;p&gt;In a business environment, better performance can translate to higher profits and conversions, and ultimately benefit employees and users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance for the users
&lt;/h3&gt;

&lt;p&gt;It all comes back to the main people running the show; the users. Everything crumbles down if your core user experience is limited by performance issues, especially when things take a substantially long time. You’ll be lucky to have a user on board longer than a few seconds if you leave them waiting.&lt;/p&gt;

&lt;p&gt;When your software is fast, you’re helping users get through their tasks and their day faster. It gives users incentive to come back as well. If they know your software is reliable and highly available, there’s no need to actively search for alternatives.&lt;/p&gt;

&lt;p&gt;Improved performance means increased retention and engagement. But users are not statistics – at the end of the day, these are real people wanting to use your software for whatever they need.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance for the developers
&lt;/h3&gt;

&lt;p&gt;As developers, we make code to offload work, not create more of it. So, by teaching yourself to create elegant, performant software through planning and testing, it ensures you won’t have to go back and fix it later if something goes wrong.&lt;/p&gt;

&lt;p&gt;Sometimes, improved performance comes at the cost of readability. There are things you can do to ensure you &lt;a href="https://nevulo.xyz/blog/code-quality"&gt;keep your code quality high&lt;/a&gt;, like abstracting code or comparing and contrasting multiple alternatives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving your performance
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Find out if you’ve got a performance problem
&lt;/h3&gt;

&lt;p&gt;Technically, every app &lt;em&gt;could&lt;/em&gt; be faster, but you need to identify whether it &lt;em&gt;should&lt;/em&gt; be faster. There’s only so much benefit in squeezing as much performance as possible out of a system, and there’s no point resolving a problem if you’re not sure whether you have it.&lt;/p&gt;

&lt;p&gt;Identify whether performance is a pain point for users or yourself through testing and feedback. If you’re aware it is time for change in the speed department, make a plan of attack for places of priority for where you want to improve performance in your software, usually based on areas of high or crucial usage.&lt;/p&gt;

&lt;p&gt;Common testing techniques for identifying slow points in your software include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High load/stress tests&lt;/li&gt;
&lt;li&gt;Testing on different devices and workflows&lt;/li&gt;
&lt;li&gt;Getting user feedback if possible&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Document/record areas of “slowness”
&lt;/h3&gt;

&lt;p&gt;Documenting and recording areas of perceived slowness or dropped performance is an important step in knowing what you need to fix, and allows you to map out different areas or features in your software that are slow so you can identify common patterns or correlations. This will help guide you to fix the problem faster.&lt;/p&gt;

&lt;p&gt;Let’s say currently in your app, when you tap on the “sign in” button, it takes 1.5 seconds to register that press. That’s pretty slow for a lot of users.&lt;/p&gt;

&lt;p&gt;Document the amount of time it takes now (problem state), as well as goals and requirements to getting to the solution (final state). Find out what is acceptable. Is 0.5 seconds good enough for you or your users? If not, keep iterating through until you think of an end state that meets your requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reproduce the problem &amp;amp; implement a fix
&lt;/h3&gt;

&lt;p&gt;Once you’ve identified and documented the performance issue, at some point you can try and reproduce the problem, to help you fix it and give your users the best experience possible.&lt;/p&gt;

&lt;p&gt;If you can reproduce the issue in a consistent series of steps, you can almost walk through your code base as the user progresses through your software. If there’s a bug that always only happens after pressing a button, it’s worth looking into the logic for that touchpoint as an example.&lt;/p&gt;

&lt;p&gt;Fixing the issue can either be the easiest part of the process, or take you the rest of your days. Regardless of what solution you use to fix the problem, it must meet the requirements you set out when documenting the issue, otherwise, just focus on providing a smooth experience for the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To answer the question; what is so great about performance?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Users feel performance.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Your users are the foundation to success and keeping them happy will keep you happy. If your software works fast, users work fast. Moving business objectives aside, helping users is what we care about.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance helps businesses be more successful.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
It’s not just a headline, more performant applications (user-facing or internal) &lt;a href="https://www.appneta.com/blog/slow-business-apps-whats-the-worst-that-can-happen/"&gt;lead to better performance in metrics like conversion rates&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Helping developers for now and later&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Not only do developers get the benefit of feeling reassured that things won’t break &lt;em&gt;now&lt;/em&gt;, they’ll be able to rely on the scalability of their algorithms for the &lt;em&gt;future&lt;/em&gt;. Less time is spent maintaining existing systems and more time is spent being productive.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>performance</category>
      <category>ux</category>
    </item>
    <item>
      <title>Analyse the cost of your algorithms</title>
      <dc:creator>Nevulo</dc:creator>
      <pubDate>Fri, 08 Apr 2022 01:06:06 +0000</pubDate>
      <link>https://dev.to/nevulo/analyse-the-cost-of-your-algorithms-1de4</link>
      <guid>https://dev.to/nevulo/analyse-the-cost-of-your-algorithms-1de4</guid>
      <description>&lt;p&gt;When developing software, you get to know that some things take longer than other things. Like, reading a file taking longer than adding a few numbers. Or, getting 10 thousand users in a database over reading from memory.&lt;/p&gt;

&lt;p&gt;These are helpful things to know, but we’re also aware that most of the time, it doesn’t matter. Read a file here or there, get those users from the database, it’ll take under a few seconds usually and that’s all we care about.&lt;/p&gt;

&lt;p&gt;When developing software for a &lt;a href="https://codebots.com/app-development/what-are-environments-in-software-development-a-guide-to-the-development-beta-and-production-environments#what-is-a-production-environment"&gt;production environment&lt;/a&gt;, we need to think about &lt;em&gt;scale&lt;/em&gt; and &lt;em&gt;future state&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you have 10 thousand users now, what if you have 1 million users in 2 years? An operation with 10 thousand users might take 2 minutes, but with a million, it’d take a couple of hours. What are the implications of this?&lt;/p&gt;

&lt;h2&gt;
  
  
  Time and space complexity
&lt;/h2&gt;

&lt;p&gt;In computer science, “&lt;em&gt;complexity&lt;/em&gt;” is defined as the number of resources the computer needs to run an algorithm. It’s difficult to get an exact estimate on how long an algorithm will take, or how much space it’ll use, typically we’re just interested in how the function grows over time as the input grows.&lt;/p&gt;

&lt;p&gt;As a reminder, an algorithm is a set of instructions for the computer that you write in code, used to solve a problem or perform a computation.&lt;/p&gt;

&lt;p&gt;“Time” complexity relates to the amount of &lt;em&gt;time&lt;/em&gt; it takes to run an algorithm to completion. “Space” complexity relates to the amount of &lt;em&gt;memory&lt;/em&gt; an algorithm uses to complete its tasks.&lt;/p&gt;

&lt;p&gt;As always with any inputs, it’s important to consider how different values could affect your algorithm. There are three different types of notation for describing the limiting behaviour of a function as the input grows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;𝑂-notation (pronounced “big oh”): describes the asymptotic upper bound of execution time, the &lt;em&gt;most&lt;/em&gt; amount of time required for the function to run (a worse case scenario)&lt;/li&gt;
&lt;li&gt;Ω-notation (pronounced “big omega”): describes the asymptotic lower bound of execution time, the &lt;em&gt;least&lt;/em&gt; amount of time required for the function to run&lt;/li&gt;
&lt;li&gt;Θ-notation (pronounced “big theta”): describes the asymptotic tight bound for execution time, essentially, the &lt;a href="https://en.wikipedia.org/wiki/Set_%28mathematics%29#Intersections"&gt;intersection&lt;/a&gt; of &lt;code&gt;O(f(n))&lt;/code&gt; and &lt;code&gt;Omega(f(n))&lt;/code&gt; (datapoint is in both 𝑂 set and Ω set)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most significant notation we’re here for is &lt;strong&gt;big-O notation – good&lt;/strong&gt; for measuring the &lt;em&gt;worst-case&lt;/em&gt; execution time as input grows for a function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Big-O notation
&lt;/h2&gt;

&lt;p&gt;Big O notation is a mathematical notation used in computer science for &lt;strong&gt;analysing algorithms for efficiency&lt;/strong&gt; and describes the &lt;em&gt;complexity&lt;/em&gt; of an algorithm/function.&lt;/p&gt;

&lt;p&gt;Big O notation looks like this: &lt;code&gt;O(n)&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;O&lt;/code&gt; represents Big-O notation, and the &lt;code&gt;n&lt;/code&gt; inside the brackets is a variable that represents the size of the input given to the function.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y-9VdJ9T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/1_FkQzWqqIMlAHZ_xNrEPKeA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y-9VdJ9T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/1_FkQzWqqIMlAHZ_xNrEPKeA.png" alt="" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An algorithm with a Big-O of &lt;code&gt;O(1)&lt;/code&gt; means the function will take the same amount of time to complete, no matter the size of the input. One element, 1 billion elements; the time is constant.&lt;/p&gt;

&lt;p&gt;An algorithm with a Big-O of &lt;code&gt;O(n)&lt;/code&gt; means the time it takes the function to complete grows linearly with the size of the input. Typically, this is an operation like iterating through a list; if you have 1 item in the list, it’ll take less time than 1 billion items and the time taken grows as the items in the list grows.&lt;/p&gt;

&lt;p&gt;A worst-case scenario Big-O is &lt;code&gt;O(n²)&lt;/code&gt; (Big-O of &lt;code&gt;n&lt;/code&gt; to the power of 2). These are the worst performing algorithms and typically involve repetition, such as looping through 100 users, and for each user, doing 100 more operations. &lt;code&gt;100 users * 100 operations&lt;/code&gt; equals &lt;strong&gt;10,000&lt;/strong&gt; total operations.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is Big-O notation used for?
&lt;/h3&gt;

&lt;p&gt;Some functions are more complex regarding time or space than others, and we can use Big-O notation to represent how the resources an algorithm use change as the input changes.&lt;/p&gt;

&lt;p&gt;Imagine you have a function which goes through all users, and sends a notification every week.&lt;/p&gt;

&lt;p&gt;In your function to solve for requirements, you need to read each user’s document in the database.&lt;/p&gt;

&lt;p&gt;Each user’s document takes a fraction of a second to read.&lt;br&gt;
But, if you’ve got 50,000 users, &lt;code&gt;0.1 seconds * 50,000 users&lt;/code&gt; equals &lt;strong&gt;8 minutes&lt;/strong&gt; in total just to read each users document!&lt;/p&gt;

&lt;p&gt;If you are running on infrastructure that has runtime limits, or simply don’t have enough resources, your function will stop.&lt;/p&gt;

&lt;p&gt;To prevent problems like these from happening early, you can use Big-O notation to get information about how the resources your algorithm uses grows, as the size of the input given to the algorithm grows.&lt;/p&gt;
&lt;h2&gt;
  
  
  When to aim for lower execution time
&lt;/h2&gt;

&lt;p&gt;If you have an algorithm or process that you run manually, or only runs once every so often (say, once every few days) and doesn’t involve many operations – worrying about execution time is probably not a top priority.&lt;/p&gt;

&lt;p&gt;Typically, unless you’re having issues, or you want to future-proof your algorithms to work as input expands (users, documents in a database, etc), optimising for execution time in cases where the algorithm runs infrequently can be considered a bit of a waste.&lt;/p&gt;

&lt;p&gt;If your algorithm needs to run multiple times per second, or even more frequently, it must run efficiently or things might get blocked, leading to a bad experience for users. If your algorithm involves a large number of operations, this means it might take longer to complete.&lt;/p&gt;

&lt;p&gt;Where possible and sensible, anywhere you have a user interface, even internally for employees, after getting things functional, it’s wise to prioritise performance and maintainability.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to design algorithms with lower execution time
&lt;/h2&gt;

&lt;p&gt;I don’t personally design functions or algorithms with time/space complexity in mind (although it’s not a bad idea).&lt;/p&gt;

&lt;p&gt;Instead, there are some common practices you can implement while planning in your head and writing code to prevent things from scaling up too fast.&lt;/p&gt;
&lt;h3&gt;
  
  
  Think about how you’re going to solve the problem
&lt;/h3&gt;

&lt;p&gt;Before starting to implement a solution, try to build a mental model of the steps the computer would need to take to achieve the result you want. There are plenty of ways to solve a problem, usually, and it’s helpful to think through multiple ideas and compare complexity between how you implement an algorithm.&lt;/p&gt;

&lt;p&gt;Typically, nested loops or repetition will add complexity to an algorithm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, we first define an array with 10 elements, all as the number &lt;code&gt;1&lt;/code&gt;. There’s a &lt;code&gt;for&lt;/code&gt; loop that runs the code inside 10 times.&lt;/p&gt;

&lt;p&gt;The code in the &lt;code&gt;for&lt;/code&gt; loop says, for each element in &lt;code&gt;test&lt;/code&gt;, replace it with whatever is returned in the anonymous function. The return value is &lt;em&gt;another&lt;/em&gt; &lt;code&gt;map&lt;/code&gt; to go through each element in &lt;code&gt;test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the end, in one iteration of the &lt;code&gt;for&lt;/code&gt; loop out of 10, we did 20 operations. In 10 iterations, that’s 200 operations.&lt;/p&gt;

&lt;p&gt;Try to think through each individual step the computer takes, even through internal methods like &lt;code&gt;map&lt;/code&gt; as it will branch off more operations to run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optimisations
&lt;/h3&gt;

&lt;p&gt;Usually, you don’t need to worry about making serious low-down optimisations, like picking between &lt;code&gt;forEach&lt;/code&gt; or a &lt;code&gt;for&lt;/code&gt; loop, or stressing over down-to-the-millisecond differences in speed. If you’re not sure if you need to optimise, think about maintainability first.&lt;/p&gt;

&lt;p&gt;If you’re working in a critical environment where every fraction of a second matters, you’ll likely look towards squeezing every last bit of juice you can out of the language you’re using.&lt;/p&gt;

&lt;p&gt;For example, in JavaScript, with the case of &lt;code&gt;forEach&lt;/code&gt; vs &lt;code&gt;for&lt;/code&gt; loops, for loops win out by a little making them preferable to use in cases of high performance. Usually, though, differences are negligible.&lt;/p&gt;

&lt;p&gt;You’ll want to look towards third-party libraries and your solution in a bigger picture, and if there are small optimisations to be made to reduce computation time.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>performance</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
