<?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: Anwar Sadat Ayub</title>
    <description>The latest articles on DEV Community by Anwar Sadat Ayub (@anwar_sadat).</description>
    <link>https://dev.to/anwar_sadat</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%2F669940%2Fb9bcd2a6-3c48-4eba-bd40-2242b7aedffa.jpg</url>
      <title>DEV Community: Anwar Sadat Ayub</title>
      <link>https://dev.to/anwar_sadat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anwar_sadat"/>
    <language>en</language>
    <item>
      <title>Day 2 - Get Registered Users/ Logged-in User</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Sat, 10 May 2025 21:40:51 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/day-2-building-loopa-app-jjp</link>
      <guid>https://dev.to/anwar_sadat/day-2-building-loopa-app-jjp</guid>
      <description>&lt;h1&gt;
  
  
  LoopaApp
&lt;/h1&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%2F6uwzr9emppfg8985zff3.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%2F6uwzr9emppfg8985zff3.png" alt="LoopaApp Logo" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Day 2 of building &lt;strong&gt;Loopa&lt;/strong&gt;, my messaging + project management app.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I added today:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Fetched and displayed all registered users on the dashboard.&lt;/li&gt;
&lt;li&gt;Highlighted the current logged-in user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s pretty basic UI for now, but it’s functional. Feels great to see the pieces coming together.&lt;/p&gt;

&lt;h3&gt;
  
  
  Next up:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Build the chat interface.&lt;/li&gt;
&lt;li&gt;Connect real-time messaging (still deciding between AJAX polling and WebSockets).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sticking to the May 30 MVP deadline.&lt;br&gt;&lt;br&gt;
Let’s see how far I can take this.&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>productivity</category>
      <category>buildinpublic</category>
    </item>
    <item>
      <title>Day 1 - Challenge for myself</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Fri, 09 May 2025 22:24:57 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/building-loopa-lightweight-team-collaboration-tool-44le</link>
      <guid>https://dev.to/anwar_sadat/building-loopa-lightweight-team-collaboration-tool-44le</guid>
      <description>&lt;h1&gt;
  
  
  LoopaApp
&lt;/h1&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%2F6uwzr9emppfg8985zff3.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%2F6uwzr9emppfg8985zff3.png" alt="LoopaApp Logo" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a new challenge am setting for myself. I plan to build 3 solid apps this year and am starting with Loopa, a lightweight chatapp that I plan to evolve into a simple project management and team collaboration tool.&lt;/p&gt;

&lt;p&gt;I built the login and signup page. I have also created the dashboard but nothing on it so far.&lt;/p&gt;

&lt;p&gt;Nothing much for today. I just want to have a basic UI and backend.&lt;/p&gt;

</description>
      <category>indiedev</category>
      <category>loopa</category>
      <category>devjournal</category>
      <category>buildinginpublic</category>
    </item>
    <item>
      <title>Mastering PHP File Paths: Simplifying Your Project's Structure</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Sun, 16 Jun 2024 06:28:10 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/mastering-php-file-paths-simplifying-your-projects-structure-650</link>
      <guid>https://dev.to/anwar_sadat/mastering-php-file-paths-simplifying-your-projects-structure-650</guid>
      <description>&lt;p&gt;Have you ever tried including a file in your project and needed clarification about how to go about it? You usually start with a simple folder structure that can quickly escalate to a complex folder structure. This article will discuss the absolute and relative paths, directory separators, file functions, including files in PHP, and how to use file paths in PHP.&lt;/p&gt;

&lt;p&gt;All paths will be in Windows OS format. An example will be like this;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$file = 'C:/xampp/htdocs/project/includes/config.php';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this article, we take a more practical approach to explain the file paths in PHP. Let’s assume that we have a project structure as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tutorials/ 
|-- database/ 
|-- |-- connection.php
|-- report/
|-- |-- admin/approvals.php
|-- |-- tracker.php
|-- signin.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Absolute vs. Relative File Paths
&lt;/h2&gt;

&lt;p&gt;To add a file to your project, you need to know the location or path of the file. Knowing the file location, you can decide to add the file in two ways; absolute or relative file path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Absolute Path
&lt;/h3&gt;

&lt;p&gt;An absolute file path specifies the complete and precise location of a file or directory in the filesystem. It starts from the root directory and includes directories up to the target file or directory. It does depend on the current working directory (CWD) and it points to the same directory regardless of the script is run.&lt;/p&gt;

&lt;p&gt;Using the absolute path, we can include the &lt;code&gt;connection.php&lt;/code&gt; file in the project1 directory like this;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// tutorials/signin.php
$path = "c:/xampp/htdocs/tutorials/database/connection.php"; // absolute path to database/connection.php

// tutorials/report/tracker.php
$path = "c:/xampp/htdocs/tutorials/database/connection.php"; // absolute path to database/connection.php

// tutorials/report/admin/approvals.php
$path = "c:/xampp/htdocs/tutorials/database/connection.php"; // absolute path to database/connection.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This path assumes that the parent directory, ‘tutorials’, is at c:\xampp\htdocs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relative Path
&lt;/h3&gt;

&lt;p&gt;The relative path does not start from the root directory. It depends on or relative to the current working directory or any other directory.&lt;/p&gt;

&lt;p&gt;When the file is inside the current working directory, use one dot sign ‘.’, and two dots ‘..’ when the file is relative to the parent directory or other directories relative to the file.&lt;/p&gt;

&lt;p&gt;Let’s get the ‘tutorials/database/connection.php’ file path relative to the other directories;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// tutorials/signin.php
$path = "./database/connection.php"; // (./) relative to the current tutorials directory

// tutorials/report/tracker.php
$path = "../database/connection.php"; // (../) moves one level up to the tutorials directory

// tutorials/report/admin/approvals.php
$path = "../../database/connection.php"; // (../../) moves two levels up to the tutorials directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Directory Separators in PHP
&lt;/h2&gt;

&lt;p&gt;When you look closely at our paths, you realize we use forward slashes, (‘/’). The forward  (‘/’) and the backslash  (‘\’) slashes, called directory separators are used to separate directories in a file system.&lt;/p&gt;

&lt;p&gt;The forward slash simplifies path handling and enhances cross-platform compatibility on Unix-like systems and is supported on Windows.&lt;/p&gt;

&lt;p&gt;The backslash is used mostly on Windows systems. The double backslash functions as an escape character string.&lt;/p&gt;

&lt;h2&gt;
  
  
  PHP File Path Functions
&lt;/h2&gt;

&lt;p&gt;PHP has many built-in functions that can be used to manipulate file paths. These functions help in constructing, analyzing, and managing paths in a platform-independent manner. Some key functions include;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;basename()&lt;/strong&gt;: This returns the filename component of a path. It takes two parameters, a path that specifies the path of the file, and a suffix that is used to specify the suffix to remove from the end of the returned file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$filename = basename($path); // connection.php
$filenameWithoutExtension = basename($path, '.php'); // connection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&lt;br&gt;
dirname(): This returns the directory name component of a path. It takes the $path parameter and optional $levels which specifies the directory levels.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$path = "htdocs/tutorials/database/connection.php";

$directory = dirname($path); // htdocs/tutorials/database
$directorySecondLevel = dirname($path, 2); // htdocs/tutorials
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&lt;br&gt;
realpath(): It is used to convert relative path to absolute path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$relativePath = "../database/connection.php";
$absolutePath = realpath($path); // C:\xampp\htdocs\tutorials\database\connection.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&lt;br&gt;
glob(): This method finds pathnames matching a pattern. It returns an array of PHP files in the specified directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$path = "tutorials/report/*.php";
$files = glob($path); // $files will contain an array of PHP files in the specified directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&lt;br&gt;
file_exists(): This method checks whether a file or directory exists. It returns a boolean value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$path = "../database/connection.php";
$files = file_exists($path); // $files will contain an array of PHP files in the specified directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Including Files in PHP
&lt;/h2&gt;

