<?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: BrendahKiragu</title>
    <description>The latest articles on DEV Community by BrendahKiragu (@brendahkiragu).</description>
    <link>https://dev.to/brendahkiragu</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%2F1954373%2Ff668d213-2eaa-4b4d-9a99-2d5dba4e3b4a.jpg</url>
      <title>DEV Community: BrendahKiragu</title>
      <link>https://dev.to/brendahkiragu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brendahkiragu"/>
    <language>en</language>
    <item>
      <title>MySQL WorkBench: Create, alter &amp; Drop</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Sat, 08 Mar 2025 19:10:46 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/mysql-workbench-create-alter-drop-2gm8</link>
      <guid>https://dev.to/brendahkiragu/mysql-workbench-create-alter-drop-2gm8</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Task 1: Connect to the MySQL Workspace&lt;/li&gt;
&lt;li&gt;
Task 2: Create a Database and a Table

&lt;ul&gt;
&lt;li&gt;Step 1: Check Available Databases&lt;/li&gt;
&lt;li&gt;Step 2: Create a New Database&lt;/li&gt;
&lt;li&gt;Step 3: Create a Table&lt;/li&gt;
&lt;li&gt;Step 4: Verify Table Creation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Task 3: Modify a Table&lt;/li&gt;
&lt;li&gt;
Task 4: Delete a Table and Database

&lt;ul&gt;
&lt;li&gt;Step 1: Drop a Table&lt;/li&gt;
&lt;li&gt;Step 2: Verify Table Deletion&lt;/li&gt;
&lt;li&gt;Step 3: Drop the Database&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Managing relational databases effectively requires an understanding of fundamental operations such as creating, viewing, altering, and deleting databases and tables. This guide walks you through these essential operations using MySQL Workspace.&lt;/p&gt;

&lt;p&gt;By the end of this guide, you will be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create databases and tables using the &lt;code&gt;CREATE&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;View available databases and tables using the &lt;code&gt;SHOW&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Alter the structure of tables using the &lt;code&gt;ALTER&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Delete databases and tables using the &lt;code&gt;DROP&lt;/code&gt; statement.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you begin, ensure that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have MySQL installed on your system.&lt;/li&gt;
&lt;li&gt;MySQL Workbench is installed for database management.&lt;/li&gt;
&lt;li&gt;You have the necessary user privileges to create and modify databases.&lt;/li&gt;
&lt;/ul&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%2Foectqenr94ykk3b9sdze.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%2Foectqenr94ykk3b9sdze.png" alt="MySQL workbench landing page" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Connect to the MySQL Workspace
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;MySQL Workbench&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Database&lt;/strong&gt; in the menu bar and select &lt;strong&gt;Manage Connections&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New&lt;/strong&gt; and enter the following details:

&lt;ul&gt;
&lt;li&gt;Connection Name: &lt;code&gt;World_Workspace&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hostname: &lt;code&gt;localhost&lt;/code&gt; (or your server address)&lt;/li&gt;
&lt;li&gt;Username: &lt;code&gt;root&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&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%2Fr0fsoqlsp277czx9tugj.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%2Fr0fsoqlsp277czx9tugj.png" alt="MySQL new connection window" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Test Connection&lt;/strong&gt; to verify the setup.&lt;/li&gt;
&lt;li&gt;Once the connection is successful, click &lt;strong&gt;OK&lt;/strong&gt; and then &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Task 2: Create a Database and a Table
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Check Available Databases
&lt;/h3&gt;

&lt;p&gt;Run the following query to display all available databases:&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;SHOW&lt;/span&gt; &lt;span class="n"&gt;DATABASES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&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%2Fpjne9f738h697613bgwq.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%2Fpjne9f738h697613bgwq.png" alt="MySQL work" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Create a New Database
&lt;/h3&gt;

&lt;p&gt;To create a database named &lt;code&gt;company&lt;/code&gt;, execute:&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;DATABASE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the creation by running:&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;SHOW&lt;/span&gt; &lt;span class="n"&gt;DATABASES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&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%2Ft830sxehbvpnjxdmz4vi.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%2Ft830sxehbvpnjxdmz4vi.png" alt="available databases" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Create a Table
&lt;/h3&gt;

&lt;p&gt;To store employee data, create a table named &lt;code&gt;employees&lt;/code&gt; with the following structure:&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;TABLE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nv"&gt;`EmployeeID`&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="n"&gt;AUTO_INCREMENT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;`FirstName`&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;`LastName`&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;`Department`&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;`Salary`&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nv"&gt;`HireDate`&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&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%2F20x8d5t1vc3flt2vp6yw.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%2F20x8d5t1vc3flt2vp6yw.png" alt="dashboard showing the command for creating table employees with columns" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Verify Table Creation
&lt;/h3&gt;

&lt;p&gt;To verify that the &lt;code&gt;employees&lt;/code&gt; table was created, specify the database and check its 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="n"&gt;USE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SHOW&lt;/span&gt; &lt;span class="n"&gt;TABLES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&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%2Fujvxyfa5s7dcmq5ecnu6.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%2Fujvxyfa5s7dcmq5ecnu6.png" alt="image showing employees table in the company database" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To list all columns in the &lt;code&gt;employees&lt;/code&gt; table, run:&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;SHOW&lt;/span&gt; &lt;span class="n"&gt;COLUMNS&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;.&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;h2&gt;
  
  
  Task 3: Modify a Table
&lt;/h2&gt;

&lt;p&gt;If you need to add a new column for email addresses, use the &lt;code&gt;ALTER TABLE&lt;/code&gt; statement:&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;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;Email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the change:&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;SHOW&lt;/span&gt; &lt;span class="n"&gt;COLUMNS&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;.&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;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%2Fg1l4vrc63n63bdqte32p.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%2Fg1l4vrc63n63bdqte32p.png" alt="Image showing the added email column" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 4: Delete a Table and Database
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Drop a Table
&lt;/h3&gt;

&lt;p&gt;To delete the &lt;code&gt;employees&lt;/code&gt; 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;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;.&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;
  
  
  Step 2: Verify Table Deletion
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SHOW&lt;/span&gt; &lt;span class="n"&gt;TABLES&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&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%2Fdnmok2zi73v368yj6ety.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%2Fdnmok2zi73v368yj6ety.png" alt="shows the update company database without the deleted employees table" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Drop the Database
&lt;/h3&gt;

