<?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: Shawn Smith</title>
    <description>The latest articles on DEV Community by Shawn Smith (@shawnsmith24).</description>
    <link>https://dev.to/shawnsmith24</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%2F994892%2F488c6748-a778-4284-8213-19cd16bf6c48.jpeg</url>
      <title>DEV Community: Shawn Smith</title>
      <link>https://dev.to/shawnsmith24</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shawnsmith24"/>
    <language>en</language>
    <item>
      <title>SQL Basics</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Tue, 25 Jul 2023 17:29:01 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/sql-basics-3bin</link>
      <guid>https://dev.to/shawnsmith24/sql-basics-3bin</guid>
      <description>&lt;p&gt;As I wrap up my intro to SQL course in my data engineering journey here are some basics to get started with writing some queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL
&lt;/h2&gt;

&lt;p&gt;SQL stands for Structured Query Language, and it is used to manage and manipulate relational databases. SQL is a powerful tool for data analysis and is widely used in data engineering and data science.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;

&lt;p&gt;The basic syntax for SQL queries is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query selects the specified columns from the specified table.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Here is an example of a SQL query that selects all columns from the "employees" table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Distinct
&lt;/h3&gt;

&lt;p&gt;SQL queries can filter out duplicates using the &lt;code&gt;DISTINCT&lt;/code&gt; keyword. The &lt;code&gt;DISTINCT&lt;/code&gt; keyword specifies that only distinct values should be returned for the specified column.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="k"&gt;column_name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Here is an example of a SQL query that selects the distinct departments from the "employees" table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Filtering
&lt;/h3&gt;

&lt;p&gt;SQL queries can be filtered using the &lt;code&gt;WHERE&lt;/code&gt; clause. The &lt;code&gt;WHERE&lt;/code&gt; clause specifies a condition that must be met for a row to be returned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Here is an example of a SQL query that selects the "name" and "salary" columns from the "employees" table where the salary is greater than 50000:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sorting
&lt;/h3&gt;

&lt;p&gt;SQL queries can be sorted using the &lt;code&gt;ORDER BY&lt;/code&gt; clause. The &lt;code&gt;ORDER BY&lt;/code&gt; clause specifies the column to sort by and the sort order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;column_name&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Here is an example of a SQL query that selects the "name" and "salary" columns from the "employees" table and sorts the results by salary in descending order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Aggregation
&lt;/h3&gt;

&lt;p&gt;SQL queries can aggregate data using functions such as &lt;code&gt;SUM&lt;/code&gt;, &lt;code&gt;AVG&lt;/code&gt;, &lt;code&gt;MIN&lt;/code&gt;, and &lt;code&gt;MAX&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;column_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;column_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="k"&gt;column_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Here is an example of a SQL query that selects the average salary for each department from the "employees" table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Aliasing
&lt;/h3&gt;

&lt;p&gt;SQL queries can alias column names and table names using the &lt;code&gt;AS&lt;/code&gt; keyword. Aliasing can make queries more readable and can also be useful when joining tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;column_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;alias_name&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;alias_name&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;SQL aliasing is a powerful tool for making SQL queries more readable and for joining tables. By using aliases, you can make your queries more concise and easier to understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a View
&lt;/h3&gt;

&lt;p&gt;A view is a virtual table that is based on the result of a SELECT statement. Views can be used to simplify complex queries by abstracting away the underlying table structure. To create a view, you can use the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;view_name&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;column1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;column2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This creates a view called &lt;code&gt;view_name&lt;/code&gt; that contains the columns and rows that are returned by the SELECT statement. The view can be queried like a regular table, and changes to the underlying table will be reflected in the view.&lt;/p&gt;

&lt;p&gt;For example, suppose you have a table called &lt;code&gt;orders&lt;/code&gt; that contains information about customer orders, including the customer ID, order date, and order total. You could create a view that summarizes this data by customer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;customer_orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_spent&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This creates a view called &lt;code&gt;customer_orders&lt;/code&gt; that summarizes the order data by customer ID and calculates the total amount spent by each customer. The view can then be queried like a regular table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer_orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This will return a table that shows the customer ID and total amount spent by each customer.&lt;/p&gt;