&lt;p&gt;For code organization, reusability, and maintaining modularity in PHP applications, you can use the include() and require() functions to add and evaluate files while executing a script.&lt;/p&gt;

&lt;p&gt;The include() function will generate a warning if the file cannot be found, but the script will continue to execute.&lt;/p&gt;

&lt;p&gt;The require() function will generate a fatal error if the file cannot be found, and the script will stop running.&lt;/p&gt;

&lt;p&gt;To use these functions, you need to specify the file path correctly. You can either use absolute paths or relative paths depending on your needs. The file must be in the correct location and must have the correct name (case-sensitive).&lt;/p&gt;

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

&lt;p&gt;As a software developer using PHP, it is very important to understand file paths. You must also know when to include files using either the include() or require() functions to help with code organization, reusability, and modularity.&lt;/p&gt;

&lt;p&gt;Use absolute paths when possible but can be inflexible if the scripts need to be moved to a different server or directory.&lt;/p&gt;

&lt;p&gt;Use the dirname() function to get the directory of the current file which can help to build relative paths. Relative paths can be ambiguous if the script is used in different contexts.&lt;/p&gt;

&lt;p&gt;Check the existence of a file using file_exists() functions before including it because an incorrect path can lead to errors and security vulnerabilities.&lt;/p&gt;

&lt;p&gt;Thank you for reading. See you on the next one.&lt;/p&gt;

</description>
      <category>php</category>
      <category>backenddevelopment</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>XML, YAML, JSON; Differences and Similarities</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Tue, 14 May 2024 20:36:45 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/ml-yaml-json-differences-and-similarities-3n17</link>
      <guid>https://dev.to/anwar_sadat/ml-yaml-json-differences-and-similarities-3n17</guid>
      <description>&lt;p&gt;Data is moved around a lot in today’s digital space; sensors, IoT devices, social media platforms, user interactions on websites and applications, transactions in financial systems, and more. Governments, corporations, businesses, and individuals all make decisions based on available data. Data serialization helps different computer systems understand each other by translating information into a common language. It's like translating a message so that everyone can communicate effectively, making things run smoothly in the digital world. This is essential for developers to build efficient, and interoperable software applications that can effectively exchange, store, and process data in various contexts. &lt;/p&gt;

&lt;p&gt;In this article, we will explore the 3 popular text-based data serialization formats, i.e. XML, YAML, and JSON, and their similarities and differences. You should be able to choose the right data format for your next project. This article requires that you have a basic understanding of HTML and data structures i.e. primitive data types.&lt;/p&gt;

&lt;h2&gt;
  
  
  XML (eXtensive Markup Language)
&lt;/h2&gt;

&lt;p&gt;XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. It is defined by the W3C's XML 1.0 Specification and by several other related specifications, all of which are free open standards.&lt;/p&gt;

&lt;p&gt;It is a markup language, meaning that it uses tags to identify and structure data, making it easy to understand and parse. It is a simple, flexible, and adaptable language that is used for data exchange, storage, and transmitting data across different applications. Additionally, XML is self-descriptive, platform-independent, vendor-independent, and extensible, and requires documents to be well-formed and valid according to specific rules and guidelines.&lt;/p&gt;

&lt;p&gt;In programming, XML can be used to create configuration files, internet messaging, object persistence, data auditing, and visualization.&lt;/p&gt;

&lt;p&gt;An XML tree structure is a hierarchical representation of an XML document, where each element is a node in the tree. This structure consists of the root node, the topmost element that represents the entire document. We can have the parent node, which is the element that contains other elements, the child node, an element that is contained in another element, and the sibling node which are elements that have the same parent node. &lt;/p&gt;

&lt;p&gt;Here is the basic structure of an XML document;&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;parent&amp;gt;
  |-- &amp;lt;child1&amp;gt;
  |    |-- &amp;lt;grandchild1&amp;gt;
  |    |-- &amp;lt;grandchild2&amp;gt;
  |-- &amp;lt;child2&amp;gt;
  |    |-- &amp;lt;grandchild3&amp;gt;
  |-- &amp;lt;child3&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;XML syntax is much like HTML; it contains one or more elements that have both the start tags and end tags. Each element has a type, identified by name, and may have a set of attributes that has a name and a value. Every start tag must have a corresponding end tag. Empty elements must not include white spaces between the tags. Elements have a type that is determined by the name value. XML tags and structure are not predefined, unlike HTML. The author must define the structure and tags.&lt;/p&gt;

&lt;p&gt;Let’s consider the example below;&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;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;database&amp;gt;
    &amp;lt;username&amp;gt;admin&amp;lt;/username&amp;gt;
    &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;
    &amp;lt;host&amp;gt;localhost&amp;lt;/host&amp;gt;
  &amp;lt;/database&amp;gt;
  &amp;lt;server&amp;gt;
    &amp;lt;port&amp;gt;8080&amp;lt;/port&amp;gt;
    &amp;lt;timeout&amp;gt;300&amp;lt;/timeout&amp;gt;
  &amp;lt;/server&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the XML file defines configuration settings for a database and a server. At the top of the document is the XML declaration which specifies the version of XML being used.&lt;br&gt;