&lt;p&gt;To delete the &lt;code&gt;company&lt;/code&gt; database:&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;DROP&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify database deletion:&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;SHOW&lt;/span&gt; &lt;span class="n"&gt;DATABASES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Congratulations! You have successfully performed key database table operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created databases and tables.&lt;/li&gt;
&lt;li&gt;Viewed databases and tables using &lt;code&gt;SHOW&lt;/code&gt; commands.&lt;/li&gt;
&lt;li&gt;Altered a table column using &lt;code&gt;ALTER TABLE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Deleted tables and databases using &lt;code&gt;DROP&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mysql</category>
      <category>sql</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Python Built-In functions simplified</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Mon, 03 Mar 2025 09:44:06 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/python-built-in-functions-simplified-3hha</link>
      <guid>https://dev.to/brendahkiragu/python-built-in-functions-simplified-3hha</guid>
      <description>&lt;p&gt;This year, I'm diving into cloud computing. As a starting point, I enrolled in the AWS re/Start Cloud Foundational Course. I'm currently in week 6 of 12 and tackling the Python module. I created this blog as a quick reference for Python built-in functions with examples. Hope it helps someone else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Type Conversion Functions&lt;/li&gt;
&lt;li&gt;Mathematical Functions&lt;/li&gt;
&lt;li&gt;Iterables and Sequences&lt;/li&gt;
&lt;li&gt;Input and Output&lt;/li&gt;
&lt;li&gt;Object and Type Checking&lt;/li&gt;
&lt;li&gt;Memory and Object Management&lt;/li&gt;
&lt;li&gt;Functional Programming&lt;/li&gt;
&lt;li&gt;Other Useful Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Type Conversion Functions
&lt;/h2&gt;