&lt;p&gt;Views are a powerful feature of SQL that can help simplify complex queries by abstracting away the underlying table structure. By creating views, you can create virtual tables that summarize or transform data in useful ways, and query them like regular tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;SQL is a powerful tool for managing and manipulating relational databases that is widely used in data engineering and data science. This note provides an overview of SQL's basic syntax, including how to select columns from a table, filter out duplicates, filter rows based on conditions, sort results, and aggregate data. By understanding these core concepts, you can write complex queries to extract insights from your data.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>Overview of Data Engineering</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Tue, 25 Jul 2023 02:27:35 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/overview-of-data-engineering-1h2f</link>
      <guid>https://dev.to/shawnsmith24/overview-of-data-engineering-1h2f</guid>
      <description>&lt;p&gt;During my journey as a software engineer I decided to change focus to more of a backend, data driven development path and I started my Data Engineering journey today with DataCamp and couldn't be more excited. In my first course which was an overview of data engineering this was my understanding of the basic concepts. &lt;/p&gt;

&lt;p&gt;Data engineering is the process of designing and creating systems for the collection, storage, processing, and analysis of data. A data engineer is responsible for developing, constructing, testing, and maintaining data architectures and systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Concepts and Understanding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Data Pipeline
&lt;/h3&gt;

&lt;p&gt;A data pipeline is a sequence of steps for moving data from one location to another, transforming it along the way. It consists of several components, including data ingestion, data processing, data storage, and data delivery.&lt;/p&gt;

&lt;p&gt;It helped me to think of a pipeline as just simply a highway. There is a lot going on while on the highway just like through a pipeline theres many components in play. &lt;/p&gt;

&lt;h3&gt;
  
  
  ETL
&lt;/h3&gt;

&lt;p&gt;ETL stands for Extract, Transform, and Load. It is a popular method for moving data between systems. In this process, data is extracted from a source system, transformed into a format that can be used by the target system, and loaded into the target system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Warehouse
&lt;/h3&gt;

&lt;p&gt;A data warehouse is a system used for storing and managing large volumes of data. It is designed to support business intelligence activities such as reporting, data analysis, and data mining.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Lake
&lt;/h3&gt;

&lt;p&gt;A data lake is a centralized repository that allows you to store all your structured and unstructured data at any scale. It enables you to break down data silos and combine different types of data to gain insights and make better decisions.&lt;/p&gt;

&lt;p&gt;For someone completely new to coding, understanding data or anything related to this the differences between data lake and data warehousing can be challenging to grasp. &lt;/p&gt;

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

&lt;p&gt;Data engineering is a crucial discipline for any organization that deals with large volumes of data. Understanding the basic concepts and principles is essential for building robust and scalable data architectures and systems.&lt;/p&gt;

</description>
      <category>data</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Redux for Beginners: A Step-by-Step Guide</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Fri, 14 Jul 2023 15:52:38 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/redux-for-beginners-a-step-by-step-guide-2god</link>
      <guid>https://dev.to/shawnsmith24/redux-for-beginners-a-step-by-step-guide-2god</guid>
      <description>&lt;p&gt;Introduction:&lt;/p&gt;

&lt;p&gt;Redux is a state management library for JavaScript apps. It helps you keep your app's state synchronized and easily accessible across multiple components. Redux is a popular choice for React developers, as it can help to make your code more modular and predictable.&lt;/p&gt;

&lt;p&gt;In this blog post, we will walk you through the basics of Redux, from creating a store to dispatching actions and reducers. We will also provide some tips for beginners, so that you can get started with Redux as quickly and easily as possible.&lt;/p&gt;

&lt;p&gt;What is Redux?&lt;/p&gt;

