<?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: Tamerlan</title>
    <description>The latest articles on DEV Community by Tamerlan (@tamerlan).</description>
    <link>https://dev.to/tamerlan</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%2F536054%2F15c47568-77d6-4d9c-bd48-5b1699f6d7ff.jpg</url>
      <title>DEV Community: Tamerlan</title>
      <link>https://dev.to/tamerlan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tamerlan"/>
    <language>en</language>
    <item>
      <title>Grunt Work in Software Engineering: The Silent Productivity Killer</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Fri, 21 Feb 2025 15:35:50 +0000</pubDate>
      <link>https://dev.to/tamerlan/grunt-work-in-software-engineering-the-silent-productivity-killer-1f42</link>
      <guid>https://dev.to/tamerlan/grunt-work-in-software-engineering-the-silent-productivity-killer-1f42</guid>
      <description>&lt;p&gt;In 2022, I joined a &lt;strong&gt;Developer Experience (DX) team&lt;/strong&gt; focused on building internal tools to improve developer productivity.&lt;/p&gt;

&lt;p&gt;We had a well-funded team with big ambitions, and at first, things went smoothly. Our process was simple: listen to developers' pain points and solve them.&lt;/p&gt;

&lt;p&gt;However, after about six months, we noticed a sharp decline in our internal productivity. I started investigating why—and the answer surprised me.&lt;/p&gt;

&lt;p&gt;We were avoiding grunt work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Grunt Work?
&lt;/h2&gt;

&lt;p&gt;Grunt work in software engineering refers to &lt;strong&gt;necessary but tedious tasks that no one wants to do.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These tasks may seem small at first but can snowball into major obstacles. Here are &lt;strong&gt;six of the most commonly ignored types of grunt work in software engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Grunt 1: Pull Request Reviews
&lt;/h3&gt;

&lt;p&gt;The first and most obvious type of grunt work is &lt;strong&gt;pull request (PR) reviews&lt;/strong&gt;, something I personally struggled with the most.&lt;/p&gt;

&lt;p&gt;If your team values software quality, &lt;strong&gt;PR reviews are essential&lt;/strong&gt; to the development cycle. They help maintain high standards and improve the overall product.&lt;/p&gt;

&lt;p&gt;The problem? &lt;strong&gt;Delays.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When reviews take too long, they block progress. This often happens because developers prioritize their own tasks over the team's efficiency.&lt;/p&gt;

&lt;p&gt;Shifting the mindset from &lt;strong&gt;"my productivity first"&lt;/strong&gt; to &lt;strong&gt;"team productivity first"&lt;/strong&gt; makes a huge difference. When engineers recognize that unreviewed PRs are blockers, they’ll take them more seriously.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grunt 2: Dependency Management
&lt;/h3&gt;

&lt;p&gt;PR reviews may be a major bottleneck, but another commonly neglected task is &lt;strong&gt;keeping dependencies up to date.&lt;/strong&gt; I understand—it’s tedious and often deprioritized. But ignoring it comes with hidden costs.&lt;/p&gt;

&lt;p&gt;Let's take either Dependabot or Renovate as an example. They automatically open PRs every week, but they often seem like minor changes—easy to postpone.&lt;/p&gt;

&lt;p&gt;Before you know it, &lt;strong&gt;you’re stuck with 5+ open dependency update PRs, adding unnecessary clutter&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;My problem with this isn't about the dependencies themselves. It's more about the unnecessary cognitive load. If you're working across multiple repositories and see 10 open PRs—8 of them for dependencies—it creates unnecessary cognitive load.&lt;/p&gt;

&lt;p&gt;To fix this, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prioritizing dependency updates&lt;/strong&gt; instead of postponing them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automating the update process&lt;/strong&gt; to reduce manual effort.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grouping multiple PRs into one&lt;/strong&gt; , using custom configurations to streamline updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Grunt 3: Cognitive Load
&lt;/h3&gt;

&lt;p&gt;As software evolves, so does its complexity. Over time, this complexity leads to increased &lt;strong&gt;cognitive load&lt;/strong&gt; —the mental effort required to understand and work with the codebase.&lt;/p&gt;

&lt;p&gt;This is often referred to as 'tech erosion' or 'code rot.&lt;/p&gt;

&lt;p&gt;We need a better approach. Treating refactoring as a separate task—like “Refactor X or Y”—is counterproductive. Instead, &lt;strong&gt;make code improvement a habit&lt;/strong&gt; within the development lifecycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aim to leave the codebase better than you found it&lt;/strong&gt; —a simple yet powerful principle.&lt;/p&gt;

&lt;p&gt;I understand that large-scale refactoring is sometimes necessary, and in those cases, it deserves a dedicated task.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grunt 4: Testing
&lt;/h3&gt;

&lt;p&gt;Good tests make development safer and more efficient, yet writing them often feels like a chore. Many developers acknowledge the importance of testing but still put it off.&lt;/p&gt;

&lt;p&gt;I'm not here to convince you why you should write tests. If you're a seasoned software developer then you know that any serious project would require tests.&lt;/p&gt;

&lt;p&gt;Many developers find writing tests tedious and often skip them entirely. So, how do we fix this?&lt;/p&gt;

&lt;p&gt;One approach is to enforce testing with automated code coverage tools, but that often leads to gaming the system rather than real quality improvements.&lt;/p&gt;

&lt;p&gt;Instead, &lt;strong&gt;lead by example and make writing tests effortless.&lt;/strong&gt; Integrate testing into the development lifecycle and make it a &lt;strong&gt;CI pipeline requirement.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Encourage developers to test major features, and when refactoring time comes, they’ll see firsthand how much safer and easier it is to work with well-tested code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grunt 5: Marketing
&lt;/h3&gt;

&lt;p&gt;When developing internal tools in a large company, you likely won’t have a dedicated marketing team. But without visibility, even the best tools go unused.&lt;/p&gt;

&lt;p&gt;An internal tool is useless if no one knows about it. In a collaborative environment, &lt;strong&gt;treat fellow engineers as customers—your tool needs visibility to gain adoption.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If people don’t know it exists, they won’t even give it a chance.&lt;/p&gt;

&lt;p&gt;That’s why it’s worth investing some time in showcasing your work. One simple approach I use is a &lt;strong&gt;“Friday Showcase”&lt;/strong&gt; on Slack, where I post a brief update in a channel our users follow. It highlights what we’ve built, what’s improved, and what’s coming next—helping drive engagement and adoption.&lt;/p&gt;

&lt;p&gt;An added benefit of this approach is increased visibility for your work. When performance reviews come around, your contributions will be well-documented and easy to showcase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grunt 6: Documenting and Showcasing
&lt;/h3&gt;

&lt;p&gt;The last, but arguably one of the most valuable, types of grunt work is &lt;strong&gt;documentation and visibility.&lt;/strong&gt; Developers often dislike these tasks, yet they provide some of the highest career returns.&lt;/p&gt;

&lt;p&gt;The average software engineer tends to be introverted, so I understand the reluctance to focus on documentation. However, it's essential. Imagine onboarding to a new project with no documentation—it’s frustrating and time-consuming.&lt;/p&gt;

&lt;p&gt;If you've ever benefited from well-written docs, you know how valuable they are. Writing documentation is not just about helping others; it's also a way to make impactful, visible contributions that you can highlight to your manager.&lt;/p&gt;

&lt;p&gt;Showcasing your work is crucial, especially in large organizations where it's easy to go unnoticed. If you want to advance in your career, consistently highlighting your impact is one of the best ways to stand out.&lt;/p&gt;

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

&lt;p&gt;Ignoring grunt work doesn’t just slow you down—it affects the entire team. By actively addressing these small but crucial tasks, you’ll not only improve developer productivity but also set yourself up for long-term success.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Setting Up a Testing Environment in Neovim</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Wed, 19 Feb 2025 09:53:11 +0000</pubDate>
      <link>https://dev.to/tamerlan/setting-up-a-testing-environment-in-neovim-25oh</link>
      <guid>https://dev.to/tamerlan/setting-up-a-testing-environment-in-neovim-25oh</guid>
      <description>&lt;p&gt;One of my favourite features of VSCode is the ability to view and run my tests directly from the UI.&lt;/p&gt;

&lt;p&gt;It's not just about the UI; it's about having the flexibility to choose and run specific tests using shortcuts—without relying on the terminal.&lt;/p&gt;

&lt;p&gt;I liked that flow and wanted something similar in Neovim.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hail the Community 🚀
&lt;/h2&gt;

&lt;p&gt;After some heavy research—just kidding! If you Google 'Neovim testing,' the first link will take you to a plugin called &lt;a href="https://github.com/nvim-neotest/neotest?ref=tamerlan.dev" rel="noopener noreferrer"&gt;Neotest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Neotest is a plugin that helps you interact with your tests. It follows an adapter architecture, meaning you install the core plugin (&lt;code&gt;neotest&lt;/code&gt;), and then add an adapter for your specific test framework.&lt;/p&gt;

&lt;p&gt;For example, if you're in the JavaScript ecosystem and use Jest as your test framework, you would install &lt;code&gt;neotest&lt;/code&gt; and &lt;code&gt;neotest-jest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To check if your test framework is supported, refer to the official Neotest documentation here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and Configuring Neotest
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we'll use &lt;a href="https://github.com/folke/lazy.nvim?ref=tamerlan.dev" rel="noopener noreferrer"&gt;lazy.nvim&lt;/a&gt; as our package manager. Here's how to install Neotest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "nvim-neotest/neotest",
  event = { "BufReadPost", "BufNewFile" },
  dependencies = {
      "nvim-neotest/nvim-nio",
      "nvim-lua/plenary.nvim",
      "antoinemadec/FixCursorHold.nvim",
      "nvim-treesitter/nvim-treesitter",
      "nvim-neotest/neotest-jest",
  },
},

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, we have some dependencies. The only required ones are &lt;code&gt;nvim-nio&lt;/code&gt; and &lt;code&gt;plenary.nvim&lt;/code&gt;. Most adapters will also require &lt;code&gt;treesitter&lt;/code&gt;, so we include that as well.&lt;/p&gt;

&lt;p&gt;Neotest relies on the &lt;code&gt;CursorHold&lt;/code&gt; event, which uses the &lt;code&gt;updatetime&lt;/code&gt; setting. By default, this setting is quite high, and lowering it may lead to excessive writes to disk.&lt;/p&gt;

&lt;p&gt;It's recommended to use the plugin &lt;code&gt;FixCursorHold&lt;/code&gt; which allows detaching &lt;code&gt;updatetime&lt;/code&gt; from the frequency of the &lt;code&gt;CursorHold&lt;/code&gt; event.&lt;/p&gt;