&lt;p&gt;These functions convert data from one type to another.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num_str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;num_int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Converts string to integer
&lt;/span&gt;&lt;span class="n"&gt;num_float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Converts string to float
&lt;/span&gt;&lt;span class="n"&gt;bool_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Converts integer to boolean (True)
&lt;/span&gt;&lt;span class="n"&gt;list_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Converts string to list of characters
&lt;/span&gt;&lt;span class="n"&gt;tuple_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Converts list to tuple
&lt;/span&gt;&lt;span class="n"&gt;set_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Converts list to set (removes duplicates)
&lt;/span&gt;&lt;span class="n"&gt;dict_val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;([(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;one&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;two&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;  &lt;span class="c1"&gt;# Converts list of tuples to dictionary
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;int(x)&lt;/code&gt;: Converts &lt;code&gt;x&lt;/code&gt; to an integer.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;float(x)&lt;/code&gt;: Converts &lt;code&gt;x&lt;/code&gt; to a floating-point number.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;str(x)&lt;/code&gt;: Converts &lt;code&gt;x&lt;/code&gt; to a string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bool(x)&lt;/code&gt;: Converts &lt;code&gt;x&lt;/code&gt; to a boolean (&lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;list(iterable)&lt;/code&gt;: Converts an iterable to a list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tuple(iterable)&lt;/code&gt;: Converts an iterable to a tuple.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;set(iterable)&lt;/code&gt;: Converts an iterable to a set.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dict(iterable)&lt;/code&gt;: Converts an iterable to a dictionary.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Mathematical Functions
&lt;/h2&gt;

&lt;p&gt;Python offers built-in math functions to perform calculations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 10
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 8 (2^3)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;3.14159&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 3.14
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 3
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 1
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 6
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;divmod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: (3, 1) (quotient and remainder)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;abs(x)&lt;/code&gt;: Returns the absolute value of &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pow(x, y)&lt;/code&gt;: Computes &lt;code&gt;x&lt;/code&gt; raised to the power &lt;code&gt;y&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;round(x, n)&lt;/code&gt;: Rounds &lt;code&gt;x&lt;/code&gt; to &lt;code&gt;n&lt;/code&gt; decimal places.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;max(iterable)&lt;/code&gt;: Returns the largest item in an iterable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;min(iterable)&lt;/code&gt;: Returns the smallest item in an iterable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sum(iterable)&lt;/code&gt;: Returns the sum of all items in an iterable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;divmod(x, y)&lt;/code&gt;: Returns a tuple of quotient and remainder.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Iterables and Sequences
&lt;/h2&gt;

&lt;p&gt;Functions that help manipulate sequences like lists and tuples.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 4
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [4, 3, 2, 1]
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [4, 3, 2, 1]
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [(0, 1), (1, 2), (2, 3), (3, 4)]
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;a&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [(1, 'a'), (2, 'b')]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;len(s)&lt;/code&gt;: Returns the length of &lt;code&gt;s&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sorted(iterable, key=None, reverse=False)&lt;/code&gt;: Returns a sorted list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reversed(iterable)&lt;/code&gt;: Returns a reversed iterator.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;enumerate(iterable, start=0)&lt;/code&gt;: Returns index-value pairs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zip(*iterables)&lt;/code&gt;: Combines multiple iterables into tuples.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Input and Output
&lt;/h2&gt;

&lt;p&gt;Handling user input and displaying output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter your name: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Hello, World!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;print(*objects)&lt;/code&gt;: Prints objects to output.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;input(prompt)&lt;/code&gt;: Gets user input as a string.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;open(file, mode)&lt;/code&gt;: Opens a file for reading or writing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Object and Type Checking
&lt;/h2&gt;

&lt;p&gt;Verify types and attributes of objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: &amp;lt;class 'str'&amp;gt;
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;issubclass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;callable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;type(object)&lt;/code&gt;: Returns the type of an object.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;isinstance(object, classinfo)&lt;/code&gt;: Checks if an object is an instance of a class.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;issubclass(class, classinfo)&lt;/code&gt;: Checks if a class is a subclass of another.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;callable(object)&lt;/code&gt;: Checks if an object is callable (e.g., a function).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Memory and Object Management
&lt;/h2&gt;

&lt;p&gt;Functions for handling object attributes and memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;brand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;brand&lt;/span&gt;

&lt;span class="n"&gt;car&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Toyota&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Toyota
&lt;/span&gt;&lt;span class="nf"&gt;setattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Honda&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;hasattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: True
&lt;/span&gt;&lt;span class="nf"&gt;delattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;hasattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brand&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: False
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;getattr(obj, name)&lt;/code&gt;: Gets an attribute value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;setattr(obj, name, value)&lt;/code&gt;: Sets an attribute.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hasattr(obj, name)&lt;/code&gt;: Checks if an attribute exists.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;delattr(obj, name)&lt;/code&gt;: Deletes an attribute.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Functional Programming
&lt;/h2&gt;

&lt;p&gt;Useful functions for functional-style programming.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [2, 3]
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [0, 2, 4, 6]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;all(iterable)&lt;/code&gt;: Returns &lt;code&gt;True&lt;/code&gt; if all elements are &lt;code&gt;True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;any(iterable)&lt;/code&gt;: Returns &lt;code&gt;True&lt;/code&gt; if any element is &lt;code&gt;True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;filter(function, iterable)&lt;/code&gt;: Filters elements based on a function.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;map(function, iterable)&lt;/code&gt;: Applies a function to all elements.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Other Useful Functions
&lt;/h2&gt;

&lt;p&gt;Miscellaneous functions for various tasks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: '0b101'
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: '0xff'
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 65
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;65&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 'A'
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering File Retrieval in Linux: wget vs. curl</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Mon, 10 Feb 2025 14:37:04 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/mastering-file-retrieval-in-linux-wget-vs-curl-1hcb</link>
      <guid>https://dev.to/brendahkiragu/mastering-file-retrieval-in-linux-wget-vs-curl-1hcb</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When it comes to retrieving files and interacting with the web from the command line, &lt;code&gt;wget&lt;/code&gt; and &lt;code&gt;curl&lt;/code&gt; are two of the most powerful tools in Linux. Both allow users to download files, fetch web pages, and interact with APIs, but they serve different purposes.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll break down how to use &lt;code&gt;wget&lt;/code&gt; and &lt;code&gt;curl&lt;/code&gt;, their differences, and real-world use cases to help you choose the right tool for your needs.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Table of Contents&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What is &lt;code&gt;wget&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;
Using &lt;code&gt;wget&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Basic File Download&lt;/li&gt;
&lt;li&gt;Resume Interrupted Downloads&lt;/li&gt;
&lt;li&gt;Download an Entire Website&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;What is &lt;code&gt;curl&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;
Using &lt;code&gt;curl&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Basic File Download&lt;/li&gt;
&lt;li&gt;Saving Files with Custom Names&lt;/li&gt;
&lt;li&gt;Making API Requests&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Comparison: wget vs. curl&lt;/li&gt;
&lt;li&gt;Bonus: Installing AWS CLI with curl&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;What is &lt;code&gt;wget&lt;/code&gt;?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;wget&lt;/code&gt; is a command-line utility used to download files from the web. It supports HTTP, HTTPS, and FTP protocols and is best for downloading files in the background or recursively retrieving entire directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Using &lt;code&gt;wget&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Basic File Download with &lt;code&gt;wget&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To download a file from a URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://example.com/file.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Resuming Interrupted Downloads&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your download was interrupted, you can resume it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-c&lt;/span&gt; https://example.com/large-file.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Downloading an Entire Website&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To mirror a website for offline access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;--no-parent&lt;/span&gt; https://example.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;What is &lt;code&gt;curl&lt;/code&gt;?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;curl&lt;/code&gt; is a versatile tool used for transferring data using a wide range of protocols (HTTP, HTTPS, FTP, SCP, and more). Unlike &lt;code&gt;wget&lt;/code&gt;, it is commonly used for API interactions and sending requests beyond just downloading files.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Using &lt;code&gt;curl&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Basic File Download with &lt;code&gt;curl&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To download a file from a URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://example.com/file.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Saving Files with Custom Names&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o&lt;/span&gt; custom_name.zip https://example.com/file.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Making API Requests&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;GET Request&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.example.com/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;POST Request with JSON Data&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"name":"Brenda"}'&lt;/span&gt; https://api.example.com/users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Comparison: wget vs. curl&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;&lt;code&gt;wget&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;curl&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Download files&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resume downloads&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recursive downloads&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API requests (POST, PUT)&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supports multiple protocols&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works in the background&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Bonus: Installing AWS CLI with curl&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let try a real life example of &lt;code&gt;curl&lt;/code&gt; We will install the AWS Command Line Interface (CLI) on a Linux system. Here’s how you can do it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Step 1: Download the AWS CLI installation file&lt;/span&gt;
curl &lt;span class="s2"&gt;"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"awscliv2.zip"&lt;/span&gt;

&lt;span class="c"&gt;# Step 2: Unzip the installation file&lt;/span&gt;
unzip awscliv2.zip

&lt;span class="c"&gt;# Step 3: Run the installation program&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; ./aws/install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Steps Explained:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download the AWS CLI installation file&lt;/strong&gt; using &lt;code&gt;curl&lt;/code&gt;. The &lt;code&gt;-o&lt;/code&gt; option specifies the file name that the downloaded package is written to (in this case, &lt;code&gt;awscliv2.zip&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unzip the installation file.&lt;/strong&gt; When the file is unzipped, a directory named &lt;code&gt;aws&lt;/code&gt; is created under the current directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the installation program.&lt;/strong&gt; The installation command uses a file named &lt;code&gt;install&lt;/code&gt; in the newly unzipped &lt;code&gt;aws&lt;/code&gt; directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Verifying Installation&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;After installation, confirm that the AWS CLI is installed correctly by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should return the installed AWS CLI version, ensuring that everything is set up properly.&lt;/p&gt;




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

&lt;p&gt;Both &lt;code&gt;wget&lt;/code&gt; and &lt;code&gt;curl&lt;/code&gt; are essential tools for Linux users. If you need to download files, especially recursively, &lt;code&gt;wget&lt;/code&gt; is the way to go. However, if you're working with APIs and need to send HTTP requests, &lt;code&gt;curl&lt;/code&gt; is the better choice.&lt;/p&gt;

&lt;p&gt;By mastering both tools, you’ll enhance your ability to interact with the web from the command line efficiently. Happy coding! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Top 10 Chrome Extensions Every Developer Should Have in 2025</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Mon, 27 Jan 2025 13:37:03 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/top-10-chrome-extensions-every-developer-should-have-in-2025-4789</link>
      <guid>https://dev.to/brendahkiragu/top-10-chrome-extensions-every-developer-should-have-in-2025-4789</guid>
      <description>&lt;p&gt;As a developer, having the right tools can make your workflow faster, more efficient, and less frustrating. Chrome extensions are a great way to enhance your browsing and coding experience. Here’s a list of must-have Chrome extensions for developers in 2025, complete with easy-to-understand explanations, visuals, and step-by-step instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. &lt;strong&gt;React Developer Tools&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hktvm4h4stn4vc8rc8a.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%2F1hktvm4h4stn4vc8rc8a.png" alt="A screenshot of React Developer Tools extension" width="542" height="211"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
If you’re working with React, this extension is a lifesaver. It allows you to inspect the React component hierarchy, view props and state, and debug your React applications directly in the Chrome DevTools.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Simplifies debugging and improves your understanding of React component structures.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en&amp;amp;pli=1" rel="noopener noreferrer"&gt;➡ Install React Developer Tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and open Chrome DevTools (F12 or right-click &amp;gt; Inspect).
&lt;/li&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Components&lt;/strong&gt; tab to view the React component tree.
&lt;/li&gt;
&lt;li&gt;Inspect props, state, and hooks for each component.
&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;Profiler&lt;/strong&gt; tab to analyze performance and identify bottlenecks.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. &lt;strong&gt;Wappalyzer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F99xejuzntlnq78st1pww.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%2F99xejuzntlnq78st1pww.png" alt="A screenshot of Wappalyzer" width="775" height="222"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Wappalyzer helps you identify the technologies used on any website. From JavaScript frameworks to CMS platforms, it gives you insights into the tech stack behind the scenes.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Great for competitive analysis or learning what tools other developers are using.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/wappalyzer-technology-pro/gppongmhjkpfnbhagpmjfkannfbllamg" rel="noopener noreferrer"&gt;➡ Install Wappalyzer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and visit any website.
&lt;/li&gt;
&lt;li&gt;Click the Wappalyzer icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;View the list of technologies used on the site, such as frameworks, analytics tools, and hosting providers.
&lt;/li&gt;
&lt;li&gt;Use this information for competitive analysis or to learn about new tools.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. &lt;strong&gt;Octotree - GitHub Code Tree&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchxfhcssgonbj802trd3.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%2Fchxfhcssgonbj802trd3.png" alt="A screenshot of Octotree" width="662" height="205"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Navigating GitHub repositories can be a pain, especially for large projects. Octotree adds a sidebar to GitHub that displays the repository’s file structure, making it easier to browse code.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Saves time when exploring or reviewing code on GitHub.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/octotree-github-code-tree/bkhaagjahfmjljalopjnoealnfndnagc" rel="noopener noreferrer"&gt;➡ Install Octotree&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and go to any GitHub repository.
&lt;/li&gt;
&lt;li&gt;A file tree sidebar will appear on the left side of the page.
&lt;/li&gt;
&lt;li&gt;Click on files or folders to navigate through the repository without refreshing the page.
&lt;/li&gt;
&lt;li&gt;Use the search bar to quickly find specific files.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  4. &lt;strong&gt;Responsive Viewer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l8x4s89hsxvgol64uxv.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%2F0l8x4s89hsxvgol64uxv.png" alt="A screenshot of Responsive Viewer" width="596" height="219"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Testing your website’s responsiveness across multiple devices is crucial. Responsive Viewer lets you view your site in multiple screen sizes simultaneously.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Simplifies responsive design testing and ensures your site looks great on all devices.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/responsive-viewer/inmopeiepgfljkpkidclfgbgbmfcennb" rel="noopener noreferrer"&gt;➡ Install Responsive Viewer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and open the website you want to test.
&lt;/li&gt;
&lt;li&gt;Click the Responsive Viewer icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;Select multiple device presets or create custom screen sizes.
&lt;/li&gt;
&lt;li&gt;View your site in different resolutions side by side.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  5. &lt;strong&gt;ColorZilla&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjp2dub6ts6n9xp2xmfl.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%2Fwjp2dub6ts6n9xp2xmfl.png" alt="A screenshot of ColorZilla" width="535" height="211"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
ColorZilla is a must-have tool for designers and developers who work with colors. It allows you to pick colors from any webpage, analyze them, and copy their HEX, RGB, or HSL values instantly. It also includes a gradient generator and a color history feature.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Simplifies color selection and ensures consistency in your designs.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp" rel="noopener noreferrer"&gt;➡ Install ColorZilla&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and click the ColorZilla icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;Eyedropper&lt;/strong&gt; tool to pick a color from any webpage.
&lt;/li&gt;
&lt;li&gt;Copy the color code (HEX, RGB, or HSL) and use it in your project.
&lt;/li&gt;
&lt;li&gt;Explore the &lt;strong&gt;Gradient Generator&lt;/strong&gt; to create and copy CSS gradients.
&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;Color History&lt;/strong&gt; feature to revisit recently used colors.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  6. &lt;strong&gt;JSON Viewer Pro&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff0mpw6w6a7eervs3df3p.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%2Ff0mpw6w6a7eervs3df3p.png" alt="A screenshot of JSON Viewer Pro" width="525" height="201"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Working with JSON data? This extension formats JSON responses into a readable tree structure, making it easier to analyze and debug.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Makes JSON data human-readable and easier to work with.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/json-viewer-pro/eifflpmocdbdmepbjaopkkhbfmdgijcc" rel="noopener noreferrer"&gt;➡ Install JSON Viewer Pro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and open a webpage that returns JSON data.
&lt;/li&gt;
&lt;li&gt;Click the JSON Viewer Pro icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;View the JSON data in a collapsible tree structure.
&lt;/li&gt;
&lt;li&gt;Use the search feature to quickly find specific keys or values.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  7. &lt;strong&gt;Web Developer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc760bxzipvq12rvoce6b.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%2Fc760bxzipvq12rvoce6b.png" alt="A screenshot od web developer tool" width="716" height="201"&gt;&lt;/a&gt; &lt;br&gt;
This extension adds a toolbar with various web development tools, including options to disable CSS, view image information, and resize the browser window.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; A Swiss Army knife for web developers, packed with useful tools for debugging and testing.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/web-developer-tool-for-ch/ghenifimhcdihapkceohjpgiabidpgji" rel="noopener noreferrer"&gt;➡ Install Web Developer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and click the Web Developer icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;Use the toolbar to disable CSS, view image dimensions, or resize the browser window.
&lt;/li&gt;
&lt;li&gt;Explore other tools like form validation, outline elements, and more.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  8. &lt;strong&gt;Daily.dev - Developer News Feed&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5n1rcj86104mkllgduq0.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%2F5n1rcj86104mkllgduq0.png" alt="A screenshot of Daily.dev" width="800" height="155"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Daily.dev is a developer news aggregator that brings the best articles, blogs, and resources from across the web into one place. It opens every time you open a new tab, ensuring you never miss out on the latest updates in the tech world.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Perfect for staying informed about the latest trends, tools, and best practices in software development.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/dailydev-the-homepage-dev/jlmpjdjjbgclbocgajdjefcidcncaied" rel="noopener noreferrer"&gt;➡ Install Daily.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and open a new tab in Chrome.
&lt;/li&gt;
&lt;li&gt;Customize your feed by selecting your interests (e.g., JavaScript, Python, DevOps).
&lt;/li&gt;
&lt;li&gt;Browse articles, blogs, and resources curated for developers.
&lt;/li&gt;
&lt;li&gt;Save articles to read later or share them with your team.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  9. &lt;strong&gt;Hackertab.dev - Developer News&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F672dz4atw95oh1g4al56.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%2F672dz4atw95oh1g4al56.png" alt="A screenshot of hackertab.dev" width="746" height="219"&gt;&lt;/a&gt;&lt;br&gt;
Hackertab.dev is a personalized news feed for developers. It aggregates content from GitHub, Dev.to, Medium, Hashnode, and more, based on your interests and preferences.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Stay updated with the latest developer news, tools, and trends without leaving your browser.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/Hackertab.dev%20-%20developer%20news/ocoipcahhaedjhnpoanfflhbdcpmalmp" rel="noopener noreferrer"&gt;➡ Install Hackertab.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and click the Hackertab.dev icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;Customize your feed by selecting your preferred topics (e.g., React, AI, DevOps).
&lt;/li&gt;
&lt;li&gt;Browse the latest articles, GitHub repositories, and news tailored to your interests.
&lt;/li&gt;
&lt;li&gt;Save or share content directly from the extension.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  10. &lt;strong&gt;Ghostery&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5kkhh8bpscbxyuj0scpj.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%2F5kkhh8bpscbxyuj0scpj.png" alt="a screenshot of ghostery" width="800" height="193"&gt;&lt;/a&gt;&lt;br&gt;
Ghostery is a powerful privacy and ad-blocking extension that helps you browse the web faster and more securely. It blocks trackers, ads, and pop-ups, while also providing insights into the trackers operating on any website.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Why you need it:&lt;/strong&gt; Protects your privacy, speeds up page loading, and improves your browsing experience by blocking intrusive elements.&lt;br&gt;&lt;br&gt;
&lt;a href="https://chromewebstore.google.com/detail/ghostery-tracker-ad-block/mlomiejdfkolichcflejclcbmpeaniij" rel="noopener noreferrer"&gt;➡ Install Ghostery&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use it:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the extension and click the Ghostery icon in the Chrome toolbar.
&lt;/li&gt;
&lt;li&gt;Toggle the &lt;strong&gt;Block Trackers&lt;/strong&gt; switch to enable or disable tracker blocking.
&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;Smart Blocking&lt;/strong&gt; feature to allow non-intrusive trackers for specific sites.
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;See All Trackers&lt;/strong&gt; to view a detailed list of trackers operating on the current webpage.
&lt;/li&gt;
&lt;li&gt;Customize your blocking preferences in the &lt;strong&gt;Settings&lt;/strong&gt; menu for a personalized experience.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blocks ads, trackers, and pop-ups.
&lt;/li&gt;
&lt;li&gt;Provides detailed insights into website trackers.
&lt;/li&gt;
&lt;li&gt;Improves page load speed and reduces data usage.
&lt;/li&gt;
&lt;li&gt;Protects your privacy by preventing data collection.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;These Chrome extensions can significantly improve your productivity as a developer. Whether you’re debugging React apps, analyzing tech stacks, testing responsiveness, or staying updated with the latest developer news, there’s something here for everyone. Give them a try and see how they can streamline your workflow! &lt;em&gt;Happy coding!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devtools</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Types of Web Testing: A Beginner's Guide</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Fri, 17 Jan 2025 15:24:54 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/types-of-web-testing-a-beginners-guide-33og</link>
      <guid>https://dev.to/brendahkiragu/types-of-web-testing-a-beginners-guide-33og</guid>
      <description>&lt;p&gt;Picture this: It’s 7:20 in the morning. You have a meeting at 8 a.m., but when you go to start your car, it won’t start. You quickly open your Uber app, only to find that the website keeps hanging with every scroll.&lt;/p&gt;

&lt;p&gt;Frustrated and desperate, you turn to the next Uber website, hoping it will work, only for it to decline your booking. You’re already running late, and now you’re stuck—frustrating, right?&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%2F2uk1armxkoc3kstcynk5.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%2F2uk1armxkoc3kstcynk5.jpg" alt="A computer screen showing error message" width="768" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is exactly why web testing is crucial. Websites must perform flawlessly under pressure to ensure users don’t encounter problems like these when time is critical. &lt;/p&gt;

&lt;p&gt;Web developers ensure a great user experience by conducting extensive testing. This is critical not only when launching a new website or adding major features, but also when making smaller changes—like tweaking the behavior of a single button. &lt;/p&gt;

&lt;p&gt;Let's explore the different types of web testing that help catch issues early and deliver a seamless user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Acceptance Tests
&lt;/h2&gt;

&lt;p&gt;These tests verify that the entire website works as intended for its users. Acceptance testing typically happens at the end of the development process, just before a website goes live. It ensures that all parts of the website—both client and server—function together seamlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Imagine a travel website where users book flights. An acceptance test would check if a user can successfully search for flights, select dates, choose a seat, and complete a purchase—all processes working smoothly from start to finish.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Integration Tests
&lt;/h2&gt;

&lt;p&gt;Integration testing focuses on how different components of the website interact with each other. The goal is to ensure that these parts function together as expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: If you're shopping online, integration tests would check whether the payment gateway connects properly with the shopping cart, ensuring that when you make a payment, the order goes through correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Unit Tests
&lt;/h2&gt;

&lt;p&gt;Unit testing involves examining the smallest testable part of a website, such as a specific feature or function. This ensures that every component is working properly, and each individual piece is checked before putting it all together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: A developer might run unit tests on a contact form’s drop-down menu to ensure it opens correctly, closes without issues, and displays accurate information like options for users to select from.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Functional Tests
&lt;/h2&gt;

&lt;p&gt;Functional testing simulates real-world usage to verify that a website performs as expected based on the initial design or requirements. It looks into how the site behaves when real users engage with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: For a recipe-sharing website, functional tests would check if a user can successfully search for recipes, bookmark their favorites, and submit a new recipe without any errors.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Performance Tests
&lt;/h2&gt;

&lt;p&gt;Performance testing checks how well a website performs under varying levels of stress. One specific test here is &lt;em&gt;load testing&lt;/em&gt;, which examines how much traffic a website can handle before it starts to slow down or fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: If you launch an online store during Black Friday sales, performance tests measure how many customers the website can support at once without crashing when thousands of people try to make purchases at the same time.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Regression Tests
&lt;/h2&gt;

&lt;p&gt;When new features are added to a website, regression tests ensure that they don't break or interfere with the existing functionality. If a new feature creates an issue with something that was previously working, that’s called a &lt;em&gt;regression bug&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: If an online bank adds a new "check balance" feature, regression tests would ensure that the balance can be checked without affecting users' ability to log in, transfer money, or view their transaction history.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Stress Tests
&lt;/h2&gt;

&lt;p&gt;Similar to performance testing, stress tests put extreme loads on the website to see how much it can handle before breaking down. These tests simulate much higher than normal traffic to evaluate the website’s breaking point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Imagine a viral video goes viral on a streaming platform. Stress testing would determine how many users can stream the video at once before the website stops responding or crashes.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Usability Tests
&lt;/h2&gt;

&lt;p&gt;Usability testing evaluates how easy and intuitive it is for real users to navigate a website and complete a task. Testers give users a set of activities to perform and observe how easily and efficiently they can accomplish them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: On a food delivery website, usability tests may check how easy it is for users to browse the menu, select items, enter a delivery address, and pay for their order. The goal is to see if customers can complete the process without confusion or frustration.&lt;/p&gt;




&lt;p&gt;Each type of testing plays an important role in ensuring that a website is stable, functional, user-friendly, and able to handle a high amount of traffic. These tests help developers catch bugs, improve performance, and deliver a website that meets user needs.&lt;/p&gt;

&lt;p&gt;Stay curious, squash those bugs before your users do. Happy coding!&lt;/p&gt;

</description>
      <category>basic</category>
      <category>frontend</category>
      <category>testing</category>
    </item>
    <item>
      <title>HTML vs HTML5—the tale of two titans of web development.</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Wed, 15 Jan 2025 20:28:58 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/html-vs-html5-the-tale-of-two-titans-of-web-development-54en</link>
      <guid>https://dev.to/brendahkiragu/html-vs-html5-the-tale-of-two-titans-of-web-development-54en</guid>
      <description>&lt;h3&gt;
  
  
  Understanding the Difference Between HTML and HTML5
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Once upon a time in the late 1980s, Tim Berners-Lee had a groundbreaking idea: what if people could share and link information seamlessly across different computers? To bring this vision to life, he devised a simple yet revolutionary system of communication—a markup language called HTML (HyperText Markup Language). It laid the foundation for the World Wide Web, transforming the way we access information.&lt;/p&gt;

&lt;p&gt;As years went by, developers noticed HTML’s growing limitations. It was overly dependent on plugins like Flash for multimedia and lacked flexibility for modern web development needs. This sparked a transformation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A group of visionaries, including Ian Hickson and the Web Hypertext Application Technology Working Group (WHATWG), envisioned a future for HTML. After years of innovation and collaboration, HTML5 emerged.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You’ve likely encountered HTML while adding skills to your CV and wondered why it didn't quite land the dream job. Could it be that the employer was looking for the elusive HTML5? Let’s unravel the mystery and demystify HTML versus HTML5 once and for all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Differences Between HTML and HTML5
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;1. Structural Enhancements&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Earlier versions relied heavily on non-semantic tags like &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for structuring content, which often made it less intuitive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Introduced semantic elements like &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;. These tags improve document readability and accessibility, especially for assistive technologies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;2. Multimedia Support&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Audio and video content required external plugins like Adobe Flash or third-party players.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Native support for multimedia through the &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tags eliminates the need for plugins, offering better performance and cross-device compatibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;3. Forms and Input Types&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Limited input types and functionality, such as simple text fields, checkboxes, and radio buttons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Enhanced form controls with new input types like &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;tel&lt;/code&gt;, &lt;code&gt;url&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt;, and &lt;code&gt;range&lt;/code&gt;. It also introduced attributes like &lt;code&gt;placeholder&lt;/code&gt;, &lt;code&gt;required&lt;/code&gt;, &lt;code&gt;pattern&lt;/code&gt;, and &lt;code&gt;autofocus&lt;/code&gt; to simplify form validation and improve user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;4. Graphics and Animation&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Depended on external libraries and plugins for animations and graphic elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Introduced the &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; tag for 2D drawing and integrated support for &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; for scalable vector graphics, allowing developers to create complex visuals directly within the browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;5. APIs and Modern Functionality&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Lacked APIs for advanced features and relied on basic browser capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Offers numerous APIs such as:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Geolocation API&lt;/strong&gt;: For location-based services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Storage API&lt;/strong&gt;: Provides localStorage and sessionStorage for secure client-side storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web Workers&lt;/strong&gt;: Enable background scripts to improve performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drag-and-Drop API&lt;/strong&gt;: Enhances user interactivity.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;6. Mobile-Friendliness&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Did not natively support responsive design, relying on workarounds and external CSS frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Facilitates responsive web design through features like the &lt;code&gt;viewport&lt;/code&gt; meta tag and compatibility with CSS3 media queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;7. Deprecated Elements&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt;: Included elements like &lt;code&gt;&amp;lt;font&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;center&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;big&amp;gt;&lt;/code&gt;, which are now considered outdated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: Removed such elements and emphasized using CSS for styling, promoting cleaner and more modular code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Similarities Between HTML and HTML5
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;1. Core Functionality&lt;/u&gt;&lt;br&gt;
Both HTML and HTML5 serve as the backbone of web structure, allowing developers to create documents that are rendered by browsers. Tags like &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; are common to both versions.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;2. Syntax and Basic Structure&lt;/u&gt;&lt;br&gt;
The foundational syntax of HTML5 remains consistent with HTML. Developers transitioning from HTML to HTML5 can leverage their existing knowledge with minimal learning curve.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;3. Cross-Browser Compatibility&lt;/u&gt;&lt;br&gt;
HTML and HTML5 aim to work across different web browsers, ensuring consistent rendering of web pages. While HTML5 provides more advanced capabilities, both versions align with browser standards.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;4. HTML Doctype&lt;/u&gt;&lt;br&gt;
Though simplified in HTML5, the concept of a doctype exists in both, ensuring that browsers interpret the document correctly. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;HTML5 Doctype&lt;/em&gt;: &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML Doctype&lt;/strong&gt;: More verbose, e.g., &lt;code&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;While HTML5 offers significant advancements, it doesn't entirely replace HTML. Core concepts like the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, and basic tags remain consistent. The transition is smooth for developers familiar with the original HTML.&lt;/p&gt;

&lt;p&gt;I hope you learned something new, just as I did. Happy coding! And remember, always “close your tags, or risk leaving your browser hanging! 😉&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to clean up Unused Packages in your JavaScript/TypeScript project</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Fri, 10 Jan 2025 22:31:10 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/how-to-clean-up-unused-packages-in-your-javascripttypescript-project-3pfn</link>
      <guid>https://dev.to/brendahkiragu/how-to-clean-up-unused-packages-in-your-javascripttypescript-project-3pfn</guid>
      <description>&lt;h2&gt;
  
  
  What if there is some magic in the developer's world?
&lt;/h2&gt;

&lt;p&gt;Sometimes we get immersed in a project, installing package after package, only to realize along the way: "That’s not the package I needed." So you go ahead and install another package — problem solved, right? But over time, your project accumulates unused packages. I used to sort them unused packages by visiting the &lt;strong&gt;package.json&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Until I came across &lt;strong&gt;JavaScript's magic sweepbroom&lt;/strong&gt;, on my adventure of seeing what is interesting on the internet. &lt;strong&gt;depcheck&lt;/strong&gt; It cleaned up my projects in seconds, and I thought I’d share this little trick with someone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is depcheck?
&lt;/h2&gt;

&lt;p&gt;Depcheck is a powerful command-line tool designed to analyze JavaScript and TypeScript projects, by identifying unused packages/dependencies and missing dependencies. It saves you from manually combing through package.json or the node_modules jungle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;With Depcheck, you can:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically list &lt;strong&gt;unused&lt;/strong&gt; dependencies in your project.&lt;/li&gt;
&lt;li&gt;Identify &lt;strong&gt;missing&lt;/strong&gt; dependencies that are being used but not declared in package.json.&lt;/li&gt;
&lt;li&gt;Customize the analysis to suit your project’s structure and tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Why Do You Need Depcheck?&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Modern development involves relying on numerous libraries and frameworks. It’s easy for unnecessary dependencies to accumulate over time, making your project:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bloated&lt;/em&gt; — Unused packages increase the size of your node_modules, adding clutter.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Slower&lt;/em&gt; - The more packages you have, the slower installation and build processes become.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Harder to Maintain&lt;/em&gt; — Keeping track of essential vs. redundant packages becomes overwhelming.&lt;/p&gt;

&lt;p&gt;Depcheck tackles these problems head-on by pinpointing exactly which packages you can safely remove.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;How to Use Depcheck&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Let’s walk through how to integrate Depcheck into your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install Depcheck
&lt;/h2&gt;

&lt;p&gt;Depcheck can be installed globally or as a dev dependency in your project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g depcheck&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save-dev depcheck&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Run Depcheck
&lt;/h2&gt;

&lt;p&gt;Navigate to your project’s root directory and run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;depcheck&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Depcheck will analyze your project and output two key lists:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Unused Dependencies — Installed but not used in your code.&lt;/li&gt;
&lt;li&gt;Missing Dependencies — Used in your code but not listed in package.json.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Example Output
&lt;/h2&gt;

&lt;p&gt;Here’s what a typical output might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unused dependencies
* moment
* lodash

Unused devDependencies
* jest
* eslint

Missing dependencies
* chalk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From this, you can confidently remove the unused dependencies and add any missing ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Options
&lt;/h2&gt;

&lt;p&gt;Depcheck supports several options to enhance its analysis:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ignore Specific Dependencies&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If there are certain packages you always want to keep, you can ignore them by adding an option:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;depcheck --ignores=chalk,jest&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Custom Parsers and Detectors&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If your project uses unconventional module patterns, you can specify custom parsers or detectors to help Depcheck accurately analyze your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrate with CI/CD
&lt;/h2&gt;

&lt;p&gt;For automated dependency management, integrate Depcheck into your CI/CD pipeline to ensure your project stays lean throughout development.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleaning Up with Confidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once Depcheck identifies &lt;strong&gt;unused&lt;/strong&gt; dependencies, you can &lt;strong&gt;remove&lt;/strong&gt; them with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm uninstall package-name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;missing&lt;/strong&gt; dependencies, you can &lt;strong&gt;add&lt;/strong&gt; them to your project:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install missing-package&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This ensures your project’s package.json remains optimized, with no dead weight slowing you down.&lt;/p&gt;

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

&lt;p&gt;By using Depcheck, I managed to declutter my projects and streamline my workflow effortlessly. It’s the tool you didn’t know you needed but can’t imagine working without once you’ve tried it.&lt;/p&gt;

&lt;p&gt;If you’re tired of manually sifting through your dependencies or dealing with bloated node_modules, give Depcheck a spin. You’ll be surprised how satisfying a clean, well-structured project can feel.&lt;/p&gt;

&lt;p&gt;Have you tried Depcheck, or do you have other tricks for keeping your projects lean? Share your thoughts below—I’d love to hear them! Happy Coding. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
      <category>cleancoding</category>
    </item>
    <item>
      <title>How to Compress Videos Using HandBrake: A Step-by-Step Guide</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Thu, 09 Jan 2025 21:20:20 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/how-to-compress-videos-using-handbrake-a-step-by-step-guide-dn3</link>
      <guid>https://dev.to/brendahkiragu/how-to-compress-videos-using-handbrake-a-step-by-step-guide-dn3</guid>
      <description>&lt;h2&gt;
  
  
  My Experience: Why I Needed HandBrake
&lt;/h2&gt;

&lt;p&gt;I was applying for a remote job recently, and as part of the evaluation process, I needed to upload a video file of no more than a minute. After a couple of attempts (don’t worry if you don’t nail it on the first try – it happens to the best of us!), I finally recorded my video: 53 seconds long. 🎉&lt;/p&gt;

&lt;p&gt;"Seven seconds less than the limit," I thought, "perfecto!" The video was concise and to the point.&lt;/p&gt;

&lt;p&gt;Then came the moment of truth: uploading it to the application form. That’s where I hit a roadblock. Despite following all the guidelines, the upload wouldn’t go through. Frustrated, I reached out to the organization for help.&lt;/p&gt;

&lt;p&gt;Their response? “Check your file size.”&lt;/p&gt;

&lt;p&gt;Wait, what? File size?! This vital detail was conveniently omitted from the instructions. I felt stuck. Should I re-record my video? Maybe practice speaking even faster to shave more seconds off? 😅 But then I remembered something: I’m a developer, and "dev-life" revolves around solving problems (thanks, internet!).&lt;/p&gt;

&lt;p&gt;That’s when I came across HandBrake, and with a little AI guidance, I found the solution and submitted my application just in time. In the spirit of paying it forward, I’ve written this guide to help anyone facing a similar challenge. Let’s dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Download and Install HandBrake
&lt;/h2&gt;

&lt;p&gt;Visit the official HandBrake website: &lt;a href="https://handbrake.fr" rel="noopener noreferrer"&gt;https://handbrake.fr&lt;/a&gt;.&lt;br&gt;
Download and install HandBrake for your operating system (Windows, macOS, or Linux).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Import Your Video
&lt;/h2&gt;

&lt;p&gt;Launch HandBrake.&lt;br&gt;
Drag and drop your video file into the main window, or click File to browse and select your video.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Choose a Compression Preset
&lt;/h2&gt;

&lt;p&gt;HandBrake offers pre-configured settings to balance quality and file size.&lt;/p&gt;

&lt;p&gt;On the &lt;strong&gt;right&lt;/strong&gt; side, pick a preset:&lt;br&gt;
Very Fast 720p30 for medium compression.&lt;br&gt;
Very Fast 480p30 or Fast 480p30 for more aggressive compression.&lt;br&gt;
Need a &lt;strong&gt;tiny&lt;/strong&gt; file? Go for Super Fast 480p30.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Adjust Basic Output Settings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Format&lt;/strong&gt;: Ensure it’s set to MP4 in the Summary tab (the most compatible format).&lt;br&gt;
Video Codec: Choose H.264 (x264) for efficient compression.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Fine-Tune Video Compression
&lt;/h2&gt;

&lt;p&gt;In the Video tab:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encoder Preset:&lt;/strong&gt;&lt;br&gt;
Set it to &lt;strong&gt;Slower or Very Slow&lt;/strong&gt; (better compression but slower processing).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constant Quality:&lt;/strong&gt;&lt;br&gt;
Increase the value (e.g., 28–30) for higher compression.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Optimize Resolution
&lt;/h2&gt;

&lt;p&gt;Go to the Dimensions tab.&lt;br&gt;
Reduce the resolution (e.g., width of 640 pixels) while keeping the aspect ratio locked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Adjust Audio Settings
&lt;/h2&gt;

&lt;p&gt;In the &lt;strong&gt;Audio&lt;/strong&gt; tab:&lt;br&gt;
Reduce the Bitrate to 96 kbps or lower.&lt;br&gt;
Keep only one audio track if your video has multiples.&lt;br&gt;
Step 8: Trim Unnecessary Sections&lt;br&gt;
(Optional) To remove unwanted parts:&lt;/p&gt;

&lt;p&gt;In the Summary tab, find the Range section.&lt;br&gt;
Set custom start and end times to trim the video.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 9: Save and Compress
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Choose a destination folder and name for the compressed file by clicking Browse.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the Start Encode button.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 10: Verify and Test
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check the compressed file size in the destination folder.&lt;/li&gt;
&lt;li&gt;Upload it to your application or desired platform.&lt;/li&gt;
&lt;li&gt;If the File Size is Still Too Large&lt;/li&gt;
&lt;li&gt;Increase the Constant Quality value (e.g., 31 or more).&lt;/li&gt;
&lt;li&gt;Further, reduce the resolution in the Dimensions tab.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;HandBrake made compressing my video a breeze, saving me from re-recording or editing under pressure. Thanks to its powerful tools and some quick research, I was able to meet the size requirements and submit my job application on time. 🙌&lt;/p&gt;

&lt;p&gt;If you’re struggling with video compression, don’t give up! HandBrake is a lifesaver, and now you have the steps to compress your videos with ease. Happy compressing! 🎥✨&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Dictionary Unpacking in Python!</title>
      <dc:creator>BrendahKiragu</dc:creator>
      <pubDate>Tue, 07 Jan 2025 19:50:31 +0000</pubDate>
      <link>https://dev.to/brendahkiragu/dictionary-unpacking-in-python-546g</link>
      <guid>https://dev.to/brendahkiragu/dictionary-unpacking-in-python-546g</guid>
      <description>&lt;p&gt;Hey there, Python enthusiasts! 💻&lt;/p&gt;

&lt;p&gt;Let's talk about the coolest and most underrated tricks in Python that I discovered today: &lt;em&gt;dictionary unpacking&lt;/em&gt; (a.k.a. dictionary merging). Whether you’re a beginner or a seasoned coder, this technique can simplify your life when working with dictionaries. Let's dive in!&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Dictionary Unpacking?
&lt;/h3&gt;

&lt;p&gt;Imagine you have two dictionaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Dictionary 1&lt;br&gt;
&lt;code&gt;first = {"name": "Tim Bradford", "age": 35}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dictionary 2&lt;br&gt;
&lt;code&gt;second = {"city": "New York", "job": "Hollywood Actor"}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, what if you want to combine these dictionaries into one?&lt;/p&gt;

&lt;p&gt;Enter dictionary unpacking! Using the ** operator, you can easily merge these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;combined = {**first, **second}
print(combined)

Output:

{'name': 'Tim Bradford', 'age': 35, 'city': 'New York', 'job': 'Hollywood Actor'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool, right? You just created a shiny new dictionary that combines the keys and values of both first and second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Is This Useful?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Merging Dictionaries:&lt;/strong&gt;&lt;br&gt;
Before Python 3.9, merging dictionaries involved using methods like .update() or creating a custom loop. Dictionary unpacking makes it simple and clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Default Values:&lt;/strong&gt;&lt;br&gt;
Combine your main dictionary with another dictionary containing default values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;defaults = {"theme": "dark", "language": "English"}
user_settings = {"language": "French"}

final_settings = {**defaults, **user_settings}
print(final_settings)

Output:

{'theme': 'dark', 'language': 'French'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user’s preference for language takes precedence, thanks to the unpacking order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Readable Code:&lt;/strong&gt;&lt;br&gt;
Your colleagues (and future you!) will thank you for this clean and Pythonic approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handling Key Collisions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What happens if both dictionaries have the same key? Let’s see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = {"key": "value1"}
b = {"key": "value2"}

result = {**a, **b}
print(result)

Output:

{'key': 'value2'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The value from the dictionary on the right (b) overrides the one on the left (a). So, order matters when unpacking!&lt;/p&gt;

&lt;h3&gt;
  
  
  Python 3.9+ Bonus: The | Operator
&lt;/h3&gt;

&lt;p&gt;Starting from Python 3.9, merging dictionaries became even simpler with the | operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;merged = a | b
print(merged)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This achieves the same result as unpacking but looks even cleaner. For an in-place merge, use |=:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a |= b
print(a)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This updates "a" with the merged dictionary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Fun Fact to Wrap Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dictionary unpacking isn’t just for merging—it’s also helpful when passing dynamic arguments to functions! If you have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def greet(name, age, topic, time):
    print(f"Hello, {name}! You are {age} years old. You are here to learn about {topic} at {time}.")

info = {"name": "Marko", "age": 30}
subject = {"topic": "Python", "time": "10:00 AM"}
greet(**info, **subject)

Output:

Hello, Marko! You are 30 years old. You are here to learn about Python at 10:00 AM.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With **info and **subject, you’re unpacking the dictionary to match the function’s parameters. Handy, innit?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dictionary unpacking is a delightful feature that makes Python so elegant and intuitive. It’s clean, readable, and oh-so-powerful.&lt;/p&gt;

&lt;p&gt;Got some cool dictionary tricks of your own? Share them in the comments below! And if you’re new to Python, try practicing with this feature—you’ll be amazed at how much smoother your code becomes. Until next time, happy coding! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>learning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