&lt;p&gt;Redux is a state management library for JavaScript apps. It helps you keep your app's state synchronized and easily accessible across multiple components. Redux is a popular choice for React developers, as it can help to make your code more modular and predictable.&lt;/p&gt;

&lt;p&gt;How does Redux work?&lt;/p&gt;

&lt;p&gt;Redux works by using a single store to hold the state of your application. The store is a JavaScript object that contains all of the data that your application needs to function. When you change the state of your application, you do so by dispatching an action. An action is a JavaScript object that tells the store what to do.&lt;/p&gt;

&lt;p&gt;Reducers&lt;/p&gt;

&lt;p&gt;Reducers are the functions that are responsible for updating the state of your application. When an action is dispatched, the reducers are called and they update the state of the store accordingly. Reducers are pure functions, which means that they always return the same output for the same input. This makes it easy to reason about the state of your application and to debug any problems that you might encounter.&lt;/p&gt;

&lt;p&gt;Creating a Redux Store&lt;/p&gt;

&lt;p&gt;The first step to using Redux is to create a store. A store is a JavaScript object that contains the state of your application. You can create a store using the createStore() function from the redux library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createStore } from "redux";

const store = createStore(reducer);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dispatching Actions&lt;/p&gt;

&lt;p&gt;Once you have created a store, you can start dispatching actions. An action is a JavaScript object that tells the store what to do. Actions have two properties: a type property and a payload property. The type property is a string that identifies the action. The payload property is an optional object that contains the data that you want to pass to the reducers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const action = {
  type: "INCREMENT",
  payload: 1,
};

store.dispatch(action);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reducers&lt;/p&gt;