&lt;p&gt;Regarding &lt;code&gt;FixCursorHold&lt;/code&gt;, the repo claims it is no longer needed but it is still recommended to use (See &lt;a href="https://github.com/antoinemadec/FixCursorHold.nvim/issues/13?ref=tamerlan.dev" rel="noopener noreferrer"&gt;this issue&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;Finally, we have our first adapter installed for the JavaScript testing framework Jest called &lt;code&gt;neotest-jest&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Quit and reopen Neovim to install your new plugins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Neotest and Neotest-Jest
&lt;/h3&gt;

&lt;p&gt;The next step is to configure Neotest. The default configurations work well, but you must do some extra work to set up your adapters. Here's my current setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;local status_ok, neotest = pcall(require, "neotest")
if not status_ok then
  return
end

local jest = require("neotest-jest")

neotest.setup({
  summary = {
      open = "botright vsplit | vertical resize 80",
  },
  adapters = {
      jest({
          jestCommand = "npm test --",
          cwd = function(path)
              return vim.fn.getcwd()
          end,
      }),
  },
})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There isn't anything special here. I configured the test summary page to be a bit bigger and added some basic configuration for &lt;code&gt;neotest-jest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To learn more about the different configurations available for &lt;code&gt;neotest-jest&lt;/code&gt;, check it out &lt;a href="https://github.com/nvim-neotest/neotest-jest?ref=tamerlan.dev" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Keymaps
&lt;/h2&gt;

&lt;p&gt;The final step is setting up keymaps. I'm on the Folke hype train, so I'm using &lt;code&gt;which-key.nvim&lt;/code&gt; to create my keybindings.&lt;br&gt;&lt;br&gt;
You don't have to follow my exact setup, but I hope it inspires you to create your own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  -- Neotest related mappings
  {
      "&amp;lt;leader&amp;gt;n",
      group = "🧪 Test",
      nowait = true,
      remap = false,
  },
  {
      "&amp;lt;leader&amp;gt;nr",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.run()&amp;lt;cr&amp;gt;",
      desc = "Run nearest test",
  },
  {
      "&amp;lt;leader&amp;gt;nf",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.run(vim.fn.expand('%'))&amp;lt;cr&amp;gt;",
      desc = "Run current file",
  },
  {
      "&amp;lt;leader&amp;gt;na",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.run({ suite = true })&amp;lt;cr&amp;gt;",
      desc = "Run all tests",
  },
  {
      "&amp;lt;leader&amp;gt;nd",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.run({strategy = 'dap'})&amp;lt;cr&amp;gt;",
      desc = "Debug nearest test",
  },
  {
      "&amp;lt;leader&amp;gt;ns",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.stop()&amp;lt;cr&amp;gt;",
      desc = "Stop test",
  },
  {
      "&amp;lt;leader&amp;gt;nn",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.attach()&amp;lt;cr&amp;gt;",
      desc = "Attach to nearest test",
  },
  {
      "&amp;lt;leader&amp;gt;no",
      "&amp;lt;cmd&amp;gt;lua require('neotest').output.open()&amp;lt;cr&amp;gt;",
      desc = "Show test output",
  },
  {
      "&amp;lt;leader&amp;gt;np",
      "&amp;lt;cmd&amp;gt;lua require('neotest').output_panel.toggle()&amp;lt;cr&amp;gt;",
      desc = "Toggle output panel",
  },
  {
      "&amp;lt;leader&amp;gt;nv",
      "&amp;lt;cmd&amp;gt;lua require('neotest').summary.toggle()&amp;lt;cr&amp;gt;",
      desc = "Toggle summary",
  },
  {
      "&amp;lt;leader&amp;gt;nc",
      "&amp;lt;cmd&amp;gt;lua require('neotest').run.run({ suite = true, env = { CI = true } })&amp;lt;cr&amp;gt;",
      desc = "Run all tests with CI",
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running Tests in Neovim
&lt;/h2&gt;

&lt;p&gt;Now that we have everything installed and configured, let's see it in action. The test I will use for this tutorial comes from the official Jest repo. Here's my current test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Copyright (c) Meta Platforms, Inc. and affiliates.

import {expect, it} from '@jest/globals';
import sub from '../sub';

it('subtracts 5 - 1 to equal 4 in TypeScript', () =&amp;gt; {
  expect(sub(5, 1)).toBe(4);
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we want to run this test, we can use the keymap &lt;code&gt;&amp;lt;leader&amp;gt;nr&lt;/code&gt;, which finds and runs the nearest test.&lt;/p&gt;

&lt;p&gt;Seems like our test has failed and showed us something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8a7tssmapaapdqbux2v8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8a7tssmapaapdqbux2v8.png" width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I want to see what's wrong, I can check the output by using the command &lt;code&gt;&amp;lt;leader&amp;gt;no&lt;/code&gt;. This is how it looks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkuxfwsw3gdg83rsyst20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkuxfwsw3gdg83rsyst20.png" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, next I want to see the test summary page and see all my tests at once. We can do that with the keymap &lt;code&gt;&amp;lt;leader&amp;gt;nv&lt;/code&gt;. Here's how it looks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foujizea0qg0325ed0fvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foujizea0qg0325ed0fvf.png" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I press &lt;code&gt;?&lt;/code&gt; it will show me all the available keymaps I have.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5f4ajzqyavc4gz5z0bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5f4ajzqyavc4gz5z0bv.png" width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want to run all my tests now, we can run them all using the keymap &lt;code&gt;&amp;lt;leader&amp;gt;na&lt;/code&gt;. Let's run all the tests and see what happens to the summary page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin97vmtvlety3ko4l8cx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin97vmtvlety3ko4l8cx.png" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Seems like all my tests are failing and I have to go and fix some stuff. But that's not the point of the article.&lt;/p&gt;

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

&lt;p&gt;I hope you have a working test set up within Neovim by now. Always remember to check out the docs for both Neotest and any adapters you have.&lt;/p&gt;

&lt;p&gt;If you have any questions or concerns, leave them in the comments and I'll try my best to help you.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>neovim</category>
    </item>
    <item>
      <title>How to overcome writer's block as a developer blogger?</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 04 Mar 2024 10:29:58 +0000</pubDate>
      <link>https://dev.to/tamerlan/how-to-overcome-writers-block-as-a-developer-blogger-5eco</link>
      <guid>https://dev.to/tamerlan/how-to-overcome-writers-block-as-a-developer-blogger-5eco</guid>
      <description>&lt;p&gt;This year, I decided to solidify my writing habit by publishing an article every week.&lt;/p&gt;

&lt;p&gt;It went well for the first couple of weeks, but as time went on, it began to feel like a drag. Ideas kept slipping away, and words seemed to escape me. &lt;/p&gt;

&lt;p&gt;Writing became a chore.&lt;/p&gt;

&lt;p&gt;I found myself scrambling every weekend, writing something every two hours so I could publish on Monday. This cycle repeated week after week. Despite my efforts, I couldn’t bring myself to write in advance.&lt;/p&gt;

&lt;p&gt;However, last night, I took a step back to thoroughly consider and research why I was struggling with writing.&lt;/p&gt;

&lt;p&gt;Initially, I attributed my difficulties to the so-called 'writer's block,' but I soon realized that wasn’t the actual issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  I had a research block, not a writing block.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwy2gv86r4xz39326eio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmwy2gv86r4xz39326eio.png" alt=" " width="650" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, you read that correctly. As a non-fiction writer focused on technical articles, my process hinges significantly on research. &lt;/p&gt;

&lt;p&gt;Without it, I'm essentially left without content. &lt;/p&gt;

&lt;p&gt;Reflecting on my early blogging days, I recall writing about everything I learned, which was feasible because everything was new to me.&lt;/p&gt;

&lt;p&gt;Fast forward four years, my learning curve has plateaued somewhat. While I still learn, my focus has shifted towards broader topics in DevOps, Release Engineering, and specific tools like Crossplane, Terraform, etc... &lt;/p&gt;

&lt;p&gt;This shift has inadvertently led to a decrease in my research depth, directly impacting my ability to produce content. &lt;/p&gt;

&lt;p&gt;It's a simple truth: &lt;strong&gt;I cannot write about what I do not know deeply.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, for anyone finding themselves in a similar predicament, the solution is to amplify your research efforts. Once you have a solid foundation of knowledge, writing becomes the easier part of the equation.&lt;/p&gt;

&lt;h2&gt;
  
  
  How much should you research?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7a3l3kzww0ufcxsweyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7a3l3kzww0ufcxsweyf.png" alt=" " width="800" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's easy to fall into the endless loop of research, constantly seeking more information. However, knowing when to stop is key.&lt;/p&gt;

&lt;p&gt;While it’s crucial to avoid getting bogged down, erring on the side of thoroughness is generally wise. I advocate for researching until you're able to explain the subject in terms so simple that even a 5-year-old could grasp it. &lt;/p&gt;

&lt;p&gt;PS. I believe I got this method from renowned physicist Richard Feynman. If you're interested, here's a video explaining his studying technique. &lt;/p&gt;

&lt;h2&gt;
  
  
  Tips on how to research better
&lt;/h2&gt;

&lt;p&gt;Now that we got to the root of the problem, my next objective was to enhance my research skills significantly.&lt;/p&gt;

&lt;p&gt;Through meticulous investigation and self-reflection, I've discovered several strategies that have dramatically improved my research process. &lt;/p&gt;

&lt;p&gt;Below, I share the key changes and techniques that have made the most difference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Have a better note-taking system
&lt;/h3&gt;

&lt;p&gt;Initially, my approach to note-taking was somewhat haphazard. I experimented with a basic setup in Notion and even dabbled with Obsidian, but none of these methods truly resonated with me at first. &lt;/p&gt;

&lt;p&gt;I returned to Obsidian because I knew I liked the connections system it had. So as a restart, I use a single vault for everything and try to capture as many notes as possible. &lt;/p&gt;

&lt;p&gt;This raw collection of thoughts and information serves as a fertile ground from which I can later distil more structured insights. &lt;/p&gt;

&lt;p&gt;I later then review and organize these notes into their respective folders. While doing that, I sometimes pick up on connections among them. &lt;/p&gt;

&lt;p&gt;This refined approach not only aids in retaining information but also in synthesizing new ideas from seemingly distinct pieces of information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use different search engines
&lt;/h3&gt;

&lt;p&gt;This was something I read on Reddit. Google has its algorithms on page ranking and I always thought that other search engines would be quite similar.&lt;/p&gt;

&lt;p&gt;But that's not what I discovered. &lt;/p&gt;

&lt;p&gt;While researching "Release Engineering," DuckDuckGo revealed several invaluable articles and papers—resources I would have missed had I relied solely on Google. &lt;/p&gt;

&lt;p&gt;This experience underscored the importance of diversifying search tools to uncover hidden gems.&lt;/p&gt;

&lt;p&gt;PS. They might've been the second or third pages of Google but I usually never go that far, but probably should. Who knows?&lt;/p&gt;

&lt;h3&gt;
  
  
  Read academic papers
&lt;/h3&gt;

&lt;p&gt;This is another tip I got from Reddit, where you can use Google Scholar to search for terms in academic papers.&lt;/p&gt;

&lt;p&gt;This approach has been transformative because I get access to direct sources rather than relying on secondary interpretations found in YouTube videos or blog articles.&lt;/p&gt;

&lt;p&gt;Reading material straight from the experts offers a deeper, undiluted understanding of topics. &lt;/p&gt;

&lt;h3&gt;
  
  
  Follow the Sources
&lt;/h3&gt;

&lt;p&gt;Try to find the sources of the stuff you're reading.&lt;/p&gt;

&lt;p&gt;If you're on Wikipedia, you can find it at the end of the page. It will sometimes lead you into rewarding research rabbit holes.&lt;/p&gt;

&lt;p&gt;I also like to do this with books so I make sure to check out the references section for any useful recommendations. Finally, if there's any author I like, I try to find what they read and read that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn About Different Topics
&lt;/h3&gt;

&lt;p&gt;It's really helpful to know about things that aren't directly related to what you're focusing on. Sometimes, you can link ideas from completely different areas, and that's what I think true wisdom is all about.&lt;/p&gt;

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

&lt;p&gt;This was such a joy to write because I'd already done all the research beforehand and wrote this in one sitting.&lt;/p&gt;

&lt;p&gt;I know this isn't a technical article but the same could be said about that. Now that you've learned why you aren't writing as much, I would like to end it with the following quote:&lt;/p&gt;

&lt;p&gt;While this isn't a technical article, the insights apply universally. &lt;/p&gt;

&lt;p&gt;To end our discussion, I leave you with a guiding principle:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"It's always better to over-research than to under-research."&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>writing</category>
    </item>
    <item>
      <title>What are threads?</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:00:00 +0000</pubDate>
      <link>https://dev.to/tamerlan/what-are-threads-312a</link>
      <guid>https://dev.to/tamerlan/what-are-threads-312a</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojl1wmu4j8965tf6xyb0.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fojl1wmu4j8965tf6xyb0.jpeg" alt="What are threads?" width="800" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most, if not all modern operating systems support multiprocessing and at the same time processes can be run in multiple threads hence the word multithreading.&lt;/p&gt;

&lt;p&gt;This will give you a significant increase in performance and scalability but it comes with a price. The overall complexity of the code increases and it becomes difficult to debug.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfh3gkr4f38ee4qkhrzh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqfh3gkr4f38ee4qkhrzh.png" alt="What are threads?" width="499" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, we will take a look at POSIX Threads and learn how they work under the hood on Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are threads?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4eoz0i7ttmy2jqh8gi4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4eoz0i7ttmy2jqh8gi4c.png" alt="What are threads?" width="604" height="348"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Difference between single-threaded process and multithreaded process.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When you open up a program on your computer, a process (instance) of the program gets created.&lt;/p&gt;

&lt;p&gt;A thread is simply a unit of execution within a process.&lt;/p&gt;

&lt;p&gt;So if your program is single-threaded that means that the process has one thread (this is usually called the main thread).&lt;/p&gt;

&lt;p&gt;On the other hand, if your program utilizes multiple threads this means that your program is multitasking, meaning that it's running computations concurrently hence speeding up the program.  &lt;/p&gt;

&lt;p&gt;This is the high-level definition of threads, let's take a slightly deeper look into how threads are stored in memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thread Control Block
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30nuw5v79b9u9zzmabud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30nuw5v79b9u9zzmabud.png" alt="What are threads?" width="466" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Information about threads must be saved in memory, but how would it be represented?&lt;/p&gt;

&lt;p&gt;Good question.&lt;/p&gt;

&lt;p&gt;Threads are represented by Thread Control Block (TCBs).&lt;/p&gt;

&lt;p&gt;It contains information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thread ID –  A unique identifier that gets generated by the operating system when a thread gets created. &lt;/li&gt;
&lt;li&gt;Thread States –  State of the thread that changes as the thread progresses throughout the system. &lt;/li&gt;
&lt;li&gt;CPU information – This includes everything that the OS needs to know about the thread such as Program Count and Register Contents.
&lt;/li&gt;
&lt;li&gt;Thread Priority –  It indicates the weight (or priority) of the thread over other threads which helps the thread scheduler to determine which thread should be selected next from the READY queue.&lt;/li&gt;
&lt;li&gt;Process Pointer –   A pointer to the process that started this thread.
&lt;/li&gt;
&lt;li&gt;Thread Pointer(s) – A pointer or list of pointers to other threads that were created by the current thread. Now that we know &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we know how threads are stored, let's look at how do they increase performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do multiple threads speed up my code?
&lt;/h3&gt;

&lt;p&gt;Let's take a web server as an example.&lt;/p&gt;

&lt;p&gt;If the server created a separate process for every HTTP request, we would wait forever for our page to load. The reason is that creating a new process is an expensive procedure for the operating system.&lt;/p&gt;

&lt;p&gt;Instead of creating a new process, it would be more efficient to create a new thread.&lt;/p&gt;

&lt;p&gt;But sometimes this wouldn't speed up your application.&lt;/p&gt;

&lt;p&gt;If your lacking program uses a lot of computing power, then utilizing multiple processes would be more beneficial.&lt;/p&gt;

&lt;p&gt;On the other hand, if your facing an Input-Ouput (IO) problem, then multithreading will help you.&lt;/p&gt;

&lt;p&gt;Next, let's look at different types of threads and their relationships to each other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thread Types
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaxqkiw5gpuux6s36xzw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaxqkiw5gpuux6s36xzw.png" alt="What are threads?" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two types of threads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User Threads&lt;/li&gt;
&lt;li&gt;Kernel Threads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Supporting threads at the user level means that there is a user-level library that is linked with the process and this library provides all the management and runtime support for the thread.&lt;/p&gt;

&lt;p&gt;Kernel threads are managed by the operating system (OS), meaning that the OS kernel itself is multithreaded.&lt;/p&gt;

&lt;p&gt;The OS kernel maintains things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thread Abstraction – It abstracts the use of threads by having a thread data structure such as Thread Control Block.
&lt;/li&gt;
&lt;li&gt;Scheduling and Synchronization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, let's discuss several mechanisms how user-level threads can be mapped to the underlying kernel-level threads.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thread Mapping
&lt;/h3&gt;

&lt;h4&gt;
  
  
  One to Many Model
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkab6fgouunshx4pgxn54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkab6fgouunshx4pgxn54.png" alt="What are threads?" width="403" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this model, several user threads are mapped to one OS kernel thread. All thread management is handled by a custom user library, and this is the advantage of this approach. The disadvantage is that if one single thread makes a blocking call, then the entire process is slowed down.&lt;/p&gt;

&lt;h4&gt;
  
  
  One to One Model
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07igctv7b90dugk2z8mt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07igctv7b90dugk2z8mt.png" alt="What are threads?" width="494" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the simplest model, in which each thread created in some process is directly controlled by the OS kernel scheduler and mapped to a single thread in kernel mode. To prevent the application from creating threads uncontrollably hence overloading the OS, they introduce a limit on the maximum number of threads supported in the OS.&lt;/p&gt;

&lt;h4&gt;
  
  
  Many to Many Model
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7i1r0idsmknlaef5rwuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7i1r0idsmknlaef5rwuq.png" alt="What are threads?" width="469" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this approach, many user threads are multiplexed into the same or fewer than N (number) of kernel threads. The negative effects of the other two models are overcome: the threads are truly executed in parallel and there is no need for the OS to impose restrictions on their total number. However, this model is quite difficult to implement from a programming point of view.&lt;/p&gt;

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

&lt;p&gt;Multithreading can significantly speed up your code if used right.&lt;/p&gt;

&lt;p&gt;But it's not all sunshine and rainbows, so it's up to you as the developer to figure out whether its worth implementing or not.&lt;/p&gt;

&lt;p&gt;I hope you learned something today and in our next article, we will cover how to implement multithreading in C/C++.  &lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Best Resources to Teach Yourself Computer Science</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 14 Feb 2022 16:00:00 +0000</pubDate>
      <link>https://dev.to/tamerlan/best-resources-to-teach-yourself-computer-science-4lg8</link>
      <guid>https://dev.to/tamerlan/best-resources-to-teach-yourself-computer-science-4lg8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfs4o162hwpbp4xnxdrv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfs4o162hwpbp4xnxdrv.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been programming professionally for almost 3 years.&lt;/p&gt;

&lt;p&gt;But I'm gonna be honest with you.&lt;/p&gt;

&lt;p&gt;My computer science (CS) skills are pretty lacking. That's why I've dedicated 2022 to finally learn some core computer science concepts.&lt;/p&gt;

&lt;p&gt;But where do I start?&lt;/p&gt;

&lt;p&gt;That's what I thought a couple of days ago.&lt;/p&gt;

&lt;p&gt;Fortunately, I got S tier research skills and found the best resources on the internet for computer science and figured out why not share them with my dear readers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS. This is my initial list if you got any suggestions, feel free to message me on Twitter about them.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick disclaimer
&lt;/h2&gt;

&lt;p&gt;I just want to say that all of these resources provide you with a comprehensive list of different courses to take to master different computer science subjects.&lt;/p&gt;

&lt;p&gt;None of these resources create their own content, they simply pick the best ones found over the internet. This is why you might see some overlap with the courses chosen.&lt;/p&gt;

&lt;p&gt;For example, a popular introduction to computer science course would be &lt;a href="https://pll.harvard.edu/course/cs50-introduction-computer-science?delta=0" rel="noopener noreferrer"&gt;Harvard's CS50&lt;/a&gt;. You would find this course recommended in almost all the resources below.  &lt;/p&gt;

&lt;p&gt;Another disclaimer is that all of these resources are free. So please don't get scammed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/ossu/computer-science" rel="noopener noreferrer"&gt;Open Source Society University (OSSU)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv0zdx5se83h2kvwjhin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffv0zdx5se83h2kvwjhin.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OSSU which stands for Open Source Society University is an organization that:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Empowers learners to master college curricula through free resources  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github Page&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;OSSU essentially provides you with all the courses required to get a bachelors degree in Computer Science.&lt;/p&gt;

&lt;p&gt;So you would expect courses such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Structures and Algorithms &lt;/li&gt;
&lt;li&gt;Math for Computer Scientists&lt;/li&gt;
&lt;li&gt;Systems Programming &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their computer science path is by far the most popular one on the whole internet, with a whopping 106k stars on GitHub.  &lt;/p&gt;

&lt;p&gt;But that's not it.&lt;/p&gt;

&lt;p&gt;They also provide other paths such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mathematics&lt;/li&gt;
&lt;li&gt;Data Science&lt;/li&gt;
&lt;li&gt;Bioinformatics&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://teachyourselfcs.com/" rel="noopener noreferrer"&gt;Teach Yourself Computer Science&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9k98o5f8tqncppwro9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9k98o5f8tqncppwro9e.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="567"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are more of a minimalistic person. You simply want a minimal list of recommended resources.&lt;/p&gt;

&lt;p&gt;Then Teach Your Self CS is the path for you.&lt;/p&gt;

&lt;p&gt;It gives you nine core computer science subjects with their recommended resources.&lt;/p&gt;

&lt;p&gt;The resources are given based on the difficulty level.  &lt;/p&gt;

&lt;p&gt;For example for the programming section, they recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard Recommendation: &lt;a href="https://web.mit.edu/6.001/6.037/sicp.pdf" rel="noopener noreferrer"&gt;Structure and Interpretation of Computer Programs (SICP)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If SICP is too hard, then you can pick up &lt;a href="https://composingprograms.com/" rel="noopener noreferrer"&gt;Composing Programs&lt;/a&gt; or &lt;a href="https://htdp.org/" rel="noopener noreferrer"&gt;How to Design Programs&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I personally follow this path for my 2022 computer science plan and I've thoroughly enjoyed it even though I'm not following the recommended order of subjects.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://functionalcs.github.io/curriculum/" rel="noopener noreferrer"&gt;Functional Computer Science&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famsp8gejf288d0xh9m6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Famsp8gejf288d0xh9m6b.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is also another popular but more "underground" set of resources. I've seen it linked a bunch in Reddit posts and Discord servers.&lt;/p&gt;

&lt;p&gt;Nevertheless, it's still a solid list of resources with a focus on &lt;strong&gt;functional programming&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So you would expect courses such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Principles of Functional Programming&lt;/li&gt;
&lt;li&gt;CS 3110 Data Structures and Functional Programming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They not only do that but cover most core computer science subjects and a lot of "niche" subjects which you might find interesting.&lt;/p&gt;

&lt;p&gt;Niche subjects include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web Programming&lt;/li&gt;
&lt;li&gt;Data Science&lt;/li&gt;
&lt;li&gt;Quantum Computing &lt;/li&gt;
&lt;li&gt;Machine Learning &lt;/li&gt;
&lt;li&gt;Mathematics for Finance&lt;/li&gt;
&lt;li&gt;Finding Jobs&lt;/li&gt;
&lt;li&gt;Software Testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/P1xt/p1xt-guides" rel="noopener noreferrer"&gt;P1XT Guide&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwvrjbwlrlxcv6erzfqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwvrjbwlrlxcv6erzfqr.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want a good balance of theoretical computer science and practical programming then P1XT might be for you.&lt;/p&gt;

&lt;p&gt;The nice thing about P1XT is that it's separated into your typical software engineering levels such as Junior, Middle, Senior Engineers.&lt;/p&gt;

&lt;p&gt;They have a nice balance of theory and real-world. So you can expect lots of practical projects such as clones of popular web apps.&lt;/p&gt;

&lt;p&gt;To be fair, once you get to the intermediate-advanced stage, the content starts to focus a lot more on web development so lots of Javascript and HTML/CSS courses. But nonetheless, they also cover all the core CS subjects.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/ForrestKnight/open-source-cs" rel="noopener noreferrer"&gt;The Open Source Computer Science Degree&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyjdwu4sxojl8775dr72.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyjdwu4sxojl8775dr72.png" alt="Best Resources to Teach Yourself Computer Science" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was pretty sceptical about this one at first because it was made by a "YouTuber", but it's not a bad list whatsoever.&lt;/p&gt;

&lt;p&gt;It's made by a popular programming YouTuber called ForrestKnight. He made a video explaining why he chose the specific course and subjects in his list.&lt;/p&gt;

&lt;p&gt;You can check it out here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=NyOvFSP_IpQ" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=NyOvFSP_IpQ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I understood this was inspired by the OSSU computer science resource but is more minimal. There aren't many courses but it still covers a good amount.&lt;/p&gt;

&lt;p&gt;The list also contains a lot of Java, so if you ever plan to be a Java developer then this list might be for you.&lt;/p&gt;

&lt;p&gt;You can check out the list on GitHub.&lt;/p&gt;

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

&lt;p&gt;Now, you might be feeling a bit overwhelmed by the number of choices you have. But don't worry, just pick one and stick to it.&lt;/p&gt;

&lt;p&gt;Most of these lists are pretty similar, they get different once you get to the advanced courses. At that point, it all depends on your interests.&lt;/p&gt;

&lt;p&gt;I might have missed some other cool resources, so if you got any and want me to add them to the list, feel free to message me on Twitter and I will get back to you.&lt;/p&gt;

&lt;p&gt;Thanks for reading&lt;/p&gt;

</description>
      <category>resources</category>
      <category>computerscience</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>UDP in Depth</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 13 Sep 2021 16:32:48 +0000</pubDate>
      <link>https://dev.to/tamerlan/udp-in-depth-15e5</link>
      <guid>https://dev.to/tamerlan/udp-in-depth-15e5</guid>
      <description>&lt;p&gt;Two weeks ago I published an article about TCP.&lt;/p&gt;

&lt;p&gt;Having a single article, about TCP isn't nice. &lt;/p&gt;

&lt;p&gt;So here's another one this time about UDP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today you will learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How does the UDP protocol work&lt;/li&gt;
&lt;li&gt;The packet format that UDP protocol uses&lt;/li&gt;
&lt;li&gt;Applications behind the UDP protocol&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is the UDP Protocol?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fib51wl4hi40spyc89bq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fib51wl4hi40spyc89bq8.png" alt="Alt Text" width="609" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UDP which stands for User Datagram Protocol is one of the main protocols of the internet protocol suites. &lt;/p&gt;

&lt;p&gt;But some of you may ask? &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"What is a protocol?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A protocol is essentially a set of rules that allows two computers to talk to each other. &lt;/p&gt;

&lt;p&gt;There can be many different sets of rules, hence we have many different protocols. &lt;/p&gt;

&lt;p&gt;UDP is one of them.&lt;/p&gt;

&lt;p&gt;But what makes UDP different?&lt;/p&gt;

&lt;p&gt;Short Answer: &lt;strong&gt;UDP is stateless, meaning it doesn't save any state between the client and server, it also is very light making it fast, but the downside is that it's not reliable, packets can go missing, corrupted, etc...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Long Answer: Read on...&lt;/p&gt;

&lt;h2&gt;
  
  
  UDP Packet Format
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6at4yxhotha474uzw38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6at4yxhotha474uzw38.png" alt="Alt Text" width="800" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our last article about TCP, we found out that TCP has a ton of headers. &lt;/p&gt;

&lt;p&gt;Unlike TCP, UDP is light, hence having the minimal amount of headers. &lt;/p&gt;

&lt;p&gt;Let's quickly go over each field:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source Port&lt;/strong&gt; — The sending device port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Port&lt;/strong&gt; — The receiving device port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Length&lt;/strong&gt; — This field specifies the length in bytes of the UDP header and UDP data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checksum&lt;/strong&gt; — Indicates whether the header was damaged in transit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data&lt;/strong&gt; — The actual info that your sending&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  UDP Features
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjynwdz5rwwnrp3668qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjynwdz5rwwnrp3668qy.png" alt="Alt Text" width="559" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To be honest, there isn't much to say so let's condense the features of UDP in a list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UDP does not acknowledge packets, so if data goes missing, it won't be retransmissioned.&lt;/li&gt;
&lt;li&gt;UDP is a good protocol for data flowing in one direction&lt;/li&gt;
&lt;li&gt;UDP is simple and suitable for query-based communications.&lt;/li&gt;
&lt;li&gt;UDP is stateless, so it basically doesn't save any state between the client and server.&lt;/li&gt;
&lt;li&gt;UDP does not provide congestion control, meaning that it doesn't regulate the amount of data is being sent over.&lt;/li&gt;
&lt;li&gt;UDP does not guarantee the orderliness of data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds like I'm talking about the cons of UDP, but there are in fact many use cases for it. For one it's simple and two it's fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  UDP Applications
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtig8yd1yalh3acanhkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtig8yd1yalh3acanhkm.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Streaming Media&lt;/strong&gt; — Streaming sites are fine with loss packets, if one frame is lost in a video it won't affect the quality much, but what's important is speed. This is why UDP is a good protocol for streaming media.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Name Servers&lt;/strong&gt; — This is used to get the IP address from domains for example &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt; leads to 142.251.1.102. This works well using UDP because queries must be fast and only consist of a single request followed by a single reply packet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPN&lt;/strong&gt; - Some VPN systems such as OpenVPN may use UDP and perform error checking at the application level while implementing reliable connections.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Congratulations, you are one step closer in being a better developer!&lt;/p&gt;

&lt;p&gt;This was a pretty short post, there isn't much to say (surface-level) about UDP, but either way I hope you enjoyed today's article.&lt;/p&gt;

&lt;p&gt;If you enjoy my content, I have more in my personal blog, you can check it out here. &lt;/p&gt;

&lt;p&gt;Also, I tweet snippets of useful stuff over twitter &lt;a href="https://twitter.com/tamerlan_dev" rel="noopener noreferrer"&gt;@tamerlan_dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks For Reading!!&lt;/p&gt;

</description>
      <category>networking</category>
      <category>backend</category>
      <category>beginners</category>
      <category>protocols</category>
    </item>
    <item>
      <title>Design Patterns: Composite</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 06 Sep 2021 02:06:33 +0000</pubDate>
      <link>https://dev.to/tamerlan/design-patterns-composite-39g7</link>
      <guid>https://dev.to/tamerlan/design-patterns-composite-39g7</guid>
      <description>&lt;p&gt;Composite is one of the easier patterns in this series, but this does not mean it's not popular. &lt;/p&gt;

&lt;p&gt;In fact, it's one of the most useful patterns because it can be expressed in many different business domains. &lt;/p&gt;

&lt;p&gt;So without further ado, let's begin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today you will learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structure and theory of the composite pattern&lt;/li&gt;
&lt;li&gt;Problems that the composite pattern solves&lt;/li&gt;
&lt;li&gt;Solution it provides&lt;/li&gt;
&lt;li&gt;Implementation of the solution&lt;/li&gt;
&lt;li&gt;Recognize opportunities to use the composite pattern&lt;/li&gt;
&lt;li&gt;Benefits and downsides of the composite pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Definition
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0xjx4frqpfcymhnbyuj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0xjx4frqpfcymhnbyuj.png" alt="Alt Text" width="480" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Formally speaking the composite pattern allows us to treat composites and individual objects equally. &lt;/p&gt;

&lt;p&gt;But what does that mean?&lt;/p&gt;

&lt;p&gt;Let's say you work for an e-commerce site, there are two kinds of products:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Product&lt;/strong&gt; — Typical individual object (toothpaste, apple, etc...)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Box&lt;/strong&gt; — Group of products or even other boxes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Visually speaking it would look more like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsd5kjm7popbmign95c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsd5kjm7popbmign95c2.png" alt="Alt Text" width="370" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in a nutshell, the composite pattern &lt;strong&gt;allows us to compose objects into hierarchical structures, and then work with these structures like individual objects.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's take a look at another example. &lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Let's imagine you are building the next Spotify.&lt;/p&gt;

&lt;p&gt;What do you offer the user?&lt;/p&gt;

&lt;p&gt;You would most obviously say music.&lt;/p&gt;

&lt;p&gt;But the catch is that your app allows you to have playlists of songs or even other playlists.&lt;/p&gt;

&lt;p&gt;The question is now how do we represent this in code?&lt;/p&gt;

&lt;p&gt;One way would be to simply loop and check if the object is a song or a playlist.&lt;/p&gt;

&lt;p&gt;It would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&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="nx"&gt;object&lt;/span&gt; &lt;span class="nx"&gt;instanceOf&lt;/span&gt; &lt;span class="nx"&gt;Song&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;song&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;song&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;playlist&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;

    &lt;span class="c1"&gt;// else it is a playlist&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stuff&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stuff&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This seems weird to write, why does my client have to know whether this is a song or a playlist?&lt;/p&gt;

&lt;p&gt;Your client should not know, and this is the problem that the composite pattern solves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Before we transform our code above, let us quickly go over the components of the composite pattern.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhskg4dr7e16u86t5wsnx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhskg4dr7e16u86t5wsnx.png" alt="Alt Text" width="600" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Component&lt;/strong&gt; — The uniform interface that both the composite and the leaf will abide by.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composite&lt;/strong&gt; — Our "group" object that implements the component interface, and has a list of leaf objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leaf&lt;/strong&gt; — Our individual object, that directly implements the component interface.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that we know the core components of the composite pattern, let us transform our previous code into something abiding by the composite pattern:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Define our component interface:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;SongComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// other uniform functions&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Define our leaf class:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Song&lt;/span&gt; &lt;span class="kr"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;SongComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
        &lt;span class="c1"&gt;// play the damn song!!&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;&lt;strong&gt;Step 3: Define our composite class:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Playlist&lt;/span&gt; &lt;span class="kr"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;SongComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;songs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;songs&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;songs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;songs&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;play&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="nx"&gt;song&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="nx"&gt;song&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stuff&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;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;songs&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;songs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Test the code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
  &lt;span class="nx"&gt;song_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Song&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;song_two&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Song&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="nx"&gt;playlist_one&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Playlist&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;song_one&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;song_two&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="nx"&gt;playlist_two&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Playlist&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;song_one&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;song_two&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;playlist_one&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;


    &lt;span class="c1"&gt;// we treat of all these equally&lt;/span&gt;
    &lt;span class="nx"&gt;song_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;song_two&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;playlist_one&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;playlist_two&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&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;Congratulations, you have just implemented the composite pattern. &lt;/p&gt;

&lt;p&gt;Rewards: Respect + 10&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS. You might be asking why didn't we add functions like add() or pop() to our component interface? This is a very popular debate, both are right. It's a question if you want your code to be uniform or type-safe. I chose type-safe for this example.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use this pattern?
&lt;/h2&gt;

&lt;p&gt;This pattern is pretty simple, you would only use it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want to express your data hierarchically.&lt;/li&gt;
&lt;li&gt;You want to treat individual objects and composites equally.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits and Downsides
&lt;/h2&gt;

&lt;p&gt;It's not all sunshine and rainbows, but let's go over the &lt;strong&gt;rainbows&lt;/strong&gt; first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You work with tree-like structures more conveniently.&lt;/li&gt;
&lt;li&gt;You can introduce new element types without breaking existing code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now comes the &lt;strong&gt;downside&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's difficult to create a uniform interface to classes whose functionality differs greatly, this sometimes forces to over-generalize classes.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I'm glad you reached this far. &lt;/p&gt;

&lt;p&gt;Now you can leverage the composite pattern in your next or existing projects.&lt;/p&gt;

&lt;p&gt;If you did, leave a comment down below if you like the pattern or not. &lt;/p&gt;

&lt;p&gt;Also, I also publish small snippets of these articles and other good stuff on Twitter &lt;a href="https://twitter.com/tamerlan_dev" rel="noopener noreferrer"&gt;@tamerlan_dev.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Readings
&lt;/h2&gt;

&lt;p&gt;If you want to learn more about the design patterns, I would recommend &lt;a href="https://refactoring.guru/design-patterns" rel="noopener noreferrer"&gt;Diving into Design Patterns&lt;/a&gt;. It explains all 23 design patterns found in the GoF book, in a fun and engaging manner.&lt;/p&gt;

&lt;p&gt;Another book that I recommend is &lt;a href="https://www.amazon.com/Head-First-Design-Patterns-Brain-Friendly/dp/0596007124" rel="noopener noreferrer"&gt;Heads First Design Patterns: A Brain-Friendly Guide&lt;/a&gt;, which has fun and easy-to-read explanations.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>programming</category>
      <category>architecture</category>
    </item>
    <item>
      <title>TCP in Depth</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 30 Aug 2021 01:55:13 +0000</pubDate>
      <link>https://dev.to/tamerlan/tcp-in-depth-3g83</link>
      <guid>https://dev.to/tamerlan/tcp-in-depth-3g83</guid>
      <description>&lt;p&gt;As backend engineers, we really like our black boxes.&lt;/p&gt;

&lt;p&gt;We don't enjoy getting into the nitty-gritty details.&lt;/p&gt;

&lt;p&gt;One of the topics that backend engineers avoid learning are communication protocols.&lt;/p&gt;

&lt;p&gt;Sure you know what is HTTP, and how it works on the surface level.&lt;/p&gt;

&lt;p&gt;But do you know how packets get transferred?&lt;/p&gt;

&lt;p&gt;You don't?&lt;/p&gt;

&lt;p&gt;Don't worry, it's not the end of the world.&lt;/p&gt;

&lt;p&gt;In this article, I will go over one of the three main internet protocols, which powers the world wide web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this article you will learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the TCP protocol is&lt;/li&gt;
&lt;li&gt;TCP Packet Format&lt;/li&gt;
&lt;li&gt;The different stages of the TCP protocol&lt;/li&gt;
&lt;li&gt;Features of the TCP protocol&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What is the TCP protocol?&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F1-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F1-2.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TCP which stands for &lt;strong&gt;transmission control protocol&lt;/strong&gt; is one of the main protocols in the internet suite. It is used on top of the IP (internet protocol) to ensure reliable transmission of packets.&lt;/p&gt;

&lt;p&gt;TCP fixes many issues that arise when you use IP such as lost packets, out of order packets, duplicate packets, and corrupted packets.&lt;/p&gt;

&lt;p&gt;Since TCP is most commonly used on top of IP, it is referred to as TCP/IP.&lt;/p&gt;

&lt;p&gt;Now that we know the basics of TCP, let us go a bit deeper and discuss the packet format of TCP.&lt;/p&gt;

&lt;h2&gt;TCP Packet Format&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F2-2-1024x377.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F2-2-1024x377.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The figure above shows the difference between the TCP and the IP packet. As you can see the TCP has a lot more fields in the header, this is made to ensure reliability.&lt;/p&gt;

&lt;p&gt;Let us briefly go over each field in the TCP header:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source Port Number&lt;/strong&gt; — The sending device port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination Port Number&lt;/strong&gt; — The receiving device port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sequence Number&lt;/strong&gt; — The initial client initiating the connection must choose a random sequence number, which is then incremented according to the number of bytes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acknowledgement Number&lt;/strong&gt; — This field holds the sequence number of the next byte the receiver expects. The acknowledgement field is defined only if the ACK field is set.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offset&lt;/strong&gt; — Size of the TCP header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reserved&lt;/strong&gt; — This field must always be zero, it is reserved for future use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flags fields&lt;/strong&gt; — TCP uses nine control flags to manage data flow in specific situations:&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;URG&lt;/strong&gt; — Indicates that some urgent data has been placed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ACK&lt;/strong&gt; — Indicates that acknowledgement number is valid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PSH&lt;/strong&gt; — Indicates that data should be passed to the application as soon as possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RST&lt;/strong&gt; — Resets the connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SYN&lt;/strong&gt; — Synchronizes sequence numbers to initiate a connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIN&lt;/strong&gt; — Means that the sender of the flag has finished sending data.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Window Size&lt;/strong&gt; — This field is used by the receiver to indicate to the sender how much data it can accept.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Checksum&lt;/strong&gt; — Indicates whether the header was damaged in transit.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Urgent Pointer&lt;/strong&gt; — Returns the urgent pointer of a TCP segment. If the URG flag is set, this field is an offset from the sequence number indicating the last urgent data byte.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Options/Padding&lt;/strong&gt; — Specifies various TCP options.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data&lt;/strong&gt; — Contains the information that your sending.&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;TCP Phases&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F3-1-1024x683.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F3-1-1024x683.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go through the process of transmitting a packet using TCP.&lt;/p&gt;

&lt;h3&gt;Connection Phase&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F4-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F4-1.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we send data using TCP, we first have to establish a connection.&lt;/p&gt;

&lt;p&gt;The client and server must know each other.&lt;/p&gt;

&lt;p&gt;They go through a process known as the TCP three-way handshake.&lt;/p&gt;

&lt;p&gt;Let's go through the process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client sends a packet with the SYN flag set to 1 along with it's random sequence number.&lt;/li&gt;
&lt;li&gt;The server sends a packet with both the SYN and ACK flags set to 1.&lt;/li&gt;
&lt;li&gt;Finally the client sends a packet with the ACK flag set to 1 indicating that it acknowledges the last request.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Data Transfer Phase&lt;/h3&gt;

&lt;p&gt;Now that the client and server are acquainted with each other, they are ready to send and receive data to each other.&lt;/p&gt;

&lt;p&gt;This is essentially no man's land, but there are two very important rules that every request must follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every request must be followed by an ACK request, acknowledging that the receiver received the previous request.&lt;/li&gt;
&lt;li&gt;If the receiver doesn't send the ACK request, this indicates to the user that the receiver did not receive the request, and will re-transmit it again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Connection Termination&lt;/h3&gt;

&lt;p&gt;Once the client and server are satisfied, the connection is finally ready to be closed.&lt;/p&gt;

&lt;p&gt;Let's go through this process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Either the client or the receiver can initiate the termination by sending a request with the FIN flag set to 1.&lt;/li&gt;
&lt;li&gt;The receiver will respond back with the FIN and ACK flags set to 1.&lt;/li&gt;
&lt;li&gt;One more ACK request is needed, and finally the connection is closed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Features of TCP&lt;/h2&gt;

&lt;p&gt;Now that you know most of the nitty details of the TCP protocol.&lt;/p&gt;

&lt;p&gt;Let's go over some of the features that TCP provides us.&lt;/p&gt;

&lt;h3&gt;Connection Based&lt;/h3&gt;

&lt;p&gt;Every TCP connection must be stateful, meaning the client and server must know each other. This is both good and bad, it honestly depends on your application use case. Some apps need a stateful connection while others don't.&lt;/p&gt;

&lt;h3&gt;Congestion Control&lt;/h3&gt;

&lt;p&gt;TCP has several different methods for controlling congestion or traffic. We do this because we don't want to overload our servers. Methods in controlling congestion include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TCP Slow Start&lt;/li&gt;
&lt;li&gt;Congestion Avoidance&lt;/li&gt;
&lt;li&gt;Fast Retransmit&lt;/li&gt;
&lt;li&gt;Fast Recovery&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Acknowledgement&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F6-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F6-1.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we have seen in the previous section, every request must be acknowledged in TCP. We do this to make sure no packets are lost, and this helps us handle packets that are out of order.&lt;/p&gt;

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

&lt;p&gt;TCP is pretty much used everywhere, but you would very rarely use it raw. Most of the time you would use another protocol that is built on top of TCP such as HTTP, Web Sockets, SMTP, FTP, etc...&lt;/p&gt;

&lt;p&gt;Many developers feel overwhelmed by the sheer amount of protocols, but the secret is to study from first principles. Most of these protocols come up from either TCP or UDP, once you know these two, the others are simply variants that are easy to learn.&lt;/p&gt;

&lt;p&gt;Before we end it off, I would like to say if you enjoy my content feel free to follow me on Twitter @&lt;a href="https://twitter.com/tamerlan_dev" rel="noopener noreferrer"&gt;tamerlan_dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading, if I missed anything feel free to leave them down in the comments and start a discussion.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>backend</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Design Patterns: Bridge</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 23 Aug 2021 05:54:27 +0000</pubDate>
      <link>https://dev.to/tamerlan/design-patterns-bridge-15a8</link>
      <guid>https://dev.to/tamerlan/design-patterns-bridge-15a8</guid>
      <description>&lt;p&gt;Liquid syntax error: 'raw' tag was never closed&lt;/p&gt;
</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>programming</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Project Ideas to Make You a Better Developer</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Tue, 17 Aug 2021 07:00:26 +0000</pubDate>
      <link>https://dev.to/tamerlan/project-ideas-to-make-you-a-better-developer-37l3</link>
      <guid>https://dev.to/tamerlan/project-ideas-to-make-you-a-better-developer-37l3</guid>
      <description>&lt;p&gt;There's no secret method in becoming a better developer.&lt;/p&gt;

&lt;p&gt;There's no substitute for hard work.&lt;/p&gt;

&lt;p&gt;You gotta study, and simply grind it out.&lt;/p&gt;

&lt;p&gt;But sometimes you can speed up the process.&lt;/p&gt;

&lt;p&gt;One way is to create "good" projects&lt;/p&gt;

&lt;p&gt;But what are good projects?&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;

&lt;h2&gt;What makes a good project?&lt;/h2&gt;

&lt;p&gt;All projects are good.&lt;/p&gt;

&lt;p&gt;But, some are better than others.&lt;/p&gt;

&lt;p&gt;How do we judge projects?&lt;/p&gt;

&lt;p&gt;Before I begin listing out the criteria by which I judge projects, I just wanna say that this is very subjective and at the end of the day it totally depends on you, if you think a project is great, then it is great, no arguments needed.&lt;/p&gt;

&lt;p&gt;Now with that done, let's go over what I find important in a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tech Stack&lt;/strong&gt; — We can judge a project by the tech stack it's using. That also depends on you, if you wanna learn Java, then simply create projects using Java. I'm not advocating using the latest and greatest tech, but it's good to experiment with different tech stacks and see which ones you enjoy programming in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size&lt;/strong&gt; — The bigger the project, the better it is? In most cases it is, big projects force you to think about architecture, file structure, and lots of other things that you might ignore. On the other hand, small projects are good if your focused on learning one specific tech. For example, if you wanna learn web sockets, you would create a super simple chat app, with the basic needs just to learn web sockets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Challenge&lt;/strong&gt; — An easy project is no fun, you won't learn much. That's why it's important to have a project which is slightly outside of your comfort zone. Make sure it's not too outside of your comfort zone for you to be overwhelmed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fun&lt;/strong&gt; — In my opinion, a fun project is always a good project. It just motivates you to write code, and simply have fun.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we know how to judge projects, let us answer a very common question that most beginner programmers have.&lt;/p&gt;

&lt;h3&gt;Should my projects be recruiter oriented?&lt;/h3&gt;

&lt;p&gt;This is another common question that junior developers have.&lt;/p&gt;

&lt;p&gt;The simple answer is no.&lt;/p&gt;

&lt;p&gt;Most companies don't look at your personal projects UNLESS they are super outstanding such as a popular open-source project or equivalent.&lt;/p&gt;

&lt;p&gt;What I'm trying to say is that you should create projects because you genuinely want to do them, you might want to learn some new technology, or simply have fun.&lt;/p&gt;

&lt;h2&gt;Projects&lt;/h2&gt;

&lt;p&gt;That the theory is over with, let's move over to more practical advice.&lt;/p&gt;

&lt;p&gt;Here are the projects I recommend every programmer to at least try doing.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS. I probably have missed some other great project ideas, if I did make sure to leave them down in the comments.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;Clones (Netflix, Google, Amazon, etc...)&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F1-1024x528.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F1-1024x528.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You got no project ideas?&lt;/p&gt;

&lt;p&gt;Clone apps?&lt;/p&gt;

&lt;p&gt;What apps?&lt;/p&gt;

&lt;p&gt;Any app., it can be Netflix, Google, Amazon, etc...&lt;/p&gt;

&lt;p&gt;Cloning apps is a great way to learn how these giant apps were made.&lt;/p&gt;

&lt;p&gt;You essentially reverse engineer these apps and learn their trade secrets.&lt;/p&gt;

&lt;h3&gt;Visualizers&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F2-1024x576.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F2-1024x576.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visualizers have become super popular lately.&lt;/p&gt;

&lt;p&gt;Mainly because it teaches you core CS fundamentals.&lt;/p&gt;

&lt;p&gt;It's also a nice project to put on your resume.&lt;/p&gt;

&lt;p&gt;You can visualize lot's of things, sorting algorithms, shortest path algorithms, etc...&lt;/p&gt;

&lt;p&gt;Bonus points making this much more beautiful&lt;/p&gt;

&lt;h3&gt;Video/Text Chat App&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F3-1024x683.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F3-1024x683.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't like putting specific projects, but I couldn't skip this one.&lt;/p&gt;

&lt;p&gt;I like this project, it's fun and it teaches you trending topics such as web sockets and WebRTC&lt;/p&gt;

&lt;p&gt;It's also a very cool project to put on your resume.&lt;/p&gt;

&lt;h3&gt;CMS System&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F4.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a classic.&lt;/p&gt;

&lt;p&gt;CMS systems can be very simple or complex.&lt;/p&gt;

&lt;p&gt;If by any chance your CRM system is useful, you can turn it into a full-fledged SaaS (Software as a Service) making you some side income.&lt;/p&gt;

&lt;h3&gt;Cloud Computing Project&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F12.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lot's of companies are moving to cloud providers for their infrastructure needs.&lt;/p&gt;

&lt;p&gt;What better way to learn the cloud, than creating a cloud-based project.&lt;/p&gt;

&lt;p&gt;You can create a small project that uses some sort of cloud service:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Storage: AWS S3&lt;/li&gt;
&lt;li&gt;Database: AWS RDS&lt;/li&gt;
&lt;li&gt;Functions: AWS Lambda&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;PS. You don't have to use AWS, it's simply the most popular one currently. You can check other cloud providers such as Google Cloud and Microsoft Azure.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;Games&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F5-1024x562.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F5-1024x562.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you enjoy playing games, why not make one?&lt;/p&gt;

&lt;p&gt;It might be tough but make sure to pick something that isn't too hard, you won't be making the next witcher.&lt;/p&gt;

&lt;p&gt;You can make a 3D game that will teach you lots about physics, or even a multiplayer game that will teach you about networking.&lt;/p&gt;

&lt;p&gt;You can start off by learning Unity, or my personal favourite Godot.&lt;/p&gt;

&lt;h3&gt;Distributed Systems Project&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F6.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This one might be a bit hard to do, but it will immensely help you because most companies are moving to a distributed architecture.&lt;/p&gt;

&lt;p&gt;You can create simple microservices that communicate with each other using HTTP or gRPC.&lt;/p&gt;

&lt;p&gt;You can add a reverse proxy, as an API gateway, maybe even a load balancer, and you can host this on the cloud using some cloud provider.&lt;/p&gt;

&lt;h3&gt;Online Code Editor&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F7-1024x576.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F7-1024x576.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is another fun and challenging project.&lt;/p&gt;

&lt;p&gt;Personally, I've never done this but would assume that it's no easy feat.&lt;/p&gt;

&lt;p&gt;Your gonna have to be able to work with files, and syntax highlighting.&lt;/p&gt;

&lt;p&gt;Don't forget about running the code, probably gonna use some sort of compiler underneath.&lt;/p&gt;

&lt;h3&gt;Regex Query Tool&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F8-1024x538.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F8-1024x538.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will probably be a frustrating project due to how annoying regex is.&lt;/p&gt;

&lt;p&gt;Nevertheless, it's a great project, your gonna learn how regex works (finally!!)&lt;/p&gt;

&lt;p&gt;You can add features like having test cases for regex, and even a history&lt;/p&gt;

&lt;h3&gt;File Manager&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F9-1024x640.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F9-1024x640.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is another fun project to do, it teaches you how the file system works.&lt;/p&gt;

&lt;p&gt;It will also teach you basic data structures because your gonna have to use them to implement some features.&lt;/p&gt;

&lt;h3&gt;Machine Learning Project&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F10.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine learning is hot.&lt;/p&gt;

&lt;p&gt;People think it's too hard, but in fact, there are many ready-made libraries that abstract all the hard stuff for us.&lt;/p&gt;

&lt;p&gt;You can create a mask detector app or handwriting detector app.&lt;/p&gt;

&lt;h3&gt;Your Own Framework&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F08%2F11.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a great project because it will make you appreciate the frameworks your already using.&lt;/p&gt;

&lt;p&gt;To start you can choose a framework to clone.&lt;/p&gt;

&lt;p&gt;You can start off by cloning basic functionality and slowly start implementing more features.&lt;/p&gt;

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

&lt;p&gt;That was long?&lt;/p&gt;

&lt;p&gt;I sure hope you got an idea for your next project.&lt;/p&gt;

&lt;p&gt;If so, tell me which one your gonna make down in the comments below!&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h3&gt;The Plug&lt;/h3&gt;

&lt;p&gt;If you want more content like this, follow me on &lt;a href="http://dev.to"&gt;dev.to&lt;/a&gt; or even check out my personal &lt;a href="http://softwareadventuring.com" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also publish small snippets of content on Twitter, follow me @&lt;a href="https://twitter.com/tamerlan_dev" rel="noopener noreferrer"&gt;tamerlan_dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>career</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>Design Patterns: Adapter</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 09 Aug 2021 03:34:08 +0000</pubDate>
      <link>https://dev.to/tamerlan/design-patterns-adapter-36d9</link>
      <guid>https://dev.to/tamerlan/design-patterns-adapter-36d9</guid>
      <description>&lt;p&gt;In the last article, we have finished the first chapter in our design pattern series.&lt;/p&gt;

&lt;p&gt;Today, we start a new chapter, where we will go over the structural design pattern.&lt;/p&gt;

&lt;p&gt;"But, what's structural?" you may ask.&lt;/p&gt;

&lt;p&gt;While creational patterns focus on how objects are created, structural patterns focus on how efficient do objects &lt;strong&gt;combine&lt;/strong&gt; to create other &lt;strong&gt;complex&lt;/strong&gt; objects.&lt;/p&gt;

&lt;p&gt;A real-life analogy would be a fruit salad, you can make fruit salads in many different ways with all sorts of different fruits, but there are some combinations that are superior to others. Structural design patterns help use effectively and flexibly combine objects together to form complex structures.&lt;/p&gt;

&lt;p&gt;To begin, the first of these patterns would be the Adapter pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today you will learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Core concepts behind the Adapter pattern&lt;/li&gt;
&lt;li&gt;How to implement the adapter pattern&lt;/li&gt;
&lt;li&gt;How to recognize opportunities the adapter pattern&lt;/li&gt;
&lt;li&gt;The benefits and downsides of the adapter pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Definition&lt;/h2&gt;

&lt;p&gt;We have a ritual in this series, to start googling things.&lt;/p&gt;

&lt;p&gt;So let's google: "what is the adapter pattern?"&lt;/p&gt;

&lt;p&gt;You would get a Wikipedia answer that would look something like this:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Why does Wikipedia make everything sound so damn complicated?&lt;/p&gt;

&lt;p&gt;In a nutshell, the &lt;strong&gt;adapter pattern allows classes with incompatible interfaces to work with each other.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But what do you mean by incompatible interfaces?&lt;/p&gt;

&lt;p&gt;Good question, lemme give you an example&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PS. I'm taking this example from refactoring.guru, they are a great resource, and most of my research comes from there. You can check them out &lt;a href="https://refactoring.guru/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Imagine that you have a stock monitoring app.&lt;/p&gt;

&lt;p&gt;The app currently has two components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The third-party library you use to get stocks data.&lt;/li&gt;
&lt;li&gt;A client that monitors, and visualizes the data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One day you come across a new library, that provides analytics.&lt;/p&gt;

&lt;p&gt;You get all excited and begin coding.&lt;/p&gt;

&lt;p&gt;You eventually realize that your current code isn't compatible with the analytics library.&lt;/p&gt;

&lt;p&gt;Your code, works on XML, while the analytics library works in JSON.&lt;/p&gt;

&lt;p&gt;Your stock provider only works with XML, while the analytics only works with JSON.&lt;/p&gt;

&lt;p&gt;This may be the end...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F1-9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F1-9.png" alt="" width="800" height="400"&gt;&lt;/a&gt;Source: &lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;https://refactoring.guru/design-patterns/adapter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point you have two options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get all grumpy and quit&lt;/li&gt;
&lt;li&gt;Toughen up and find a solution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the sake of this article, let's say you went with option number two.&lt;/p&gt;

&lt;p&gt;After a while, you come across an article, about the adapter pattern, and soon realize it's a perfect opportunity to use it.&lt;/p&gt;

&lt;p&gt;You just have to create an &lt;em&gt;Adapter&lt;/em&gt; class, that transforms XML to JSON.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F2-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F2-8.png" alt="" width="800" height="400"&gt;&lt;/a&gt;Source: &lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://refactoring.guru/design-patterns/adapter" rel="noopener noreferrer"&gt;https://refactoring.guru/design-patterns/adapter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The adapter has to &lt;em&gt;wrap&lt;/em&gt; around the XML object and transform it into JSON.&lt;/p&gt;

&lt;p&gt;The XML class doesn't even know it's being wrapped.&lt;/p&gt;

&lt;p&gt;Seems simple enough, let's implement this!&lt;/p&gt;

&lt;h2&gt;Implementation&lt;/h2&gt;

&lt;p&gt;Currently, our client looks something like this:&lt;/p&gt;

&lt;pre&gt;import stock_data_providor from "third-party-stock-library"

class Client {

    public function main(){
        const xml_stocks = stock_data_provider.get_all_stocks()

        this.visualize(xml_stocks)
    }

    public function visualize(){
        // visualization code
    }

}
&lt;/pre&gt;

&lt;p&gt;There are currently only two components, the stock data and client.&lt;/p&gt;

&lt;p&gt;Let's try adding the analytics library:&lt;/p&gt;

&lt;pre&gt;import stock_data_providor from "third-party-stock-library"
import analytics from "third-party-analytics-library"

class Client {

    public function main(){
        const xml_stocks = stock_data_provider.get_all_stocks()

        this.visualize(xml_stocks)
        analytics.analyze(xml_stocks)
    }

    // rest of code

}
&lt;/pre&gt;

&lt;p&gt;This will throw an error because the &lt;code&gt;analyze&lt;/code&gt; function only accepts a JSON.&lt;/p&gt;

&lt;p&gt;To fix that, we have to transform the XML into JSON.&lt;/p&gt;

&lt;p&gt;Let's create an adapter class:&lt;/p&gt;

&lt;pre&gt;class XmlToJsonAdapter(){
    const xml_data

    constructor(xml_data){
            this.xml_data = xml_data
    }

    public function get_json() {
        // return json version of xml
        // out of the scope of this article 
    }

}
&lt;/pre&gt;

&lt;p&gt;Our adapter class accepts &lt;code&gt;xml_data&lt;/code&gt; and with the help of the &lt;code&gt;get_json&lt;/code&gt; function, it returns a JSON version of the XML.&lt;/p&gt;

&lt;p&gt;Let's update our client:&lt;/p&gt;

&lt;pre&gt;import stock_data_providor from "third-party-stock-library"
import analytics from "third-party-analytics-library"
import XmlToJsonAdapter from "./xml_adapter"

class Client {

    public function main(){
        const xml_stocks = stock_data_provider.get_all_stocks()
        const json_format = new XmlToJsonAdapter(xml_stocks)

        this.visualize(xml_stocks)
        analytics.analyze(json_format)
    }

    // rest of code

}
&lt;/pre&gt;

&lt;p&gt;Our code is finally working, good job in implementing the adapter pattern.&lt;/p&gt;

&lt;p&gt;A key to learning design patterns is to know when to use them.&lt;/p&gt;

&lt;p&gt;Let's go over opportunities on when to use this pattern.&lt;/p&gt;

&lt;h2&gt;When to use this pattern?&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Incompatible Interfaces&lt;/strong&gt; — When you want to integrate two or more classes with incompatible interfaces, you can use the adapter pattern to make it work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Reuse&lt;/strong&gt; — Use the adapter pattern when you want to reuse legacy code without making any modifications to the original code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Benefits&lt;/h2&gt;

&lt;p&gt;Throughout this article, we have covered the technical aspects of the adapter pattern.&lt;/p&gt;

&lt;p&gt;Let's take a step back, and think about why is this pattern useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single Responsibility Principle&lt;/strong&gt; — You separate the data conversion code, from the underlying business logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Closed Principle&lt;/strong&gt; — You can easily introduce new adapters, without breaking the existing client code, as long as they work with a common interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Downsides&lt;/h2&gt;

&lt;p&gt;Time to hit reality, it's not all sunshine and rainbows.&lt;/p&gt;

&lt;p&gt;Let's go over the downsides in using the adapter pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complexity&lt;/strong&gt; — The overall complexity of the code increases, due to the addition of extra classes and interfaces. Sometimes it's easier to change the code in the services. But keep in mind, &lt;strong&gt;the path of least resistance isn't always the best.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adapter Chain&lt;/strong&gt; — Sometimes many different adapters are required, causing an adapter chain. This kind of code simply gets very messy and hard to debug.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I would like to end it off with a question.&lt;/p&gt;

&lt;p&gt;What do you think about this pattern?&lt;/p&gt;

&lt;p&gt;Do you ever see yourself using it?&lt;/p&gt;

&lt;p&gt;Can't wait to see your answers down in the comments.&lt;/p&gt;

&lt;p&gt;This has been Tamerlan, I would appreciate it if you would follow me on Twitter &lt;a href="https://twitter.com/tamerlan_dev" rel="noopener noreferrer"&gt;@tamerlan_dev&lt;/a&gt; and check out my blog &lt;a href="http://softwareadventuring.com" rel="noopener noreferrer"&gt;softwareadventuring.com&lt;/a&gt; for more content like this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today you learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition and implementation of the adapter pattern.&lt;/li&gt;
&lt;li&gt;When to use the adapter pattern.&lt;/li&gt;
&lt;li&gt;The benefits and downsides of using the adapter pattern.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h2&gt;Further Readings&lt;/h2&gt;

&lt;p&gt;If you want to learn more about the design patterns, I would recommend &lt;a href="https://refactoring.guru/design-patterns" rel="noopener noreferrer"&gt;Diving into Design Patterns&lt;/a&gt;. It explains all 23 design patterns found in the GoF book, in a fun and engaging manner.&lt;/p&gt;

&lt;p&gt;Another book that I recommend is &lt;a href="https://www.amazon.com/Head-First-Design-Patterns-Brain-Friendly/dp/0596007124" rel="noopener noreferrer"&gt;Heads First Design Patterns: A Brain-Friendly Guide&lt;/a&gt;, which has fun and easy-to-read explanations.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>programming</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Serverless For Dummies</title>
      <dc:creator>Tamerlan</dc:creator>
      <pubDate>Mon, 02 Aug 2021 03:49:52 +0000</pubDate>
      <link>https://dev.to/tamerlan/serverless-for-dummies-444n</link>
      <guid>https://dev.to/tamerlan/serverless-for-dummies-444n</guid>
      <description>&lt;p&gt;A couple of days ago I started looking at job vacancies for backend developers.&lt;/p&gt;

&lt;p&gt;I started to notice some sort of pattern.&lt;/p&gt;

&lt;p&gt;They almost all required some sort of experience with cloud providers such as AWS.&lt;/p&gt;

&lt;p&gt;I don't have any such experience, and this was the inspiration behind this article.&lt;/p&gt;

&lt;p&gt;I've scoured the internet for all sorts of information on cloud providers, it turns out there is a common unifying architecture behind all of them.&lt;/p&gt;

&lt;p&gt;It's called Serverless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this article, you will learn:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How companies &lt;strong&gt;manage&lt;/strong&gt; their &lt;strong&gt;infrastructure&lt;/strong&gt; before introducing serverless&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;core&lt;/strong&gt; concepts behind the serverless architecture&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;benefits&lt;/strong&gt; and &lt;strong&gt;drawbacks&lt;/strong&gt; of using the serverless architecture&lt;/li&gt;
&lt;li&gt;Common &lt;strong&gt;misconceptions&lt;/strong&gt; about serverless&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;The History Behind Serverless&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F1-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F1-8.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Serverless is the latest evolution of managing software infrastructure.&lt;/p&gt;

&lt;p&gt;Every evolution eases the management of infrastructure, making it easier, faster, and cheaper.&lt;/p&gt;

&lt;p&gt;Let's go over each of them.&lt;/p&gt;

&lt;h3&gt;Do it All Yourself (D.I.A.Y)&lt;/h3&gt;

&lt;p&gt;In the beginning, if you wanted to publish your software, you had to do all the "&lt;em&gt;grunt&lt;/em&gt;" work yourself.&lt;/p&gt;

&lt;p&gt;Meaning, you had:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Buy a server&lt;/li&gt;
&lt;li&gt;Set it up (operating system, firewalls, etc...)&lt;/li&gt;
&lt;li&gt;Copy your code over to the server&lt;/li&gt;
&lt;li&gt;Maintain it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is slow and pretty expensive.&lt;/p&gt;

&lt;p&gt;You had to manually upgrade your servers and fix any hardware issues that come up.&lt;/p&gt;

&lt;p&gt;Another big issue with this approach is scalability.&lt;/p&gt;

&lt;p&gt;You have to get additional servers, and your gonna have to deal with load balancing, which may get very frustrating.&lt;/p&gt;

&lt;p&gt;But on the bright side, you have full control of the server and the contents inside it.&lt;/p&gt;

&lt;h3&gt;Virtual Machines&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F2-7-1024x818.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F2-7-1024x818.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CPU's nowadays are much faster than they were in the past.&lt;/p&gt;

&lt;p&gt;This advancement has brought a new way to manage infrastructure.&lt;/p&gt;

&lt;p&gt;Instead of configuring one workload/program with one physical server, we can have multiple workloads on a single physical server.&lt;/p&gt;

&lt;p&gt;This is made possible by installing a hypervisor such as VMware vSphere or Microsoft Hyper-V. This allows us to support multiple guest operating systems by sharing the host's resources, such as memory and processing.&lt;/p&gt;

&lt;p&gt;In comparison to physical servers, virtual machines are more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cheaper&lt;/strong&gt;: You can have multiple workloads on a single physical machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient&lt;/strong&gt;: The hypervisor efficiently distributes resources to virtual machines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalable&lt;/strong&gt;: To scale, you can simply add more virtual machines on a single server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it's not all sunshine and rainbows, the downside is that it is much more complex to manage virtual machines than it is physical servers.&lt;/p&gt;

&lt;h3&gt;Containers&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F3-6-1024x887.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F3-6-1024x887.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Containers are pretty popular nowadays.&lt;/p&gt;

&lt;p&gt;They were mostly popularized due to &lt;a href="https://softwareadventuring.com/introduction-to-docker/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Containers are essentially an "&lt;em&gt;upgrade&lt;/em&gt;" to virtual machines.&lt;/p&gt;

&lt;p&gt;It jumbles your program, with the &lt;strong&gt;minimum dependencies&lt;/strong&gt; needed to run it into a &lt;strong&gt;single unit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of booting up a whole operating system for your program, containers &lt;strong&gt;share&lt;/strong&gt; the hosts operating system. This makes them very light and fast.&lt;/p&gt;

&lt;p&gt;This is the basics of containers, but if you want a more thorough explanation, check out our post on &lt;a href="https://softwareadventuring.com/introduction-to-docker/" rel="noopener noreferrer"&gt;Docker and Containerization&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Serverless&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F4-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F4-5.png" alt="" width="800" height="400"&gt;&lt;/a&gt;Source: &lt;a href="https://www.gocd.org/2017/06/26/serverless-architecture-continuous-delivery/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://www.gocd.org/2017/06/26/serverless-architecture-continuous-delivery/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://www.gocd.org/2017/06/26/serverless-architecture-continuous-delivery/" rel="noopener noreferrer"&gt;https://www.gocd.org/2017/06/26/serverless-architecture-continuous-delivery/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Serverless is the latest addition to infrastructure management.&lt;/p&gt;

&lt;p&gt;It essentially uses a cloud provider (AWS, Azure, or Google Cloud) to completely manage your infrastructure.&lt;/p&gt;

&lt;p&gt;You don't have to worry about servers, scalability, fault tolerance, etc...&lt;/p&gt;

&lt;p&gt;It's all managed by the cloud provider.&lt;/p&gt;

&lt;p&gt;Initially serverless started out as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend as a Service (BaaS)&lt;/li&gt;
&lt;li&gt;Function as a Service (FaaS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's delve a bit deeper into each&lt;/p&gt;

&lt;h3&gt;Backend as a Service&lt;/h3&gt;

&lt;p&gt;Serverless was first thought of applications that partially or fully use third party cloud provided services to manage server-side logic.&lt;/p&gt;

&lt;p&gt;Examples include mobile apps or single pages applications (SPA) that use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud Accessible Database (ex. Firebase, Parse)&lt;/li&gt;
&lt;li&gt;Authentication Services (ex. OAuth, AWS Cognito)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These types of services are known as Backend as a Service (BaaS).&lt;/p&gt;

&lt;h3&gt;Function as a Service&lt;/h3&gt;

&lt;p&gt;The most popular meaning of serverless is Function as a Service (FaaS).&lt;/p&gt;

&lt;p&gt;This is where application code is still run by the developer but it’s run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a third party.&lt;/p&gt;

&lt;p&gt;The most popular FaaS is AWS Lambda, others include Google Cloud Functions and Azure Functions.&lt;/p&gt;

&lt;p&gt;We usually refer to FaaS when talking about Serverless.&lt;/p&gt;

&lt;h2&gt;Benefits&lt;/h2&gt;

&lt;p&gt;You might ask me:&lt;/p&gt;

&lt;p&gt;"why would I use this?"&lt;/p&gt;

&lt;p&gt;This is a very valid question, and to answer that we will go over the benefits that serverless provides us.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cheap&lt;/strong&gt; — In serverless, you only pay for what you use. For example, in a traditional server of 100GB, if you're only using 10GB of the 100GB, you would still pay for the full 100GB. While in serverless you would only pay for what you use. This can be extended to both BaaS and FaaS, it might be cheaper to not implement some features if you can directly use a backend service provided. While for FaaS, the cost benefits come in scaling. Meaning that you only pay when your functions are being run. When they aren't being run, you don't pay a single dime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast&lt;/strong&gt; — When you don't have to worry much about infrastructure, you have the ability to focus most of your energy on development. Essentially making time to market, much faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Drawbacks&lt;/h2&gt;

&lt;p&gt;It's time to face reality.&lt;/p&gt;

&lt;p&gt;Nothing is perfect.&lt;/p&gt;

&lt;p&gt;It's time to go over the drawbacks of using serverless:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vendor control&lt;/strong&gt; — Your cloud provider controls your whole infrastructure, which may cause issues if they have any problems on their end. Problems such as system downtime, unexpected limits, cost changes, loss of functionality, forced API upgrades, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vendor lock-in&lt;/strong&gt; — Cloud providers aren't interchangeable, they may have the same services but most likely that they are implemented differently. If you want to move from one provider to another, you will be forced to do some code changes or even architectural changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complexity&lt;/strong&gt; — Things get complex when you have many functions. Complexity may arise in code, architecture, or even simply debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing&lt;/strong&gt; — Unit testing functions isn't that hard, because they are stateless and isolated. The difficulty comes when you have to do integration tests between two or more functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Common Misconceptions&lt;/h2&gt;

&lt;p&gt;Serverless started in 2015, it's still fairly new, with that comes a lot of misconceptions.&lt;/p&gt;

&lt;p&gt;Let's break down the most common misconceptions that people have about serverless.&lt;/p&gt;

&lt;h3&gt;Serverless = No Servers&lt;/h3&gt;

&lt;p&gt;Serverless doesn't mean there aren't any servers involved.&lt;/p&gt;

&lt;p&gt;Your code must be stored somewhere.&lt;/p&gt;

&lt;p&gt;It just means that you don't have to deal with it anymore.&lt;/p&gt;

&lt;p&gt;Serverless = Fewer Servers&lt;/p&gt;

&lt;h3&gt;Serverless Means Functions as a Service (FaaS)&lt;/h3&gt;

&lt;p&gt;Most people think that Serverless are essentially FaaS such as AWS Lambda, but there are many other services that can be considered to be serverless.&lt;/p&gt;

&lt;p&gt;Here are the ones provided by AWS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F5-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsoftwareadventuring.com%2Fwp-content%2Fuploads%2F2021%2F07%2F5-4.png" alt="" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Serverless doesn’t perform as well&lt;/h3&gt;

&lt;p&gt;Many people say that serverless functions take way too long to start but this happens when you don't properly configure the right memory size for each function.&lt;/p&gt;

&lt;p&gt;Some functions simply require more memory and some less. It's up to you to find the right balance.&lt;/p&gt;

&lt;h3&gt;Serverless is super cheap&lt;/h3&gt;

&lt;p&gt;There's this meme going on about huge bills coming from cloud providers.&lt;/p&gt;

&lt;p&gt;Sadly it's true, this happens when you just use an absurd amount of services or not optimizing the use of your services.&lt;/p&gt;

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

&lt;p&gt;Serverless is definitely the future.&lt;/p&gt;

&lt;p&gt;There's no resisting it.&lt;/p&gt;

&lt;p&gt;But you pushed through it, and have gotten the basics of serverless down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Today you learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The history behind serverless&lt;/li&gt;
&lt;li&gt;Core concepts of serverless architecture&lt;/li&gt;
&lt;li&gt;Benefits and drawbacks of serverless&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>serverless</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