XML is used for exchanging data across different platforms. In some cases, it is used as a configuration file as it provides a human-readable and easy-to-parse format for storing settings and preferences. Other areas in document management such as storing and retrieving data, web services with SOAP (Simple Object Access Protocol) and REST (Representational State of Resource) web services,  localization and internationalization for translating text and formatting data for different languages and regions, etc.&lt;/p&gt;
&lt;h2&gt;
  
  
  YAML (YAML Ain't Markup Language)
&lt;/h2&gt;

&lt;p&gt;YAML, which rhymes with “Camel”, is a human-friendly, data serialization language designed to work well in modern programming languages. YAML is a user-friendly choice for data handling and processing because it uses few structural characters to provide information.&lt;/p&gt;

&lt;p&gt;YAML supports primitive data types such as strings, numbers, boolean, maps, and arrays, allowing for the representation of diverse data structures. Programming languages that are built around these primitive data structures work well with YAML including Javascript, Perl, Python, PHP, and Ruby.&lt;br&gt;
The syntax and structure of YAML documents are designed to be human-readable and intuitive, portable between programming languages, match the native data structures of dynamic languages, have a consistent model to support generic tools, support one-pass processing, (i.e. to parsed document sequentially from start to finish without needing to revisit previously parsed parts), be expressive and extensible, and lastly be easy to implement and use. It relies on consistent indentation using spaces (not tabs) to indicate nesting levels within the document.&lt;/p&gt;

&lt;p&gt;For example;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits:
  - apple
  - banana
  - orange
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, the list of fruits is indented with two spaces under the key "fruits," indicating that it is a child element of the "fruits" key. Each item in the list is further indented under the list indicator "-" with two additional spaces, showing their association with the list.&lt;br&gt;
The indentation determines the hierarchy and relationships between data elements, such as key-value pairs and lists;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Configuration settings for a web server
server:
  # Server settings
  port: 8080        # Port number for the webserver
  host: localhost   # Hostname for the webserver
  ssl_enabled: true # Whether SSL is enabled

database:
  # Database connection settings
  type: mysql            # Type of database (e.g., MySQL, PostgreSQL)
  host: db.example.com   # Hostname for the database server
  port: 3306             # Port number for the database connection
  username: admin        # Username for database authentication
  password: secure_password # Password for database authentication
  database_name: web_db  # Name of the database to connect to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example above shows how YAML's indentation-based hierarchy is used to represent the relationships between different configuration settings in a clear and structured manner. The ‘#’ provides explanations and context for each section and key-value pair.&lt;/p&gt;

&lt;p&gt;YAML's benefits include readability and expressiveness, but it also poses challenges. Its whitespace rules and flexibility can cause confusion and mistakes, and there are security risks with poorly crafted YAML data. YAML’s lack of standardization and learning curve, along with possible performance issues and schema validation complexities, require careful handling by developers using YAML in various applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  JSON (JavaScript Object Notation)
&lt;/h2&gt;

&lt;p&gt;JSON (JavaScript Object Notation) is a lightweight data interchange format. It is known for its simplicity and minimalism. It uses a lightweight, text-based format to represent data structures consisting of key-value pairs and arrays, making it highly efficient for transmitting and parsing data over the internet. It stands tall as one of the most favored methods for structuring data, offering simplicity, flexibility, and compatibility across various platforms and programming languages.&lt;br&gt;
It is a lightweight data-interchange format that is easy for humans to read and write and straightforward for machines to parse and generate. Its syntax is derived from JavaScript object notation, but JSON is language-independent, making it versatile for use across different programming languages.&lt;br&gt;
JSON data is organized into key-value pairs, where each key is a string and each value can be either an object enclosed in curly braces {} made up of key-value pairs separated by colons: arrays enclosed in square brackets [] containing comma-separated values, strings enclosed in double quotes, numbers representing numeric values, booleans representing true or false values, and null representing an empty value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "John Doe",
  "age": 30,
  "isStudent": false,
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "country": "USA"
  },
  "languages": ["JavaScript", "Python", "Java"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above example represents information about a person named John Doe (string), aged 30 (numeric), not currently a student(boolean value), address (object), and language (array).&lt;/p&gt;

&lt;p&gt;JSON's versatility and simplicity make it suitable for a wide range of use cases across various industries and domains. It is a lightweight and easy-to-read data interchange format. It is widely used for data exchange between web servers, web applications, and mobile apps. Its simplicity and flexibility make it a popular choice for many applications and services. JSON is also used for data storage and serialization and is supported by many programming languages. Its versatility and ease of use have made it a standard format for data exchange and storage.&lt;/p&gt;

&lt;p&gt;Though JSON is very popular, it has its downside. Lack of comments which makes it challenging for developers to add explanatory notes, explicit support of data types resulting in issues with data validation, limited error handling leading to potential runtime errors or data corruption, and schema evolution making it difficult to manage data structures over time are areas that could be addressed to solidify JSON’s position as a versatile reliable data-interchange format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right Format
&lt;/h2&gt;

&lt;p&gt;The table below summarizes the use cases for XML, YAML, and 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd4egbzb45vy1letthr0.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%2Fgd4egbzb45vy1letthr0.png" alt="Use Cases for XML, YAML and JSON" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The table above focuses only on the use cases, making it easier to compare the suitability of XML, YAML, and JSON for each scenario.&lt;/p&gt;

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

&lt;p&gt;In conclusion, the evolution of data serialization continues to be driven by the need for simplicity, readability, flexibility, and performance. While JSON and YAML have gained significant adoption, there is ongoing innovation and exploration of new serialization formats to meet the evolving needs of modern software development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understand JavaScript 'this' keyword in 5 easy steps</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Mon, 06 May 2024 15:58:32 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/understand-javascript-this-keyword-in-5-easy-steps-3166</link>
      <guid>https://dev.to/anwar_sadat/understand-javascript-this-keyword-in-5-easy-steps-3166</guid>
      <description>&lt;p&gt;Javascript is a very popular programming language. It is a go-to programming language for most beginners. But going deeper, you realize that it has some weird concepts which can be frustrating for most beginners. I have had my share and that’s why I have put this article together. In this article, we will break down ‘this’ keyword in Javascript in 5 easy steps. At the end of this article, you should be conversant with ‘this’ object and conveniently use it in your code.&lt;/p&gt;

&lt;p&gt;Before we proceed, I would make this clear first. I would assume that you are familiar with Javascript Functions and at least basic knowledge of OOP in Javascript. You can read &lt;a href="https://dev.to/anwar_sadat/javascript-functions-made-easy-streamlining-code-for-beginners-pk"&gt;JavaScript Functions Made Easy: Streamlining Code for Beginners!&lt;/a&gt;  on functions  and &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Classes_in_JavaScript" rel="noopener noreferrer"&gt;Classes in Javascript&lt;/a&gt; on Javascript Classes.&lt;br&gt;
Also, you will need to follow along with the coding part. Just reading through the article will not help you much.&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction to ‘this’ keyword
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;‘this’&lt;/strong&gt; is used for a person, object, or thing to show which one is referred to by way of emphasis. For example, you could say “This is my laptop, yours is over there”. In this sentence, you referred to your laptop using ‘this’ to emphasize which of the two laptop is yours. Similarly, you use the ‘this’ keyword to refer to a specific, or even better, the current object in Javascript. The object that is referred to will depend on the context or ‘environment’ where your code runs. Whatever the context, you would use ‘this’ to refer to that context.&lt;/p&gt;

&lt;p&gt;Take note that the value of ‘this’ object depends on how a function is invoked and not how a function is defined. Understanding the code execution context is very crucial to knowing what to expect when you use the ‘this’ keyword.&lt;/p&gt;
&lt;h2&gt;
  
  
  Javascript Execution Context
&lt;/h2&gt;

&lt;p&gt;Simply put, the execution context is the environment in which code is executed. Each context comes with its settings such as the variable scope, the ‘this’ keyword, and the rules that determine how the code behaves. We will not discuss the execution context in detail. Just think of it as the wrapper that manages your code. However, I will explain some concepts in which the ‘this’ keyword can be invoked i.e. the regular function context, arrow function context, and class context.&lt;/p&gt;

&lt;p&gt;Before I go into explaining these 3 contexts, let's take a look at the Global Context. The global context is represented by the ‘window’ object. This ‘window’ object is automatically created by the browser when a web page is loaded. It represents the browser window or the global environment in which the code runs within the page. Imagine the ‘window’ object as your external .js file or the inline code between the &lt;code&gt;&amp;lt;script&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; except code that is in blocks or functions.&lt;/p&gt;

&lt;p&gt;Let’s consider this line of code in the global context of a browser as illustrated below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Global execution context
console.log(window === window); //true in a web browser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We compare the ‘window’ object to itself which obviously will be true. &lt;/p&gt;

&lt;p&gt;Now let's check if ‘this’ is the same as the ‘window’ object’;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Global execution context
console.log(this === window); //true in a web browser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We get true as well. Therefore we can refer to the ‘window’ object with ‘this’ and get all the properties and methods that the ‘window’ object holds.&lt;/p&gt;

&lt;p&gt;Let's take another example. Do you know the alert() function? It’s a method of the window object. Run the following code;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.alert('hello');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is equivalent to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.alert('hello');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also create your methods and properties in the ‘window’ object. Create variables or functions without using the variable declaration keyword to make global variables and methods.&lt;/p&gt;

&lt;p&gt;However, when you are in the ‘strict mode’, ‘this’ will result in ‘undefined’ if not bound explicitly. This is used to detect potential bugs and encourage developers to be more explicit about their code’s behavior. &lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding ‘this’ in regular function
&lt;/h2&gt;

&lt;p&gt;A regular function is a function that is defined using the function keyword followed by the function name, list of parameters separated by commas and enclosed in parenthesis with the code that defines the function enclosed inside curly braces as shown below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function name(parameter){
  //Your function's code goes here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each function creates its own scope and context. This means it encapsulates variables within its scope and defines its own context through the ‘this’ keyword. The value of the ‘this’ keyword depends on how the function is invoked. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When a regular function is invoked in the global context, ‘this’ refers to the global object which is the window object.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet(){
    console.log(this);
}

greet(); // window {...}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If the function is invoked using the new constructor keyword, a new empty object is created and ‘this’ will refer to that empty object;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Greet(){
    console.log(this);
}