&lt;p&gt;Reducers are the functions that are responsible for updating the state of your application. When an action is dispatched, the reducers are called and they update the state of the store accordingly. Reducers are pure functions, which means that they always return the same output for the same input. This makes it easy to reason about the state of your application and to debug any problems that you might encounter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const reducer = (state, action) =&amp;gt; {
  switch (action.type) {
    case "INCREMENT":
      return {
        ...state,
        count: state.count + action.payload,
      };
    default:
      return state;
  }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tips for Beginners&lt;/p&gt;

&lt;p&gt;Here are a few tips for beginners who are just starting out with Redux:&lt;/p&gt;

&lt;p&gt;Start small. Don't try to learn everything about Redux at once. Start with a simple app and gradually add more features as you become more comfortable with the library.&lt;br&gt;
Use the Redux DevTools. The Redux DevTools are a great way to debug your Redux code. They allow you to see the state of your store, the actions that have been dispatched, and the reducers that have been called.&lt;br&gt;
Don't be afraid to ask for help. There are a lot of resources available online to help you learn Redux. If you get stuck, don't be afraid to ask for help on a forum or in a chat room.&lt;br&gt;
Conclusion&lt;/p&gt;

&lt;p&gt;Redux is a powerful state management library that can help you to make your React apps more modular and predictable. If you are a beginner, don't be afraid to start small and gradually add more features as you become more comfortable with the library. And don't be afraid to ask for help if you get stuck.&lt;/p&gt;

&lt;p&gt;I hope this blog post has helped you to understand the basics of Redux. &lt;/p&gt;

</description>
      <category>redux</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Teach AI to Play Snake Using Reinforcement Learning</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Thu, 15 Jun 2023 16:51:11 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/teach-ai-to-play-snake-using-reinforcement-learning-2i6</link>
      <guid>https://dev.to/shawnsmith24/teach-ai-to-play-snake-using-reinforcement-learning-2i6</guid>
      <description>&lt;p&gt;Welcome to my technical blog post on teaching an AI agent to play the classic game of Snake using reinforcement learning techniques. In this post, I will walk you through the process of training an AI agent, utilizing PyTorch for deep learning and Pygame for creating the game environment. So let's dive in and explore the exciting world of AI and gaming!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
Snake is a popular game where the player controls a snake that grows longer as it eats food while avoiding collisions with walls or its own tail. I embarked on the challenge of training an AI agent to play this game by applying reinforcement learning algorithms, which enable the agent to learn optimal strategies through trial and error. By leveraging the power of PyTorch for deep learning and Pygame for game development, I created an environment where my AI agent can learn to play Snake autonomously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Before we get started, make sure you have the following dependencies installed on your system:&lt;/p&gt;

&lt;p&gt;Python 3.x&lt;br&gt;
PyTorch&lt;br&gt;
Pygame&lt;br&gt;
You can easily install PyTorch and Pygame using pip, a popular package installer for Python:&lt;/p&gt;

&lt;p&gt;Copy code&lt;br&gt;
&lt;code&gt;pip install torch pygame&lt;/code&gt;&lt;br&gt;
With these dependencies in place, we are ready to proceed with the project.&lt;/p&gt;

&lt;p&gt;Project Structure&lt;br&gt;
Let's take a quick look at the structure of our project:&lt;/p&gt;

&lt;p&gt;agent.py: This file contains the implementation of our AI agent using a reinforcement learning algorithm.&lt;br&gt;
game.py: Here, we implement the Snake game environment using the Pygame library.&lt;br&gt;
helper.py: This is the main script that we will use to train our AI agent.&lt;/p&gt;

&lt;p&gt;README.md: Provides information about the project.&lt;br&gt;
Having a well-organized project structure helps us stay organized and makes it easier to work with different components.&lt;/p&gt;

&lt;p&gt;Training the AI Agent&lt;br&gt;
Now, let's train our AI agent to play Snake by following these steps:&lt;/p&gt;

&lt;p&gt;Open a terminal or command prompt.&lt;br&gt;
Navigate to the project directory.&lt;br&gt;
Run the following command:&lt;/p&gt;

&lt;p&gt;Copy code&lt;br&gt;
&lt;code&gt;python train.py&lt;/code&gt;&lt;br&gt;
The training process will commence, and we can monitor the progress in the terminal. Throughout the training, our AI agent will gradually learn strategies to maximize its score while avoiding collisions. Once the training is complete.&lt;/p&gt;

&lt;p&gt;Watching the AI Agent Play&lt;br&gt;
Once our AI agent is trained, we can sit back and watch it play the Snake game by following these steps:&lt;/p&gt;

&lt;p&gt;Open a terminal or command prompt.&lt;br&gt;
Navigate to the project directory.&lt;br&gt;
Run the following command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Copy code&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;python play.py&lt;br&gt;
&lt;/code&gt;A game window will open, and we can observe our AI agent skillfully navigating the Snake game, aiming to achieve the highest score possible. It's truly fascinating to witness the intelligence our agent has developed through reinforcement learning!&lt;/p&gt;

&lt;p&gt;Challenges and Customization&lt;br&gt;
During the training process, we may encounter certain challenges and opportunities for customization. To optimize the training results, we can experiment with various parameters defined in the helper.py file. Some of the parameters we might want to tweak include:&lt;/p&gt;

&lt;p&gt;num_episodes: The number of training episodes.&lt;br&gt;
max_steps: The maximum number of steps per episode.&lt;br&gt;
epsilon_start: The initial exploration rate.&lt;br&gt;
epsilon_end: The final exploration rate.&lt;br&gt;
epsilon_decay: The rate at which exploration decreases.&lt;br&gt;
learning_rate: The learning rate for the neural network.&lt;br&gt;
gamma: The discount factor for future rewards.&lt;br&gt;
By adjusting these parameters, we can fine-tune the&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>ai</category>
      <category>python</category>
      <category>pygame</category>
    </item>
    <item>
      <title>Tailwind CSS</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Mon, 17 Apr 2023 20:29:53 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/tailwind-ia4</link>
      <guid>https://dev.to/shawnsmith24/tailwind-ia4</guid>
      <description>&lt;p&gt;Tailwind CSS is a popular utility-first CSS framework that can be used to create beautiful and responsive user interfaces quickly. React.js is a widely-used JavaScript library for building user interfaces. Together, they make a powerful combination for building complex web applications. In this blog post, we will explore how to use Tailwind CSS in React.js and the benefits of doing so.&lt;/p&gt;

&lt;p&gt;Getting Started with Tailwind CSS&lt;/p&gt;

&lt;p&gt;Before we dive into using Tailwind CSS with React.js, we need to install Tailwind CSS in our project. We can do this using npm, by running the following command in our terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install tailwindcss

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

&lt;/div&gt;



&lt;p&gt;Once Tailwind CSS is installed, we need to create a configuration file for it. We can do this by running the following command in our terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwindcss init

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

&lt;/div&gt;



&lt;p&gt;This will create a tailwind.config.js file in our project's root directory. This file will contain all of the configuration options for Tailwind CSS.&lt;/p&gt;

&lt;p&gt;Using Tailwind CSS in React.js&lt;/p&gt;

&lt;p&gt;Once Tailwind CSS is installed and configured, we can start using it in our React.js application. The easiest way to do this is by adding Tailwind CSS classes to our HTML elements. For example, we can add the bg-red-500 class to a div element to give it a red background color:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="bg-red-500"&amp;gt;
  This is a red div.
&amp;lt;/div&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;In React.js, we can add Tailwind CSS classes to our elements using the className attribute instead of the class attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div className="bg-red-500"&amp;gt;
  This is a red div.
&amp;lt;/div&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;We can also use Tailwind CSS in our React.js components by importing it into our JavaScript files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import 'tailwindcss/tailwind.css';

function App() {
  return (
    &amp;lt;div className="bg-red-500"&amp;gt;
      This is a red div.
    &amp;lt;/div&amp;gt;
  );
}

export default App;

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

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building an API in Flask</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Fri, 31 Mar 2023 14:47:36 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/building-an-api-in-flask-2enp</link>
      <guid>https://dev.to/shawnsmith24/building-an-api-in-flask-2enp</guid>
      <description>&lt;p&gt;Flask is a popular web framework for building web applications and APIs in Python. It is known for its simplicity, flexibility, and ease of use. Flask allows developers to create web applications and APIs quickly and easily, without sacrificing performance or functionality.&lt;/p&gt;

&lt;p&gt;In this blog, we will explore how to build APIs in Flask. We will cover the basics of Flask, including how to install and set up Flask, how to create routes, and how to handle HTTP requests and responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Setting Up Flask&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Before we can start building our API, we need to install Flask. We can do this using pip, the Python package manager. Open up a terminal and enter the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install flask&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once Flask is installed, we can start building our API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Creating a Simple Flask App&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Let's start by creating a simple Flask app. Open up a new Python file and import Flask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask

app = Flask(__name__)

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

&lt;/div&gt;



&lt;p&gt;This creates a new Flask app. We also created a new instance of the Flask class and stored it in the app variable.&lt;/p&gt;

&lt;p&gt;Next, let's create a route that returns a simple message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.route('/')
def hello():
    return 'Hello, World!'

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

&lt;/div&gt;



&lt;p&gt;This code defines a new route that listens to the root URL (/). When a client makes a request to this URL, Flask will execute the hello() function and return the message "Hello, World!".&lt;/p&gt;

&lt;p&gt;Finally, let's run the app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == '__main__':
    app.run(debug=True)

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

&lt;/div&gt;



&lt;p&gt;This code starts the Flask app and runs it in debug mode. We can now run the app by running this Python file.&lt;/p&gt;

&lt;p&gt;Handling HTTP Requests&lt;br&gt;
Flask makes it easy to handle HTTP requests. Let's create a new route that handles a GET request and returns some data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import request

@app.route('/data', methods=['GET'])
def get_data():
    data = {'name': 'John', 'age': 30}
    return data

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

&lt;/div&gt;



&lt;p&gt;In this code, we define a new route /data that listens to GET requests. When a client makes a GET request to this URL, Flask will execute the get_data() function and return the dictionary {'name': 'John', 'age': 30}.&lt;/p&gt;

&lt;p&gt;Note that we imported request from Flask. This allows us to access information about the HTTP request, such as its method and parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Handling HTTP Responses&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Flask also makes it easy to handle HTTP responses. Let's modify our previous example to return a JSON response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import jsonify

@app.route('/data', methods=['GET'])
def get_data():
    data = {'name': 'John', 'age': 30}
    return jsonify(data)

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

&lt;/div&gt;



&lt;p&gt;In this code, we imported jsonify from Flask. This function takes a Python dictionary as an argument and returns a JSON-encoded response.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Flask also makes it easy to handle errors. Let's create a new route that throws an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.route('/error')
def throw_error():
    raise Exception('Something went wrong')

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

&lt;/div&gt;



&lt;p&gt;In this code, we define a new route /error that throws an exception. When a client makes a request to this URL, Flask will execute the throw_error() function and raise an exception.&lt;/p&gt;

&lt;p&gt;We can handle this exception by creating an error handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.errorhandler(Exception)
def handle_error(e):
    return 'An error occurred: ' + str(e), 500

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

&lt;/div&gt;



&lt;p&gt;In this code, we define an error handler that handles all exceptions. When an exception is raised, Flask will execute the handle_error() function and return an error message with the exception.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Mapping it Out</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Sat, 11 Mar 2023 07:08:39 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/mapping-it-out-3n32</link>
      <guid>https://dev.to/shawnsmith24/mapping-it-out-3n32</guid>
      <description>&lt;p&gt;Object-Relational Mapping (ORM) is a programming technique that allows developers to map object-oriented programming models to relational databases. ORM is a tool that bridges the gap between object-oriented programming and relational databases. It allows developers to write code in an object-oriented programming language like Python and save the data in a relational database like MySQL or Oracle.&lt;/p&gt;

&lt;p&gt;ORM is a powerful tool that has revolutionized the way developers interact with databases. With ORM, developers no longer have to write complex SQL queries to interact with the database. Instead, they can use simple object-oriented code to perform CRUD (Create, Read, Update, Delete) operations on the database.&lt;/p&gt;

&lt;p&gt;ORM is based on the principle of mapping objects to tables. Every object in an ORM framework has a corresponding table in the database. The properties of the object are mapped to the columns of the table. For example, if you have an object called Customer with properties like Name, Email, and Phone, these properties would be mapped to the columns of the Customer table in the database.&lt;/p&gt;

&lt;p&gt;ORM frameworks provide a layer of abstraction between the application and the database. This means that developers can work with high-level abstractions like objects and classes instead of low-level constructs like tables and columns. This makes it easier for developers to write code and maintain their applications.&lt;/p&gt;

&lt;p&gt;ORM frameworks also provide features like lazy loading, caching, and transaction management. Lazy loading is a technique that allows the ORM framework to load only the data that is needed at a given time. This helps to improve performance and reduce memory usage. Caching is a technique that allows the ORM framework to store frequently accessed data in memory for faster access. Transaction management is a feature that allows developers to perform multiple database operations as a single atomic transaction.&lt;/p&gt;

&lt;p&gt;ORM frameworks have become an essential tool for modern web development. They help developers to write code faster, improve performance, and reduce the complexity of database interactions. A popular frame work is Django for Python.&lt;/p&gt;

&lt;p&gt;In conclusion, ORM is a powerful tool that has revolutionized the way developers interact with databases. It allows developers to work with high-level abstractions like objects and classes instead of low-level constructs like tables and columns. ORM frameworks provide features like lazy loading, caching, and transaction management that improve performance and reduce the complexity of database interactions. ORM has become an essential tool for modern web development and is a must-know technology for any aspiring developer.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JSX in React</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Mon, 23 Jan 2023 14:43:15 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/jsx-in-react-7l9</link>
      <guid>https://dev.to/shawnsmith24/jsx-in-react-7l9</guid>
      <description>&lt;p&gt;JSX in React is used to create DOM elements in JavaScript in an efficient way.&lt;/p&gt;

&lt;p&gt;JSX is an extension for JavaScript and describes the look of the user interface. It allows us to define React elements using syntax that looks similar to HTML. In JSX, an element’s type is specified with a tag. The tag’s attributes represent the properties. The element’s children can be added between the opening and closing tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ReactDOM from 'react-dom/client';

function App() {
  const firstName = 'Shawn'
  const lastName = 'Smith'
  return (
    &amp;lt;h1&amp;gt;Hello {firstName} {lastName}!&amp;lt;/h1&amp;gt;
  )
}

ReactDOM.createRoot(document.getElementById('root')).render(&amp;lt;App /&amp;gt;); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code is some simple JSX. We have a first and last name variables declared; Then we are creating a h1 tag that would display this information by writing the variables in curly braces inside of the tag. &lt;/p&gt;

&lt;p&gt;You can put any valid JavaScript expression inside the curly braces in JSX. It will pull in the constant firstName into the HTML written. This output will render the message “Hello Shawn Smith” on the web 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%2Ffortqs0w7e3tb3fjehu8.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%2Ffortqs0w7e3tb3fjehu8.png" alt="Image description" width="353" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In vanilla JavaScript we would use &lt;code&gt;document.createElement()&lt;/code&gt; to create pieces of our DOM in JavaScript which was a messier process than what we have access to with JSX in React.  &lt;/p&gt;

&lt;p&gt;links: &lt;a href="https://reactjs.org/docs/introducing-jsx.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/introducing-jsx.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ui</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Scopes</title>
      <dc:creator>Shawn Smith</dc:creator>
      <pubDate>Fri, 23 Dec 2022 14:02:01 +0000</pubDate>
      <link>https://dev.to/shawnsmith24/scoping-out-the-programscopes-1if0</link>
      <guid>https://dev.to/shawnsmith24/scoping-out-the-programscopes-1if0</guid>
      <description>&lt;p&gt;The &lt;strong&gt;&lt;em&gt;scope&lt;/em&gt;&lt;/strong&gt; is the current content of execution that the values and expressions are visible and can be referenced. When a variable is not in the current scope it won't be able to be used. &lt;/p&gt;

&lt;p&gt;There are different kinds of scopes; There is the &lt;strong&gt;&lt;em&gt;Global&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;Local&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;Function&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Block scopes&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Global scope&lt;/em&gt;&lt;/strong&gt; is the default scope where we would have access to the variables anywhere in our code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Local scope&lt;/em&gt;&lt;/strong&gt; is the a characteristic of variables that make them local. This is a variable that it bound to its value within a scope that is not &lt;strong&gt;&lt;em&gt;Global&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Function scope&lt;/em&gt;&lt;/strong&gt; is a scope created with a function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Block scope&lt;/em&gt;&lt;/strong&gt; is a scope created with a pair of curly braces making a "block".&lt;em&gt;(Block scopes only scope let and const declarations but not var.)&lt;/em&gt;&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%2Fdis91foookrr9vtkkvk8.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%2Fdis91foookrr9vtkkvk8.png" alt="Image description" width="265" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Knowing the different types of scopes can be a helpful tool in debugging. We can be searching our code for why something isn't running and it can be something as simple as having a variable declared in a function scope and then trying to access it globally. It's important to note when starting to code it may be easier to declare certain variables globally when it is known you will use them multiple times in different scopes. &lt;/p&gt;

&lt;p&gt;Globally declared variables you can use as many times as you need all over your code. &lt;/p&gt;

&lt;p&gt;For more detailed information go to MDN:&lt;br&gt;
Scope: &lt;a href="https://dev.tourl"&gt;https://developer.mozilla.org/en-US/docs/Glossary/Scope&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dependencyinversion</category>
    </item>
  </channel>
</rss>