let Hello = new Greet();

Hello //greet{}

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

&lt;/div&gt;



&lt;p&gt;Now let's modify our code;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Greet(){
    let message = 'Hello there';

    console.log(this);
}

let Hello = new Greet();

Hello // Greet{}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are not getting the message variable as a property to the newly created Greet{}  object because the message variable was not declared as a property of ‘this’ object.&lt;/p&gt;

&lt;p&gt;Let’s add the message variable to the ‘this’ object;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Greet(){
    this.message = 'Hello there';

    console.log(this);
}

let Hello = new Greet();

Hello // Greet {message: 'Hello there'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also use the bind() method to set the context for our&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function;
//create the function
function person(){
    console.log(this.name);
}

// use bind to set context
var obj = {
    name: 'John Smith',
}
var newPerson = person.bind(obj)

// bind() method returns a new function with the context set to obj

newPerson(); // John Smith
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence with regular functions, you can either use the new constructor keyword or the bind method to set the context of the function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow function and ‘this’ object
&lt;/h2&gt;

&lt;p&gt;Arrow functions in JavaScript do not have their own ‘this’ context. Instead, they inherit the 'this’ value from the enclosing lexical or outer context. This behavior can sometimes be an advantage, especially in scenarios where you want to maintain the context of ‘this’  within nested functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Consider the code below;
const obj = {
    name: "John Smith",
    greet: function() {
      console.log(`Hello, my name is ${this.name}`);
    },
    greetArrow: () =&amp;gt; {
      console.log(`Hello, my name is ${this.name}`); // 'this' here refers to the outer context
    }
  };

  obj.greet(); // Output: Hello, my name is John
  obj.greetArrow(); // Output: Hello, my name is undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The name value is undefined because there is no name property for the global context. To correct this, we add the name to the outer scope;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.name = 'John Doe' //name property in the outer context

const obj = {
    name: "John Smith",
    greet: function() {
      console.log(`Hello, my name is ${this.name}`);
    },
    greetArrow: () =&amp;gt; {
      console.log(`Hello, my name is ${this.name}`); // 'this' here refers to the outer context
    }
  };

  obj.greet(); // Output: Hello, my name is John
  obj.greetArrow(); // Output: Hello, my name is John Doe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, using ‘this’ in the arrow function can be a pitfall if you rely on dynamic ‘this’ binding, especially in event handlers or prototype methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  ‘this’ in Class context
&lt;/h2&gt;

&lt;p&gt;Classes are blueprints or templates for creating objects. you specify the properties (data) and methods (behavior) that each object created from the class will have. If you need a new object, you just create it using the new constructor keyword. &lt;/p&gt;

&lt;p&gt;The ‘this’ keyword behaves differently in class contexts such as;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When used inside the constructor method, ‘this’ refers to the newly created instance of the class. It allows you to set properties on the object during initialization.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person{

    constructor(name){
        this.name = name;
    }

}

let sarah = new Person('Sarah');

console.log(sarah.name) // Sarah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Functions in a class are called methods. When methods are invoked, the ‘this’ references the new instance of the class on which the method is called. It allows methods to access and manipulate the properties of the object.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person{

    constructor(name){
        this.name = name;
    }

    greet(){
        return `Hi, they call me ${this.name}`;
    }

}

let sarah = new Person('Sarah');

console.log(sarah.greet()) // Hi, they call me Sarah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;When a static method is called, it is invoked directly on the class itself, rather than on an instance of the class. Therefore, ‘this’ within a static method does not refer to an instance of the class; instead, it refers to the class itself.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person{

    static introduce(){
        return `Welcome to Person class`;
    }

}

console.log(Person.introduce());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;In summary, ‘this’ allows you to dynamically refer to different objects depending on how functions are called or where they are defined, providing flexibility and context-aware behaviour in your code.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>JavaScript Functions Made Easy: Streamlining Code for Beginners!</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Sat, 03 Feb 2024 21:19:40 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/javascript-functions-made-easy-streamlining-code-for-beginners-pk</link>
      <guid>https://dev.to/anwar_sadat/javascript-functions-made-easy-streamlining-code-for-beginners-pk</guid>
      <description>&lt;p&gt;In the web development world, JavaScript functions are like handy tools that help you simplify and organize your code.&lt;/p&gt;

&lt;p&gt;Let's say you're building a website and need to calculate the total price of items in a shopping cart. With JavaScript functions, you can create a set of instructions for this task, like a recipe.&lt;/p&gt;

&lt;p&gt;To make a function, you use the function keyword, give it a name like &lt;code&gt;calculateTotalPrice&lt;/code&gt;, and describe the task inside curly braces.&lt;/p&gt;

&lt;p&gt;Once your function is ready, you can use it anytime by calling it with a simple command, like this: &lt;code&gt;calculateTotalPrice()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Functions can also take inputs, called parameters. For our shopping cart, you might pass in item prices: &lt;code&gt;calculateTotalPrice(item1Price, item2Price)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The real magic happens when the function processes these inputs and gives you a result, known as the return value. In our case, it could be the total price of the items:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function calculateTotalPrice(item1Price, item2Price){
  return totalPrice = item1Price + item2Price;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make your functions even more useful, you can store their results in variables. For example, let totalPrice = calculateTotalPrice(item1Price, item2Price).&lt;/p&gt;

&lt;p&gt;JavaScript functions keep your code clean and save you from repeating the same steps. Imagine updating tax calculations – with functions, you only need to do it in one place!&lt;/p&gt;

&lt;p&gt;As you explore JavaScript, you'll find built-in functions like &lt;code&gt;alert()&lt;/code&gt; or &lt;code&gt;console.log()&lt;/code&gt; that make common tasks easier. You can also create quick functions using arrow notation.&lt;/p&gt;

&lt;p&gt;In short, JavaScript functions are like coding helpers. They make complex tasks simple, keep your code neat, and work wonders for your web projects. Whether you're new to coding or a pro, understanding functions is a game-changer in JavaScript!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>functions</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Advantages and Disadvantages of Cloud ERP.</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Thu, 24 Aug 2023 22:45:56 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/cloud-computing-for-enterprise-resource-planning-erp-59j1</link>
      <guid>https://dev.to/anwar_sadat/cloud-computing-for-enterprise-resource-planning-erp-59j1</guid>
      <description>&lt;p&gt;Cloud Computing Enterprise Resource Planning (ERP), is a business management software system used by organizations to manage their core business operations including human resources, finance, accounting, supply chain, sales, etc., hosted on a cloud computing platform. It is powered by high-speed internet hosted by the providers of the system. With access to the internet, clients can access their data from any location with a digital device and a browser to log in to the system. &lt;/p&gt;

&lt;p&gt;Cloud ERP also integrates artificial intelligence and other technological tools to generate predictive insights from real-time data. Most organizations have turned to using Cloud ERP because of its advantages which include;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Accessibility and Availability: With an internet connection, the software can be accessed from any location. Teams that are not physically located in close proximity can collaborate seamlessly using the Cloud ERP. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: As organizations grow, so will their demand for resources increase. Cloud ERP is designed to effortlessly scale up or down to accommodate the business size, requirements, and demands, ensuring optimum resource utilization.&lt;br&gt;
Cost Efficient: Organizations do not have to spend huge sums of money to set up their own infrastructure. The initial cost of Cloud ERP is a fraction of how much a company will need to build its own servers. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatic updates: Vendors of Cloud ERP regularly update their systems. This includes updating a feature in the software or uploading a patch to enhance security.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With all the above benefits and more, Cloud ERP has its own disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Data Security: As organizations are using Cloud ERP, their data is stored on the vendors’ storage. Data stored can include the client’s credit card details or health records. This raises concerns regarding who has access to the data and who owns the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reliance on Internet Connectivity: To log in to the Cloud ERP, organizations need a stable internet connection. An unstable internet connection will hinder business operations, productivity, and access to data. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Customization Constraint: Businesses might have their predefined workflows. This might not be incorporated in the Cloud ERP because the system is built to serve a more general purpose for many organizations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In conclusion, cloud ERP can help organizations efficiently manage their operations online, be available remotely, and scale seamlessly to business needs with initial cost efficiencies. However, potential downsides include internet dependency, data security, and customization limitations. Organizations must consider these factors against their needs before adopting Cloud ERP.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>softwaredevelopment</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>10 Steps to Master JavaScript Array For Beginners</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Wed, 12 Jul 2023 17:51:42 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/10-steps-to-master-javascript-array-for-beginners-pc7</link>
      <guid>https://dev.to/anwar_sadat/10-steps-to-master-javascript-array-for-beginners-pc7</guid>
      <description>&lt;h2&gt;
  
  
  Table of content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;What is an array?&lt;/li&gt;
&lt;li&gt;How to create an array&lt;/li&gt;
&lt;li&gt;Array index&lt;/li&gt;
&lt;li&gt;Array properties&lt;/li&gt;
&lt;li&gt;Unshift element to array&lt;/li&gt;
&lt;li&gt;Shift an element to an array&lt;/li&gt;
&lt;li&gt;Push an element to an array&lt;/li&gt;
&lt;li&gt;Pop an element out of an array&lt;/li&gt;
&lt;li&gt;Element inclusion in an array&lt;/li&gt;
&lt;li&gt;Find an element by index&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;As a programmer, you will always work with data. With small projects such as &lt;code&gt;hello word&lt;/code&gt; and &lt;code&gt;adding two numbers&lt;/code&gt;, you can use primitive variables. But to store the details of an object, like a student, with the first name, last name, address, age, gender, etc, you will need a data structure, and that is where array comes in.&lt;/p&gt;

&lt;p&gt;To follow along, you must have basic knowledge of variable and function. Read my previous post on &lt;a href="https://dev.to/momokid/variables-in-programming-17ge"&gt;variable&lt;/a&gt; and &lt;a href="https://dev.to/momokid/functions-are-dry-25nd"&gt;function&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  1. What is an array &lt;a&gt;&lt;/a&gt;?
&lt;/h3&gt;

&lt;p&gt;As defined by &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="noopener noreferrer"&gt;mdn&lt;/a&gt;;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Array object, as with arrays in other programming languages, enables storing a collection of multiple items under a single variable name and has members for performing common array operations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, let's break this down.&lt;/p&gt;

&lt;p&gt;When collecting related data, you do not need to create multiple variables but rather you need an array to store those data as shown below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Using variables to store a student's info
let studentFirstName = "John";
let studentSecondName = "Smith";
let studentAddress="123 Central Park Square, NY";
let studentAge = 18;
let studentGender = "Male";

// Using an array to store a student's info
const studentProfile = ["John","Smith","123 New Address",18,"Male"];

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

&lt;/div&gt;



&lt;p&gt;From the above code, we used 5 variables for each data about the student while with the array, we only used the &lt;em&gt;studentProfile&lt;/em&gt; array.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How to create an array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;It is a common practice to use the &lt;code&gt;const&lt;/code&gt; keyword to create an array followed by the name of the array, equal sign, and open and close square brackets as below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//create an array of 3 books
const books = ['Eloquent Javascript','Head First Javascript Programming','Who Moved My Cheese'];

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

&lt;/div&gt;



&lt;p&gt;The elements in an array are separated by a comma. When an element of an array is a string, it is either in single quotes or double quotes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const&lt;/code&gt; variable does not allow changes to the variable but with &lt;code&gt;const&lt;/code&gt; array, there are methods that you can use to edit the array.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Array index &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Before we discuss array methods, let's take a look at the array index.&lt;/p&gt;

&lt;p&gt;Elements in arrays are stored in a contiguous and sequential order and the elements &lt;strong&gt;&lt;em&gt;do not have to be of the same type&lt;/em&gt;&lt;/strong&gt;. Let's take for example the &lt;code&gt;books&lt;/code&gt; array as illustrated below;&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%2Fhql7gntqhb83cyg29sbs.jpg" 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%2Fhql7gntqhb83cyg29sbs.jpg" alt="Array elements" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first element is the &lt;em&gt;Eloquent Javascript&lt;/em&gt;, the second element is &lt;em&gt;Head First Javascript&lt;/em&gt; and the third element &lt;em&gt;Who Moved My Cheese&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Array index is a non-negative integer that is used to access elements in an array. Generally, array index starts at zero (0). Yes, you read it right, &lt;strong&gt;zero (0)&lt;/strong&gt;. It means the position of the first element in an array is at index &lt;code&gt;0&lt;/code&gt; hence referred to as &lt;code&gt;zero-indexed&lt;/code&gt; as illustrated below;&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%2Fofnezoaltmt6sl4l91vl.jpg" 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%2Fofnezoaltmt6sl4l91vl.jpg" alt="Array index" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first element, &lt;em&gt;Eloquent Javascript&lt;/em&gt; is at index &lt;code&gt;0&lt;/code&gt;, the second element, &lt;em&gt;Head First Javascript&lt;/em&gt; is at index &lt;code&gt;1&lt;/code&gt; and the third element is at index &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The index of an element in array  = position - 1.  e.g. our &lt;em&gt;third _element has an index of &lt;code&gt;2&lt;/code&gt;. The highest index in an array = array length minus 1. Our &lt;code&gt;books&lt;/code&gt; array has length of &lt;code&gt;3&lt;/code&gt; and the last element i.e. _Who Moved My Cheese&lt;/em&gt; has an index of &lt;code&gt;2&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Just for this article, we will use the index to access the elements of our arrays as shown below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array[index];

//to display the first element in the books array
console.log(books[0]) //output: 'Head First Javascript'

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Array properties &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Every variable type comes with it's own properties in Javascript. A string variable has &lt;code&gt;toLowerCase()&lt;/code&gt;, &lt;code&gt;toUpperCase()&lt;/code&gt;, &lt;code&gt;length&lt;/code&gt;, etc. properties while a number variable has the &lt;code&gt;toString()&lt;/code&gt;, &lt;code&gt;toFixed()&lt;/code&gt;, &lt;code&gt;toPrecision&lt;/code&gt;, etc. properties.&lt;/p&gt;

&lt;p&gt;Javascript arrays have the ;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;length&lt;/code&gt; property which returns the number of elements in an array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;constructor&lt;/code&gt; property returns the constructor function that created the array object.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;prototype&lt;/code&gt;  property allows for adding user-defined properties and methods.&lt;br&gt;
&lt;em&gt;Note that for the purpose of this article, we will discuss the &lt;code&gt;length&lt;/code&gt; property.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using our &lt;code&gt;books&lt;/code&gt; array, we can get the size of the elements of the array by the following code;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(books.length) //output: 3

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

&lt;/div&gt;



&lt;p&gt;Assuming we want to check if a user has read 3 books, we write our code as;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//check if books read is less than 3
if(books.length &amp;lt; 3){
  console.log('You need to read 3 books')
}else{
  console.log('Congratulations')
} 

//output: 'Congratulations'

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

&lt;/div&gt;



&lt;p&gt;The output will be congratulations since the number of elements in the array is &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Unshift element to an array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;To add an element to the existing elements in our &lt;code&gt;books&lt;/code&gt; array, we use the &lt;code&gt;Array.prototype.unshift()&lt;/code&gt;. The &lt;code&gt;unshift()&lt;/code&gt; method takes a value an insert it at the beginning of the array and returns the new array.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;books&lt;/code&gt; array currently looks 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%2F3arwtfh0hi4pxkpz17gy.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%2F3arwtfh0hi4pxkpz17gy.png" alt="before array.push method" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's add a new book to the &lt;code&gt;books&lt;/code&gt; array;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//add a new book to the front of books array
books.unshift('Responsive Javascript')

//display all books

console.log(books) //output: Array(4) [ 'Responsive Javascript', 'Eloquent Javascript','Head First Javascript Programming','Who Moved My Cheese' ];

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;books&lt;/code&gt; array will now looks 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%2Fk7z1pwf3mt89jauolr9b.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%2Fk7z1pwf3mt89jauolr9b.png" alt="after prepending array" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you prepend an element, the positions/indices of all the existing elements will increase by 1.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Shift an element to an array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;To remove the first element which is at index &lt;code&gt;0&lt;/code&gt; in an array, we use the &lt;code&gt;Array.prototype.shift()&lt;/code&gt; method. The &lt;code&gt;shift()&lt;/code&gt; method will remove the first element and return the removed element.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;books&lt;/code&gt; array looks 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%2Fxmxby14664qxil25b58t.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%2Fxmxby14664qxil25b58t.png" alt="before unshift array" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's write the code to remove the last book in the &lt;code&gt;books&lt;/code&gt; array;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//remove the 'Responsive Javascript' book
books.shift()

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;books&lt;/code&gt; array will now look 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%2Flx3m0hpjbnf3ie1p2yvh.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%2Flx3m0hpjbnf3ie1p2yvh.png" alt="after array shift" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Push an element to an array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Just as we added an element at the beginning, we can also add an element at the end of the array. The &lt;code&gt;Array.prototype.push()&lt;/code&gt; method adds an element to the tail of an array and returns the length of the array.&lt;/p&gt;

&lt;p&gt;Let's &lt;code&gt;push()&lt;/code&gt; a new book, &lt;em&gt;Out Of The Maze&lt;/em&gt; , to our &lt;code&gt;books&lt;/code&gt; array;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//add element to the end of an array
books.push('Out Of The Maze')

console.log(books) //output: Array(4) ['Eloquent Javascript','Head First Javascript Programming','Who Moved My Cheese','Out Of The Maze'];

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

&lt;/div&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%2Fh8s5ey8g05gqa2kjtgiw.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%2Fh8s5ey8g05gqa2kjtgiw.png" alt="Before array.push()" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Pop an element out of array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;Array.prototype.pop()&lt;/code&gt; removes an element at the end of an array and returns the element. This operation does not affect the index of the existing elements.&lt;/p&gt;

&lt;p&gt;Let's remove the book we previously added to the &lt;code&gt;books&lt;/code&gt; array;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//show all books 
console.log(books) // output: Array(4) ['Eloquent Javascript','Head First Javascript Programming','Who Moved My Cheese','Out Of The Maze'];

//remove 'Out Of The Maze' from books
books.pop();

//show all books after the pop() method
console.log(books) //output: Array(4) ['Eloquent Javascript','Head First Javascript Programming','Who Moved My Cheese'];

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

&lt;/div&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%2Fbft0tjmoph5gg6jwo2i9.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%2Fbft0tjmoph5gg6jwo2i9.png" alt="array.pop books" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Element inclusion in an array &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Imagine having a dictionary app that you can search for a word without flipping through pages like the "paper" dictionary. Having the search feature makes life easy for your users. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Array.prototype.includes()&lt;/code&gt; feature offers the opportunity to implement a "search" feature in your app by passing the search keyword as a parameter to the  &lt;code&gt;includes()&lt;/code&gt;. The method returns &lt;code&gt;true&lt;/code&gt; if the keyword, which uses &lt;em&gt;strict equality (===)&lt;/em&gt;, exists in the array. &lt;/p&gt;

&lt;p&gt;Let's write code to experiment with the "search feature";&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//
let searchKeyword = 'Who Moved My Cheese';

//check if keyword includes in books array
let result = books.includes(searchKeyword);

if(result){
  console.log(`${searchKeyword} exists in book collection`)
}else{
   console.warn('Book does not exists');
}

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  10. Find an element by index &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Elements in an array can be located by their indices by using the &lt;code&gt;Array.prototype.at()&lt;/code&gt; method which takes an integer value and returns the element at that index. It allows for both positive and negative integers. When using negative integers, counting start from the last element in the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// get the book at index 2

console.log(books.at(2)); //output: "Head First Javascript Programming"

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

&lt;/div&gt;



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

&lt;p&gt;There are dozens of array methods in Javascript you can use to manipulate elements in an array, Arrays are used in a lot of areas in software development especially fetching data from an API or database. Go ahead and read more on &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="noopener noreferrer"&gt;Arrays at mdn&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Thank you for your time. See you on the next one.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Mozilla Open Source Project: 10 Things I Learnt.</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Tue, 25 Apr 2023 20:54:21 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/mozilla-open-source-project-10-things-i-learnt-b68</link>
      <guid>https://dev.to/anwar_sadat/mozilla-open-source-project-10-things-i-learnt-b68</guid>
      <description>&lt;p&gt;About a month ago, I signed up for &lt;a href="https://www.outreachy.org" rel="noopener noreferrer"&gt;Outreachy Internship Program&lt;/a&gt; where I got the chance to contribute to one of the Mozilla projects called &lt;a href="https://www.mozilla.org/en-US/firefox/114.0a1/releasenotes/" rel="noopener noreferrer"&gt;Firefox Desktop Nightly&lt;/a&gt; and I learned a lot of things but here are just 10 of them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Introduce yourself in the &lt;code&gt;introduction room&lt;/code&gt;. Let other members and mentors know you're new to contributing to the Mozilla project. Mentors will guide you on how to get the setup on your local machine and get to work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As a beginner, look for &lt;code&gt;good-first-bug&lt;/code&gt; to start working on. Most of these issues come with instructions on how to solve them. Also, pay attention to any previous comments/discussions to get an understanding of what others have done. If you are still stuck, post your question on the &lt;code&gt;introduction&lt;/code&gt; platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always post your questions to the platform. Do not DM questions to mentors unless agreed by the mentor. Posting questions on the platform may help others to learn from it and mentors do not have to repeat themselves when newcomers join.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you have started a thread with one mentor, make sure you stick with that mentor. Do not go asking other mentors about the same issue unless they offer to help. Mentors may refer others to also help.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can DM mentors but make sure to ask if they are comfortable. Mentors do not have much time on their hands considering the number of mentees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you need help, look for the appropriate platform and post your question. Remember, there are many of these projects that are been worked on so taking your issues about setup to where they are discussing the new features, you might not get much help. You will probably be redirected to the appropriate platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not be rude. You are not only learning to better at coding but also communication skills. If you feel intimated or hurt by someone else's comment/reply, step away from your computer and take some fresh air. Possibly another mentor/colleague will step in to guide you better.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If new members ask a question and you have an idea, you should offer to help them because doing so will help to recap what you have learned and build your confidence too.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is very much OK if at a point you feel lost. Do not hold back from seeking help. I recommend that first, you do a little research and if it does not help, you can ask for assistance. But be polite when asking your questions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lastly, have an open mind. Do not go into any project thinking you know it all and want to show off. If you know something, help others who do not know. And be ready to learn new things and you will be fine.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lastly and most importantly, always read the contribution guidelines.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Functions are DRY</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Fri, 31 Mar 2023 22:29:55 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/functions-are-dry-25nd</link>
      <guid>https://dev.to/anwar_sadat/functions-are-dry-25nd</guid>
      <description>&lt;p&gt;When I started learning to code, one of the concepts that really kept me in the dark was Function. I struggled to understand what function is, its uses or applications, and why you'll even need one in the first place. I was comfortable using variables and loops to build my TO-DO apps. But of course, I was using functions in my code UNKNOWINGLY (I mean most of us did right ☺?).&lt;/p&gt;

&lt;p&gt;NB// In this tutorial, I used JavaScript to reference concepts and code samples.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;What is a function?&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;According to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Function is a set of statements that performs a task or calculates a value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let's examine the problem&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Programming is about writing instructions for the computer to execute. Consider the code below which prints the first, middle, and last names to the console;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let firstName="Anwar", 
    middleName="Sadat", 
    lastName = "Ayub"; 

console.log(firstName, '', middleName, '', lastName)

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

&lt;/div&gt;



&lt;p&gt;Our code will be executed from top to bottom so all 3 variables will be created before printing their values to the console. Writing this code is much simpler and straightforward without errors. &lt;br&gt;
But what if we want to print 3 people's details i.e. their first, middle, and last names? It means we have to repeat our code 3 times as;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// First person's details
let firstName1 = 'Anwar',
  middleName1 = 'S.',
  lastName1 = 'Ayub'

console.log(firstName1, '', middleName1, '', lastName1)

//Second person's details
let firstName2 = 'John',
  middleName2 = 'C.',
  lastName2 = 'Smith'

console.log(firstName2, '', middleName2, '', lastName2)

//Third person's details
let firstName3 = 'Lara',
  middleName3 = 'W.',
  lastName3 = 'Croft'

console.log(firstName3, '', middleName1, '', lastName3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For such a task, it is common to just copy and paste the previous code, change the variable names, and assign new values to them as we did above which is fine for a beginner but the associated problem is that;&lt;/p&gt;

&lt;p&gt;First, our code is prone to errors. If you had noticed (or maybe not), you'd see that we forgot to change the  &lt;code&gt;middleName&lt;/code&gt; for the third console so the output will be&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Lara Sadat Croft&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;instead of&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Lara W. Croft&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now we are just starting out and already there is a  bug in our code. &lt;/p&gt;

&lt;p&gt;Second, copying/pasting our code 2 times will not be much work but imagine if you are tasked to print 20 people's details. That means copying and pasting our code 19 times and renaming the three variables 19 times. That's could be a lot of work which we can hardly keep up. &lt;/p&gt;

&lt;p&gt;Third, your code base will be difficult to maintain. Let's assume you managed to copy/paste 19 times and moments later, you're tasked to print only the &lt;code&gt;firstName&lt;/code&gt;s and &lt;code&gt;lastName&lt;/code&gt;s or print out everyone's &lt;strong&gt;Address&lt;/strong&gt; and &lt;strong&gt;Telephone&lt;/strong&gt;. That's a lot of work.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Our DRY Solution&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By using a function, we can easily manage our code base relatively easier. Remember we said that a &lt;em&gt;function is a set of statements that performs a task&lt;/em&gt; . So in short, we put all our code together as unit &lt;em&gt;i.e. the 3 variables and the console.log()&lt;/em&gt;, and make them run as one statement.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Parts of function&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A function basically has;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;name,&lt;/li&gt;
&lt;li&gt;parameter,&lt;/li&gt;
&lt;li&gt;statements that define the function, which I called &lt;em&gt;body&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can also talk about the function scope, return values, etc. but that would be for another article.&lt;/p&gt;

&lt;p&gt;For us to use a function in our code, we first declare the function, a similar concept to declaring a variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function functionName (parameter){
    //statements of the function
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;em&gt;functionName&lt;/em&gt; is the name of the function when it was created. The name should be descriptive enough to identify what the function does. It is also case-sensitive. &lt;br&gt;
Aside named function, there is also an anonymous function that does not have a name but that will be discussed in a separate article.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;parameter&lt;/em&gt; represents the named variables you use to pass values to the function i.e. the &lt;em&gt;firstName&lt;/em&gt; , &lt;em&gt;middleName&lt;/em&gt; , and &lt;em&gt;lastName&lt;/em&gt; . &lt;/p&gt;

&lt;p&gt;Let's create a function called &lt;em&gt;printPersonalDetails&lt;/em&gt; to display details of a person in the console;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function printPersonalDetails(firstName, middleName, lastName){

      console.log(firstName, '', middleName, '', lastName)

}

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

&lt;/div&gt;



&lt;p&gt;Next thing to do is to_invoke_ or &lt;em&gt;call&lt;/em&gt; the function. Each time we create a function, we have to call the function for it to be executed. So to call our function &lt;em&gt;printPersonalDetails&lt;/em&gt;;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;printPersonalDetails();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But don't forget that our function takes in 3 parameters i.e. &lt;em&gt;firstName&lt;/em&gt; , &lt;em&gt;middleName&lt;/em&gt; and &lt;em&gt;lastName&lt;/em&gt;. &lt;br&gt;
Let's update our function call;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;printPersonalDetails('Anwar','Sadat','Ayub')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we did was assign values to the named variable we created in our function definition.  &lt;em&gt;Argument&lt;/em&gt; is the real value passed to the function. In calling our function, we passed &lt;strong&gt;arguments&lt;/strong&gt; in place of &lt;strong&gt;parameters&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;So if we want to print 3, we just;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;printPersonalDetails('Anwar','Sadat','Ayub')

printPersonalDetails('John','C.','Smith')

printPersonalDetails('Lara','W.','Croft')

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

&lt;/div&gt;



&lt;p&gt;Now our code is cleaner and we can make changes relatively easier. Remember how we had to repeatedly copy/paste our four lines of code, and edit them before printing to the console? With function, we do not have to repeat our codes. &lt;br&gt;
We used the DRY (&lt;strong&gt;D&lt;/strong&gt;on't &lt;strong&gt;R&lt;/strong&gt;epeat &lt;strong&gt;Y&lt;/strong&gt;ourself) principle, where we do not have to recreate variables, change their names and assign them with new values but rather use function to make your code cleaner and maintainable.&lt;/p&gt;

&lt;p&gt;I know it's been a long article but thank you for taking the time to read through it. I would love to hear your thoughts.&lt;/p&gt;

&lt;p&gt;See you on the next one.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Animate Loading Indicator on Button With Vanilla Javascript</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Thu, 25 Aug 2022 22:19:58 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/animate-loading-indicator-on-button-with-vanilla-javascript-2k95</link>
      <guid>https://dev.to/anwar_sadat/animate-loading-indicator-on-button-with-vanilla-javascript-2k95</guid>
      <description>&lt;p&gt;Hi there 🙋🏾‍♂️,&lt;/p&gt;

&lt;p&gt;In today's post, we are making a loading indicator on a submit button. This is a common feature nowadays to display/hide spinner on a button while application is in a busy state. I did this at a very basic level i.e. without any complicated code. There are several ways to do this. Please do not hesitate to share them with us 😊.&lt;/p&gt;

&lt;p&gt;Basic skills in HTML, CSS and Javascript will be just fine to follow this post.&lt;/p&gt;

&lt;p&gt;To the coding part, we will only need 3 files;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;style.css&lt;/li&gt;
&lt;li&gt;main.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start by creating an html boiler plate:&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;index.html&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Loading Indicator&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we bring in our css and javascript files into the index.html;&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;index.html&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;link rel="stylesheet" href="style.css" /&amp;gt;
    &amp;lt;script src="main.js" defer&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get a feel of submitting a data, we will create a dummy form and add two input elements and a submit button even though we will not submit any data.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;index.html&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;form class="sampleForm"&amp;gt;
      &amp;lt;h1&amp;gt;Login form&amp;lt;/h1&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;input type="text" placeholder="Enter email" /&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;input type="password" placeholder="Enter password" /&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;button id="btnSubmit"&amp;gt;
        &amp;lt;span id="btnSubmitText"&amp;gt;Submit&amp;lt;/span&amp;gt;
      &amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the code we just added, we have a;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;form with an id of &lt;strong&gt;sampleForm&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;2 input elements ( a text and a password type both with placeholders)&lt;/li&gt;
&lt;li&gt;a submit button with a child span element with an id of &lt;strong&gt;btnSubmitText&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this point we will use &lt;a href="https://fontawesome.com" rel="noopener noreferrer"&gt;fontawesome&lt;/a&gt;'s spinner icon. We include the cdn but you can also download the kit and set it up manually if you are familiar with the process.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;index.html&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- Fontawesome cdn --&amp;gt;
    &amp;lt;link
      rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
   integrity="sha512-1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSLy85pkm9GaYVYMfw5BC1A=="
      crossorigin="anonymous"
      referrerpolicy="no-referrer"
    /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will now add two child elements in the buttom: the fontawesome's spinner icon and span element as below;&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;index.html&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button id="btnSubmit"&amp;gt;
  &amp;lt;span id="btnSubmitText"&amp;gt;Submit&amp;lt;/span&amp;gt;
  &amp;lt;i class="fa-solid fa-spinner fa-spin"&amp;gt;&amp;lt;/i&amp;gt;
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;fa-spinner&lt;/strong&gt; class adds the spinner icon and to animate the icon, we add &lt;strong&gt;fa-spin&lt;/strong&gt; class. There are other animations like &lt;strong&gt;beat, fade, bounce, shake,&lt;/strong&gt; etc, all at &lt;a href="https://fontawesome.com/docs/web/style/animate" rel="noopener noreferrer"&gt;fontawesome animation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Next we add some styles to our form.&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;style.css&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.sampleForm {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
input {
  padding: 10px;
  margin: 5px;
  width: 250px;
}
button {
  background-color: orange;
  color: white;
  border: none;
  font-size: 20px;
  padding: 10px;
  width: 150px;
  height: 50px;
  cursor: pointer;
}
.fa-spinner {
  display: none;
}

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

&lt;/div&gt;



&lt;p&gt;The button has a fixed width and height. This is to maintain the same button size when we toggle the icon and text. Initially we are hiding the icon and showing the text on the button. When we click on the button, the text will be set to &lt;code&gt;display:none&lt;/code&gt; and the icon will be set &lt;code&gt;display:block&lt;/code&gt;. Let's do that right now.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;main.js&lt;/code&gt; file, add the following code&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;main.js&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const btnSubmit = document.getElementById('btnSubmit')

btnSubmit.addEventListener('click', (event) =&amp;gt; {
  event.preventDefault()

})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So we grab the submit button and assign it to &lt;code&gt;btnSubmit&lt;/code&gt; then listen to the &lt;code&gt;click&lt;/code&gt; event on the submit button. By default, a submit form button causes a web page to refresh each time it is clicked. To prevent that, we pass the &lt;code&gt;event&lt;/code&gt; argument to the callback function and called the &lt;code&gt;preventDefault()&lt;/code&gt; function of the &lt;code&gt;event&lt;/code&gt; object. &lt;/p&gt;

&lt;p&gt;Now when the button is clicked, we want to hide the text (which is currently displayed) and display the spin icon (which is currently hidden). Let's write that code&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;main.js&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  //Hide the text
  document.getElementById('btnSubmitText').style.display = 'none'

  //Display the spin icon
  document.querySelector('.fa-spinner').style.display = 'block'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our code targets the span element that contains the text by id and assign the display property of it's style object to &lt;code&gt;none&lt;/code&gt; which causes it to hide. On the hand, the icon is now displayed by setting it display property to &lt;code&gt;block&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At this point, when we click the submit button, the submit text will hide and the spin icon will display.&lt;/p&gt;

&lt;p&gt;Phewwwww...now that was a lot and you deserve the applause 🎉🙌🏽🍾🥳🥳🎉🎉🙌🏽&lt;br&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%2Fdhuf51q7pxirzm8z3dg0.gif" 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%2Fdhuf51q7pxirzm8z3dg0.gif" alt="Image description" width="220" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But we are not quite done yet. Our spin icon keeps spinning until we refresh the page and obviously we don't want that. &lt;br&gt;
Normally when we send a form request, we expect a response and after the response, our button text should display and spin icon hidden. &lt;/p&gt;

&lt;p&gt;To do that, we just do reverse of our code as below;&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;main.js&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  document.getElementById('btnSubmitText').style.display = 'block'
  document.querySelector('.fa-spinner').style.display = 'none'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now after adding this code, it happens so fast that we don't see the spin icon right? We can fake a request/response by adding a delay of 2 seconds using the &lt;code&gt;setTimeout&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;Our &lt;code&gt;main.js&lt;/code&gt; file will now look like this;&lt;/p&gt;

&lt;h6&gt;
  
  
  &lt;em&gt;main.js&lt;/em&gt;
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const btnSubmit = document.getElementById('btnSubmit')

btnSubmit.addEventListener('click', (event) =&amp;gt; {
  event.preventDefault()

  //Hide the text
  document.getElementById('btnSubmitText').style.display = 'none'

  //Display the spin icon
  document.querySelector('.fa-spinner').style.display = 'block'

  //2 seconds delay
  setTimeout(() =&amp;gt; {
    //Show the text after 2 seconds
    document.getElementById('btnSubmitText').style.display = 'block'

    //Hide the spin icon after 2 seconds
    document.querySelector('.fa-spinner').style.display = 'none'
  }, 2000)
})

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

&lt;/div&gt;



&lt;p&gt;As I mentioned earlier, this is just for basic level coding but you can definitely make this code better. Think of how you can make it reusable by introducing functions in the code.&lt;/p&gt;

&lt;p&gt;You can download the files from my &lt;a href="https://github.com/momokid/loading_indicator" rel="noopener noreferrer"&gt;github repo&lt;/a&gt;. Please don't forget to leave a like 👍🏼.&lt;/p&gt;

&lt;p&gt;Thanks for spending time to read and see you on the next one.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>nextjs dev server</title>
      <dc:creator>Anwar Sadat Ayub</dc:creator>
      <pubDate>Tue, 26 Jul 2022 22:30:04 +0000</pubDate>
      <link>https://dev.to/anwar_sadat/nextjs-dev-server-14na</link>
      <guid>https://dev.to/anwar_sadat/nextjs-dev-server-14na</guid>
      <description>&lt;p&gt;Why does &lt;code&gt;npm rum dev&lt;/code&gt; works?&lt;br&gt;
The emphasis is on the &lt;strong&gt;m&lt;/strong&gt; in&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I tried it multiple times and there's no error&lt;/p&gt;

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