<?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: Abdul Haseeb Mari</title>
    <description>The latest articles on DEV Community by Abdul Haseeb Mari (@abdulhaseebmari).</description>
    <link>https://dev.to/abdulhaseebmari</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4161492%2F3d11f76b-d879-43ef-b93e-78d815c6b658.png</url>
      <title>DEV Community: Abdul Haseeb Mari</title>
      <link>https://dev.to/abdulhaseebmari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdulhaseebmari"/>
    <language>en</language>
    <item>
      <title>Python List Comprehensions: Write Cleaner and More Readable Code</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Sat, 21 Nov 2026 04:04:29 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/python-list-comprehensions-write-cleaner-and-more-readable-code-1n4a</link>
      <guid>https://dev.to/abdulhaseebmari/python-list-comprehensions-write-cleaner-and-more-readable-code-1n4a</guid>
      <description>&lt;p&gt;Python is known for its readable syntax, and list comprehensions are one of the features that help make code more concise.&lt;/p&gt;

&lt;p&gt;A list comprehension allows developers to create a new list from an existing iterable using a compact expression.&lt;/p&gt;

&lt;p&gt;Let's explore how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Creating a list with a traditional loop
&lt;/h2&gt;

&lt;p&gt;Suppose we want to create a list containing the squares of numbers.&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="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;squares&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;in&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;squares&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&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="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;squares&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1, 4, 9, 16, 25]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works perfectly, but Python offers a shorter alternative.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Using a list comprehension
&lt;/h2&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="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;squares&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;squares&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1, 4, 9, 16, 25]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The general structure is:&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;expression&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;iterable&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Adding conditions
&lt;/h2&gt;

&lt;p&gt;You can also filter elements while creating a list.&lt;/p&gt;

&lt;p&gt;For example, selecting only even numbers:&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="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;even_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;number&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;even_numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[2, 4, 6, 8]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Transforming strings
&lt;/h2&gt;

&lt;p&gt;List comprehensions are not limited to numbers.&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;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"alice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"john"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sara"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"michael"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;capitalized_names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;capitalize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capitalized_names&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;['Alice', 'John', 'Sara', 'Michael']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. When should you use them?
&lt;/h2&gt;

&lt;p&gt;List comprehensions are useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Transforming elements in a list.&lt;/li&gt;
&lt;li&gt;Filtering data using simple conditions.&lt;/li&gt;
&lt;li&gt;Creating new lists from existing collections.&lt;/li&gt;
&lt;li&gt;Keeping short data-processing operations readable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, avoid writing extremely complicated comprehensions. If an expression contains multiple conditions or nested loops that are difficult to understand, a normal loop may be better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance and readability
&lt;/h2&gt;

&lt;p&gt;List comprehensions are often faster than equivalent loops that repeatedly call &lt;code&gt;append()&lt;/code&gt; in CPython, but actual performance depends on the operation and workload.&lt;/p&gt;

&lt;p&gt;The most important consideration is readable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final takeaway
&lt;/h2&gt;

&lt;p&gt;Good Python programming isn't about writing the shortest possible code. It's about writing code that is clear, maintainable, and easy for other developers to understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try this challenge:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a list comprehension that takes the numbers from 1 to 20 and returns only numbers divisible by 3.&lt;/p&gt;

&lt;p&gt;Share your solution in the comments!&lt;/p&gt;

&lt;h1&gt;
  
  
  Python #PythonProgramming #LearnPython #SoftwareDevelopment #Coding #Programming
&lt;/h1&gt;

</description>
      <category>python</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding Database Transactions: Why ACID Properties Matter</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Sat, 21 Nov 2026 04:03:55 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/understanding-database-transactions-why-acid-properties-matter-5c9</link>
      <guid>https://dev.to/abdulhaseebmari/understanding-database-transactions-why-acid-properties-matter-5c9</guid>
      <description>&lt;p&gt;A database transaction is a group of database operations treated as one logical unit of work.&lt;/p&gt;

&lt;p&gt;Transactions are essential when multiple operations must succeed together. Without them, an application can end up with incomplete or inconsistent data.&lt;/p&gt;

&lt;p&gt;Let's understand this with a practical example.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real-world example
&lt;/h2&gt;

&lt;p&gt;Imagine transferring $100 from Account A to Account B.&lt;/p&gt;

&lt;p&gt;Two operations are required:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Subtract $100 from Account A.&lt;/li&gt;
&lt;li&gt;Add $100 to Account B.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What happens if the first operation succeeds but the second fails?&lt;/p&gt;

&lt;p&gt;Money could disappear from the system.&lt;/p&gt;

&lt;p&gt;A database transaction helps prevent this situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example using SQL
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;account_id&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="k"&gt;COMMIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If an operation fails, the application can roll back the transaction:&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;ROLLBACK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact transaction behavior depends on the database engine, isolation level, and application logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the ACID properties
&lt;/h2&gt;

&lt;p&gt;ACID describes four important properties of reliable database transactions.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Atomicity
&lt;/h3&gt;

&lt;p&gt;A transaction is treated as one complete unit.&lt;/p&gt;

&lt;p&gt;Either all its operations succeed, or none of them are committed.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Consistency
&lt;/h3&gt;

&lt;p&gt;A transaction must preserve database rules and constraints.&lt;/p&gt;

&lt;p&gt;For example, an application might enforce that an account balance cannot become negative.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Isolation
&lt;/h3&gt;

&lt;p&gt;Concurrent transactions should not interfere with one another in ways that produce invalid results.&lt;/p&gt;

&lt;p&gt;Database isolation levels determine how concurrent operations interact.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Durability
&lt;/h3&gt;

&lt;p&gt;Once a transaction is committed, its changes should survive a system failure, subject to the database's durability guarantees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why developers should care
&lt;/h2&gt;

&lt;p&gt;Transactions are useful in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking and payment systems&lt;/li&gt;
&lt;li&gt;E-commerce orders&lt;/li&gt;
&lt;li&gt;Inventory management&lt;/li&gt;
&lt;li&gt;Booking platforms&lt;/li&gt;
&lt;li&gt;User account management&lt;/li&gt;
&lt;li&gt;Financial record systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whenever multiple database operations depend on each other, transaction design matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes to avoid
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Forgetting to roll back after an error.&lt;/li&gt;
&lt;li&gt;Keeping transactions open longer than necessary.&lt;/li&gt;
&lt;li&gt;Assuming every database uses identical isolation behavior.&lt;/li&gt;
&lt;li&gt;Updating related records without considering concurrent requests.&lt;/li&gt;
&lt;li&gt;Failing to test what happens when an operation fails halfway through.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Database transactions are not just an advanced SQL feature. They are a fundamental part of building dependable software.&lt;/p&gt;

&lt;p&gt;Understanding ACID helps developers create applications that protect data integrity, especially when multiple operations must work together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Discussion:&lt;/strong&gt; Have you implemented database transactions in a project? Which database did you use: MySQL, PostgreSQL, SQL Server, or another one?&lt;/p&gt;

&lt;h1&gt;
  
  
  Database #SQL #BackendDevelopment #SoftwareEngineering #Programming #WebDevelopment
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>database</category>
      <category>learning</category>
      <category>performance</category>
    </item>
    <item>
      <title>Git Branching Explained: How Developers Work on Features Without Breaking Main Code</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Fri, 20 Nov 2026 04:29:30 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/git-branching-explained-how-developers-work-on-features-without-breaking-main-code-jel</link>
      <guid>https://dev.to/abdulhaseebmari/git-branching-explained-how-developers-work-on-features-without-breaking-main-code-jel</guid>
      <description>&lt;h1&gt;
  
  
  Git Branching Explained: How Developers Work on Features Without Breaking Main Code
&lt;/h1&gt;

&lt;p&gt;When working on a software project, developers frequently need to add features, fix bugs, and experiment with new ideas.&lt;/p&gt;

&lt;p&gt;But what happens when several changes are being developed simultaneously?&lt;/p&gt;

&lt;p&gt;This is where Git branching becomes useful.&lt;/p&gt;

&lt;p&gt;Git branches allow developers to work on separate lines of development without immediately changing the main branch.&lt;/p&gt;

&lt;p&gt;Let's understand how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is a Git branch?
&lt;/h2&gt;

&lt;p&gt;A Git branch is a movable reference to a commit.&lt;/p&gt;

&lt;p&gt;Most repositories begin with a default branch commonly named &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Developers can create additional branches for specific tasks.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main
feature/login
feature/dashboard
bugfix/registration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each branch can contain its own commits.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create a new branch
&lt;/h2&gt;

&lt;p&gt;To create and switch to a new branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch -c feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a branch named &lt;code&gt;feature/login&lt;/code&gt; and switches to it.&lt;/p&gt;

&lt;p&gt;Your new work can now be committed separately from &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make changes and commit them
&lt;/h2&gt;

&lt;p&gt;After modifying your files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
git add .
git commit -m &lt;span class="s2"&gt;"Add login functionality"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commit is recorded on the current branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Switch between branches
&lt;/h2&gt;

&lt;p&gt;To return to the main branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To return to your feature branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git switches the working tree to the selected branch, provided there are no conflicting uncommitted changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Merge your feature branch
&lt;/h2&gt;

&lt;p&gt;When the feature is ready, you can merge it into the main branch.&lt;/p&gt;

&lt;p&gt;First:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git attempts to combine the changes.&lt;/p&gt;

&lt;p&gt;If the same parts of files were changed differently, a merge conflict may occur.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Understand merge conflicts
&lt;/h2&gt;

&lt;p&gt;A merge conflict happens when Git cannot automatically determine how to combine changes.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
Welcome to the application.
=======
Welcome to our software platform.
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You must review the conflicting section and choose the correct final content.&lt;/p&gt;

&lt;p&gt;After resolving the conflict:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add .
git commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact workflow may differ depending on whether Git created a merge commit or another merge state.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Push your branch to GitHub
&lt;/h2&gt;

&lt;p&gt;To upload your feature branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push -u origin feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other collaborators can now review it.&lt;/p&gt;

&lt;p&gt;A common team workflow is to create a pull request so changes can be reviewed before merging.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Delete a completed branch
&lt;/h2&gt;

&lt;p&gt;After merging, a local feature branch can be deleted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch -d feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To delete a remote branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin --delete feature/login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only delete branches when you are confident their work has been integrated or is no longer needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical branching workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Update main
2. Create a feature branch
3. Implement the feature
4. Commit changes
5. Push the branch
6. Open a pull request
7. Review and test
8. Merge into main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why branching matters
&lt;/h2&gt;

&lt;p&gt;Git branching helps developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Work on multiple features independently.&lt;/li&gt;
&lt;li&gt;Experiment without immediately affecting main.&lt;/li&gt;
&lt;li&gt;Review changes before integration.&lt;/li&gt;
&lt;li&gt;Organize bug fixes.&lt;/li&gt;
&lt;li&gt;Collaborate more effectively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For beginners, learning branching early makes working with real-world repositories much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Git is more than a way to upload source code.&lt;/p&gt;

&lt;p&gt;It is a development workflow that helps teams manage changes and collaborate safely.&lt;/p&gt;

&lt;p&gt;Start with simple feature branches, practice merging, and learn how to resolve conflicts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Do you normally use Git branches for every feature, or do you work directly on the main branch?&lt;/p&gt;

&lt;h1&gt;
  
  
  Git #GitHub #VersionControl #SoftwareDevelopment #Programming #OpenSource
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>REST API Explained: HTTP Methods, Status Codes, and Practical Examples</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Fri, 20 Nov 2026 04:28:50 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/rest-api-explained-http-methods-status-codes-and-practical-examples-33oe</link>
      <guid>https://dev.to/abdulhaseebmari/rest-api-explained-http-methods-status-codes-and-practical-examples-33oe</guid>
      <description>&lt;h1&gt;
  
  
  REST API Explained: HTTP Methods, Status Codes, and Practical Examples
&lt;/h1&gt;

&lt;p&gt;APIs are an essential part of modern software development.&lt;/p&gt;

&lt;p&gt;Websites, mobile applications, desktop applications, and backend services frequently communicate through APIs.&lt;/p&gt;

&lt;p&gt;One widely used approach is REST (Representational State Transfer).&lt;/p&gt;

&lt;p&gt;Understanding REST APIs helps developers build applications that communicate with external services and manage data through HTTP.&lt;/p&gt;

&lt;p&gt;Let's explore the fundamentals with practical examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is a REST API?
&lt;/h2&gt;

&lt;p&gt;A REST API exposes resources through URLs and allows clients to interact with those resources using HTTP methods.&lt;/p&gt;

&lt;p&gt;Imagine a task management application.&lt;/p&gt;

&lt;p&gt;It might expose these endpoints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET    /api/tasks
GET    /api/tasks/10
POST   /api/tasks
PUT    /api/tasks/10
PATCH  /api/tasks/10
DELETE /api/tasks/10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each endpoint represents an operation involving task resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Understand the HTTP methods
&lt;/h2&gt;

&lt;h3&gt;
  
  
  GET — Retrieve information
&lt;/h3&gt;

&lt;p&gt;Used to retrieve a resource or collection of resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;GET&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Possible response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"id"&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="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Learn REST APIs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"id"&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="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Build a project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  POST — Create information
&lt;/h3&gt;

&lt;p&gt;Used to submit data, commonly to create a resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Request body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Study JavaScript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PUT — Replace a resource
&lt;/h3&gt;

&lt;p&gt;Used to replace the representation of an existing resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;PUT&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PATCH — Partially update a resource
&lt;/h3&gt;

&lt;p&gt;Used to update selected fields.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;PATCH&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Request body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  DELETE — Remove a resource
&lt;/h3&gt;

&lt;p&gt;Used to request deletion of a resource.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;DELETE&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Understand HTTP status codes
&lt;/h2&gt;

&lt;p&gt;HTTP status codes tell clients what happened when a request was processed.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;201&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;204&lt;/td&gt;
&lt;td&gt;No Content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Bad Request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;Unauthorized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;td&gt;Forbidden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;Not Found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;Internal Server Error&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A common distinction worth remembering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;401:&lt;/strong&gt; Authentication is missing or invalid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;403:&lt;/strong&gt; The server understood the request but refuses access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using appropriate status codes makes APIs easier to understand and integrate.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Make an API request using JavaScript
&lt;/h2&gt;

&lt;p&gt;The Fetch API allows JavaScript applications to send HTTP requests.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchTasks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;"https://jsonplaceholder.typicode.com/todos"&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="sb"&gt;`HTTP error: ${response.status}`&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tasks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Request failed:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;fetchTasks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example demonstrates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sending an HTTP request.&lt;/li&gt;
&lt;li&gt;Checking the response status.&lt;/li&gt;
&lt;li&gt;Converting JSON into JavaScript data.&lt;/li&gt;
&lt;li&gt;Handling errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The JSONPlaceholder service is a demonstration API, so it is useful for practice rather than production data storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What is JSON?
&lt;/h2&gt;

&lt;p&gt;JSON stands for JavaScript Object Notation.&lt;/p&gt;

&lt;p&gt;It is a lightweight data-interchange format commonly used by APIs.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"developer123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"active"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"skills"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"Python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"JavaScript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"C#"&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSON supports objects, arrays, strings, numbers, booleans, and null values.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Important REST API security practices
&lt;/h2&gt;

&lt;p&gt;When building production APIs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use HTTPS.&lt;/li&gt;
&lt;li&gt;Authenticate requests appropriately.&lt;/li&gt;
&lt;li&gt;Enforce authorization on the server.&lt;/li&gt;
&lt;li&gt;Validate incoming data.&lt;/li&gt;
&lt;li&gt;Apply appropriate rate limits.&lt;/li&gt;
&lt;li&gt;Avoid exposing sensitive information in responses.&lt;/li&gt;
&lt;li&gt;Protect API credentials.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An API should never assume that a request is trustworthy just because it comes from your own frontend.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. How to practice
&lt;/h2&gt;

&lt;p&gt;You can improve your API skills by building a small project.&lt;/p&gt;

&lt;p&gt;Try creating a task management API with:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An endpoint to retrieve tasks.&lt;/li&gt;
&lt;li&gt;An endpoint to create tasks.&lt;/li&gt;
&lt;li&gt;An endpoint to update task status.&lt;/li&gt;
&lt;li&gt;An endpoint to delete tasks.&lt;/li&gt;
&lt;li&gt;Input validation and error responses.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can test your endpoints with tools such as Postman or curl.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;REST APIs provide a common way for different applications to communicate.&lt;/p&gt;

&lt;p&gt;Understanding HTTP methods, status codes, JSON, and security practices gives you a strong foundation for backend and full-stack development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which backend technology do you prefer for building REST APIs: Node.js, ASP.NET Core, Django, Laravel, or something else?&lt;/p&gt;

&lt;h1&gt;
  
  
  RESTAPI #WebDevelopment #JavaScript #BackendDevelopment #Programming #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>programming</category>
      <category>api</category>
    </item>
    <item>
      <title>SQL vs NoSQL: How to Choose the Right Database for Your Application</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Thu, 19 Nov 2026 03:40:07 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/sql-vs-nosql-how-to-choose-the-right-database-for-your-application-5ccg</link>
      <guid>https://dev.to/abdulhaseebmari/sql-vs-nosql-how-to-choose-the-right-database-for-your-application-5ccg</guid>
      <description>&lt;p&gt;Choosing a database is an important decision in application development.&lt;/p&gt;

&lt;p&gt;A database affects how information is stored, retrieved, updated, and managed.&lt;/p&gt;

&lt;p&gt;Two widely used database categories are SQL and NoSQL.&lt;/p&gt;

&lt;p&gt;Both are useful, but they solve different data-management requirements.&lt;/p&gt;

&lt;p&gt;Let's understand their differences with practical examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is an SQL database?
&lt;/h2&gt;

&lt;p&gt;SQL databases are relational databases that organize information into tables containing rows and columns.&lt;/p&gt;

&lt;p&gt;They commonly use Structured Query Language (SQL) to manage and retrieve data.&lt;/p&gt;

&lt;p&gt;Popular examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Microsoft SQL Server&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;id&lt;/th&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;email&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Ali&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:ali@example.com"&gt;ali@example.com&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Sara&lt;/td&gt;
&lt;td&gt;&lt;a href="mailto:sara@example.com"&gt;sara@example.com&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A simple query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This retrieves the name and email of the user whose ID is 1.&lt;/p&gt;

&lt;h3&gt;
  
  
  When is SQL useful?
&lt;/h3&gt;

&lt;p&gt;SQL databases are often a good choice when applications require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured information&lt;/li&gt;
&lt;li&gt;Relationships between records&lt;/li&gt;
&lt;li&gt;Complex queries&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;Strong consistency requirements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, banking systems and inventory applications often benefit from relational data structures and transactional operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What is a NoSQL database?
&lt;/h2&gt;

&lt;p&gt;NoSQL databases use data models that do not rely exclusively on traditional relational tables.&lt;/p&gt;

&lt;p&gt;Depending on the database, information may be stored as documents, key-value pairs, graphs, or wide-column records.&lt;/p&gt;

&lt;p&gt;Popular examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Apache Cassandra&lt;/li&gt;
&lt;li&gt;Neo4j&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example document:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Ali"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ali@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"skills"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"Python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"JavaScript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"SQL"&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This document stores related information together in a flexible structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  When is NoSQL useful?
&lt;/h3&gt;

&lt;p&gt;NoSQL databases can be suitable when applications require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexible data models&lt;/li&gt;
&lt;li&gt;Particular access patterns&lt;/li&gt;
&lt;li&gt;Large-scale distributed data storage&lt;/li&gt;
&lt;li&gt;High-volume key-value operations&lt;/li&gt;
&lt;li&gt;Graph-based relationship queries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best choice depends on the database type and the application's workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Main differences
&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;SQL&lt;/th&gt;
&lt;th&gt;NoSQL&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data model&lt;/td&gt;
&lt;td&gt;Relational tables&lt;/td&gt;
&lt;td&gt;Multiple data models&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema&lt;/td&gt;
&lt;td&gt;Usually predefined&lt;/td&gt;
&lt;td&gt;Varies by database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Query language&lt;/td&gt;
&lt;td&gt;SQL&lt;/td&gt;
&lt;td&gt;Database-specific&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relationships&lt;/td&gt;
&lt;td&gt;Relational joins&lt;/td&gt;
&lt;td&gt;Varies by model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transactions&lt;/td&gt;
&lt;td&gt;Commonly supported&lt;/td&gt;
&lt;td&gt;Depends on database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Examples&lt;/td&gt;
&lt;td&gt;PostgreSQL, SQLite&lt;/td&gt;
&lt;td&gt;MongoDB, Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Neither category is automatically better.&lt;/p&gt;

&lt;p&gt;Modern SQL databases can support flexible data structures, while NoSQL databases can provide transactional guarantees. Always evaluate the actual capabilities of the specific product.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A practical example
&lt;/h2&gt;

&lt;p&gt;Imagine building an online shopping application.&lt;/p&gt;

&lt;p&gt;You may need to store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customers&lt;/li&gt;
&lt;li&gt;Products&lt;/li&gt;
&lt;li&gt;Orders&lt;/li&gt;
&lt;li&gt;Payments&lt;/li&gt;
&lt;li&gt;Inventory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A relational database can be an excellent fit because these records have clear relationships and transactional requirements.&lt;/p&gt;

&lt;p&gt;Now imagine building a caching system that needs extremely fast access to temporary values.&lt;/p&gt;

&lt;p&gt;A key-value database such as Redis may be more appropriate.&lt;/p&gt;

&lt;p&gt;The important lesson is to match the technology to the workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Questions to ask before choosing
&lt;/h2&gt;

&lt;p&gt;Before selecting a database, consider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is the data structured or flexible?&lt;/li&gt;
&lt;li&gt;What types of queries will the application perform?&lt;/li&gt;
&lt;li&gt;Are relationships between records important?&lt;/li&gt;
&lt;li&gt;What consistency requirements exist?&lt;/li&gt;
&lt;li&gt;How much data is expected?&lt;/li&gt;
&lt;li&gt;What operational and maintenance skills are available?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Database selection should be based on requirements, not popularity.&lt;/p&gt;

&lt;p&gt;SQL and NoSQL are both important parts of modern software development. Understanding their strengths helps developers make better architectural decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which database do you prefer for your projects, and why?&lt;/p&gt;

&lt;h1&gt;
  
  
  SQL #NoSQL #Database #BackendDevelopment #Programming #SoftwareArchitecture
&lt;/h1&gt;

</description>
      <category>tutorial</category>
      <category>python</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Understanding Time Complexity: Why Some Algorithms Are Faster Than Others</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Thu, 19 Nov 2026 03:39:20 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/understanding-time-complexity-why-some-algorithms-are-faster-than-others-27o0</link>
      <guid>https://dev.to/abdulhaseebmari/understanding-time-complexity-why-some-algorithms-are-faster-than-others-27o0</guid>
      <description>&lt;p&gt;When learning programming, developers often focus on whether their code produces the correct result.&lt;/p&gt;

&lt;p&gt;But there is another important question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How efficiently does the code solve the problem?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two algorithms can produce exactly the same output while requiring very different amounts of time as the input grows.&lt;/p&gt;

&lt;p&gt;This is where time complexity becomes useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is time complexity?
&lt;/h2&gt;

&lt;p&gt;Time complexity describes how an algorithm's running time grows as the size of its input increases.&lt;/p&gt;

&lt;p&gt;It is commonly expressed using Big O notation.&lt;/p&gt;

&lt;p&gt;Big O helps developers discuss algorithm efficiency without depending on a particular computer's processor speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. O(1) — Constant time
&lt;/h2&gt;

&lt;p&gt;An operation with constant time complexity takes approximately the same number of steps regardless of input size.&lt;/p&gt;

&lt;p&gt;Example:&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;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&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;print&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accessing an element by index in a Python list is typically O(1).&lt;/p&gt;

&lt;p&gt;The operation does not need to search through every element.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. O(n) — Linear time
&lt;/h2&gt;

&lt;p&gt;Linear time complexity grows proportionally with the input size.&lt;/p&gt;

&lt;p&gt;Example:&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;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&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;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there are 5 elements, the loop processes 5 elements.&lt;/p&gt;

&lt;p&gt;If there are 1,000 elements, it processes 1,000 elements.&lt;/p&gt;

&lt;p&gt;The amount of work grows with the input size.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. O(n²) — Quadratic time
&lt;/h2&gt;

&lt;p&gt;Quadratic complexity commonly appears when an algorithm uses nested loops over the same collection.&lt;/p&gt;

&lt;p&gt;Example:&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="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With 4 elements, the inner operation runs 16 times.&lt;/p&gt;

&lt;p&gt;With 100 elements, it runs 10,000 times.&lt;/p&gt;

&lt;p&gt;This growth can become expensive for larger inputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. O(log n) — Logarithmic time
&lt;/h2&gt;

&lt;p&gt;Logarithmic complexity appears in algorithms that repeatedly reduce the remaining search space.&lt;/p&gt;

&lt;p&gt;A classic example is binary search.&lt;/p&gt;

&lt;p&gt;Binary search works on sorted data:&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;def&lt;/span&gt; &lt;span class="nf"&gt;binary_search&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;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&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="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;middle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;

        &lt;span class="k"&gt;if&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;middle&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;middle&lt;/span&gt;

        &lt;span class="k"&gt;if&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;middle&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;middle&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;middle&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of checking every element, binary search eliminates approximately half of the remaining search space after each comparison.&lt;/p&gt;

&lt;p&gt;This makes it much more efficient than a linear search for sufficiently large sorted collections.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparing common time complexities
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Complexity&lt;/th&gt;
&lt;th&gt;General behavior&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;Constant&lt;/td&gt;
&lt;td&gt;Array index access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O(log n)&lt;/td&gt;
&lt;td&gt;Logarithmic&lt;/td&gt;
&lt;td&gt;Binary search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O(n)&lt;/td&gt;
&lt;td&gt;Linear&lt;/td&gt;
&lt;td&gt;Single loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O(n log n)&lt;/td&gt;
&lt;td&gt;Linearithmic&lt;/td&gt;
&lt;td&gt;Efficient comparison sorting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;O(n²)&lt;/td&gt;
&lt;td&gt;Quadratic&lt;/td&gt;
&lt;td&gt;Nested loops&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These describe growth rates, not exact execution times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should developers care?
&lt;/h2&gt;

&lt;p&gt;Understanding time complexity helps developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose suitable algorithms.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary repeated operations.&lt;/li&gt;
&lt;li&gt;Build applications that handle larger datasets.&lt;/li&gt;
&lt;li&gt;Identify potential performance bottlenecks.&lt;/li&gt;
&lt;li&gt;Make better technical decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, Big O is not the only performance consideration. Memory usage, implementation details, hardware, and real-world input sizes also matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Writing code that works is important. Understanding how efficiently it works is another step toward becoming a stronger developer.&lt;/p&gt;

&lt;p&gt;You don't need advanced mathematics to start learning algorithm analysis.&lt;/p&gt;

&lt;p&gt;Begin by recognizing common patterns such as loops, nested loops, and repeated reductions of search space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which time complexity did you find most difficult to understand when learning programming?&lt;/p&gt;

&lt;h1&gt;
  
  
  Algorithms #BigO #DataStructures #Programming #ComputerScience #SoftwareDevelopment
&lt;/h1&gt;

</description>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Git and GitHub Explained: A Practical Workflow for Beginner Developers</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Wed, 18 Nov 2026 03:51:27 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/git-and-github-explained-a-practical-workflow-for-beginner-developers-4fea</link>
      <guid>https://dev.to/abdulhaseebmari/git-and-github-explained-a-practical-workflow-for-beginner-developers-4fea</guid>
      <description>&lt;p&gt;If you're learning software development, understanding Git is one of the most useful skills you can develop.&lt;/p&gt;

&lt;p&gt;Many beginners think Git is simply a platform for uploading code. In reality, Git is a version control system that helps developers track changes, maintain project history, and collaborate.&lt;/p&gt;

&lt;p&gt;GitHub is a hosting platform where Git repositories can be stored and shared.&lt;/p&gt;

&lt;p&gt;Let's understand a practical workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Initialize a repository
&lt;/h2&gt;

&lt;p&gt;Inside your project directory, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a local Git repository.&lt;/p&gt;

&lt;p&gt;Git can now track changes made to files in that project.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Check the current status
&lt;/h2&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows which files have changed, which files are untracked, and which changes are staged.&lt;/p&gt;

&lt;p&gt;Checking status regularly helps you understand exactly what you are preparing to commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Stage your changes
&lt;/h2&gt;

&lt;p&gt;To stage a specific file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stage all changes in the current directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Staging allows you to choose which changes should be included in the next commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Create a commit
&lt;/h2&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit -m &lt;span class="s2"&gt;"Add initial application functionality"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A commit records a snapshot of your staged changes.&lt;/p&gt;

&lt;p&gt;Use clear commit messages that explain what you changed.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Fix login validation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Add settings page&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Improve application startup&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Update documentation&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Connect to GitHub
&lt;/h2&gt;

&lt;p&gt;After creating a repository on GitHub, connect your local repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin YOUR_REPOSITORY_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the placeholder with your actual repository URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Push your code
&lt;/h2&gt;

&lt;p&gt;For a new repository, you can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch -M main
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your local commits are now uploaded to the remote repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Understand the everyday workflow
&lt;/h2&gt;

&lt;p&gt;A simple development cycle looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
git add .
git commit -m &lt;span class="s2"&gt;"Describe your changes"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before committing, review the changes to make sure you are not accidentally including sensitive information.&lt;/p&gt;

&lt;p&gt;Never upload passwords, API keys, private tokens, or personal credentials to a public repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Useful Git commands
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View commit history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git diff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspect unstaged changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List branches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git switch -c feature-name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create and switch to a branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetch and integrate remote changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git clone URL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy a remote repository locally&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Git helps developers work with confidence because changes can be tracked and reviewed over time.&lt;/p&gt;

&lt;p&gt;You don't need to memorize every command immediately. Start with the basic workflow and gradually learn more as your projects become larger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Which Git command do you use most often in your development workflow?&lt;/p&gt;

&lt;h1&gt;
  
  
  Git #GitHub #VersionControl #Programming #OpenSource #DeveloperTools
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>opensource</category>
    </item>
    <item>
      <title>7 Clean Code Practices Every Beginner Developer Should Learn</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Wed, 18 Nov 2026 03:50:39 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/7-clean-code-practices-every-beginner-developer-should-learn-1agc</link>
      <guid>https://dev.to/abdulhaseebmari/7-clean-code-practices-every-beginner-developer-should-learn-1agc</guid>
      <description>&lt;p&gt;Learning programming is an exciting process. You learn variables, conditions, loops, functions, classes, and eventually start building real applications.&lt;/p&gt;

&lt;p&gt;But there is an important lesson that every developer should understand:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code that works is not necessarily code that is easy to maintain.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clean code makes projects easier to understand, debug, extend, and collaborate on.&lt;/p&gt;

&lt;p&gt;Here are seven practical practices worth learning early.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choose meaningful names
&lt;/h2&gt;

&lt;p&gt;Consider these two examples:&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;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare them with:&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;product_price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;
&lt;span class="n"&gt;discount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;
&lt;span class="n"&gt;final_price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;product_price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;discount&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both examples perform the same calculation, but the second communicates its purpose more clearly.&lt;/p&gt;

&lt;p&gt;Meaningful names reduce the need for additional explanations.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Keep functions focused
&lt;/h2&gt;

&lt;p&gt;A function should have a clear responsibility.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_total&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;quantity&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function performs one understandable task.&lt;/p&gt;

&lt;p&gt;When a function handles unrelated responsibilities, it becomes harder to test and maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Avoid unnecessary repetition
&lt;/h2&gt;

&lt;p&gt;Suppose you calculate a discounted price in several places.&lt;/p&gt;

&lt;p&gt;Instead of copying the same calculation everywhere, create a reusable function:&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;def&lt;/span&gt; &lt;span class="nf"&gt;apply_discount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;percentage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the logic has one central implementation.&lt;/p&gt;

&lt;p&gt;If the calculation needs to change, you have fewer places to update.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Handle errors appropriately
&lt;/h2&gt;

&lt;p&gt;Applications should not assume that every operation will succeed.&lt;/p&gt;

&lt;p&gt;For example, reading a file can fail because the file does not exist or the application lacks permission.&lt;/p&gt;

&lt;p&gt;Python example:&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;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"settings.txt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"r"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&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="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;FileNotFoundError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Settings file was not found."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nc"&gt;PermissionError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Permission denied."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific error handling helps applications respond more appropriately to unexpected conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Separate responsibilities
&lt;/h2&gt;

&lt;p&gt;Avoid putting every part of an application into one enormous file or class.&lt;/p&gt;

&lt;p&gt;Consider separating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User interface&lt;/li&gt;
&lt;li&gt;Business logic&lt;/li&gt;
&lt;li&gt;Data access&lt;/li&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The structure should match the project's complexity. A small script does not need an unnecessarily complicated architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Write comments that explain why
&lt;/h2&gt;

&lt;p&gt;Comments should provide useful context.&lt;/p&gt;

&lt;p&gt;A comment that simply repeats the code adds little value.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Retry because the external service may temporarily be unavailable.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This explains the reason behind the implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Review your code before considering it finished
&lt;/h2&gt;

&lt;p&gt;Before completing a feature, ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are variable names understandable?&lt;/li&gt;
&lt;li&gt;Is any logic unnecessarily repeated?&lt;/li&gt;
&lt;li&gt;Are errors handled?&lt;/li&gt;
&lt;li&gt;Can another developer understand this implementation?&lt;/li&gt;
&lt;li&gt;Have I tested the important scenarios?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code review is an opportunity to discover improvements before they become future maintenance problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Clean code is not about making every implementation complicated or following arbitrary formatting preferences.&lt;/p&gt;

&lt;p&gt;It is about making software easier for humans to understand and maintain.&lt;/p&gt;

&lt;p&gt;You don't need to master every software engineering principle before starting a project. Begin with these habits and apply them consistently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Question for developers:&lt;/strong&gt; Which clean-code practice made the biggest difference in your programming journey?&lt;/p&gt;

&lt;h1&gt;
  
  
  CleanCode #Python #Programming #SoftwareDevelopment #CodingTips #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
    <item>
      <title>The Importance of Documentation in Software Development</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Tue, 17 Nov 2026 03:44:50 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/the-importance-of-documentation-in-software-development-6j5</link>
      <guid>https://dev.to/abdulhaseebmari/the-importance-of-documentation-in-software-development-6j5</guid>
      <description>&lt;p&gt;Documentation is sometimes treated as an optional part of software development.&lt;/p&gt;

&lt;p&gt;Developers often focus on implementation, features, and fixing bugs, leaving documentation until later.&lt;/p&gt;

&lt;p&gt;But documentation plays an important role in helping software remain understandable and maintainable.&lt;/p&gt;

&lt;p&gt;A project may work perfectly today, but what happens when another developer needs to understand it? What happens when you return to the same code after several months?&lt;/p&gt;

&lt;p&gt;This is where good documentation becomes valuable.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Explain the purpose of the project
&lt;/h2&gt;

&lt;p&gt;A project should have a clear introduction explaining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the application does&lt;/li&gt;
&lt;li&gt;Which problems it addresses&lt;/li&gt;
&lt;li&gt;Who it is designed for&lt;/li&gt;
&lt;li&gt;What technologies it uses&lt;/li&gt;
&lt;li&gt;How users can get started&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A well-written README is often the first place developers look.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Document installation and configuration
&lt;/h2&gt;

&lt;p&gt;Installation instructions should explain the requirements and steps needed to run the application.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Required software and runtimes&lt;/li&gt;
&lt;li&gt;Supported operating systems&lt;/li&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;Environment variables&lt;/li&gt;
&lt;li&gt;Build and execution instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Never include passwords, API keys, or other confidential credentials in public documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Explain complex decisions
&lt;/h2&gt;

&lt;p&gt;Not every line of code needs an explanation.&lt;/p&gt;

&lt;p&gt;However, unusual implementation choices and complex workflows often deserve additional context.&lt;/p&gt;

&lt;p&gt;Documenting why a particular approach was selected can help future developers avoid repeating the same investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Keep documentation updated
&lt;/h2&gt;

&lt;p&gt;Outdated documentation can be more confusing than having no documentation at all.&lt;/p&gt;

&lt;p&gt;When functionality changes, relevant instructions should be reviewed and updated.&lt;/p&gt;

&lt;p&gt;Documentation should describe how the software actually works, not how an earlier version worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Make it easy to navigate
&lt;/h2&gt;

&lt;p&gt;Good documentation should be organized.&lt;/p&gt;

&lt;p&gt;Useful headings, short explanations, code examples, and clear installation steps make information easier to find.&lt;/p&gt;

&lt;p&gt;Avoid writing unnecessarily complicated explanations when a simple example can communicate the same idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation improves collaboration
&lt;/h2&gt;

&lt;p&gt;Documentation is valuable even when working alone.&lt;/p&gt;

&lt;p&gt;It helps developers remember project decisions, understand older implementations, and maintain consistent development practices.&lt;/p&gt;

&lt;p&gt;For teams, it also reduces the amount of information that needs to be repeatedly explained.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Writing code creates functionality. Documentation helps people understand and maintain that functionality.&lt;/p&gt;

&lt;p&gt;Both are important parts of professional software development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much attention do you give documentation when building your projects?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Documentation #SoftwareDevelopment #Programming #OpenSource #DeveloperTools
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
    <item>
      <title>What I Consider Before Starting a New Software Project?</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Tue, 17 Nov 2026 03:44:04 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/what-i-consider-before-starting-a-new-software-project-1k0k</link>
      <guid>https://dev.to/abdulhaseebmari/what-i-consider-before-starting-a-new-software-project-1k0k</guid>
      <description>&lt;p&gt;Starting a software project is exciting. There is an idea, a goal, and an opportunity to turn something conceptual into a working application.&lt;/p&gt;

&lt;p&gt;However, beginning development without proper planning can create unnecessary problems later.&lt;/p&gt;

&lt;p&gt;Over time, I've come to appreciate the importance of thinking through a project before writing its first lines of code.&lt;/p&gt;

&lt;p&gt;Here are five areas I believe every developer should consider.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Define the actual problem
&lt;/h2&gt;

&lt;p&gt;Before choosing a programming language or framework, understand what the application is supposed to accomplish.&lt;/p&gt;

&lt;p&gt;Ask questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What problem does this project solve?&lt;/li&gt;
&lt;li&gt;Who is the intended user?&lt;/li&gt;
&lt;li&gt;What is the most important functionality?&lt;/li&gt;
&lt;li&gt;What would make the application useful?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A clear problem statement provides direction throughout development.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Identify the essential features
&lt;/h2&gt;

&lt;p&gt;It can be tempting to include every possible feature in the first version.&lt;/p&gt;

&lt;p&gt;However, excessive scope can slow development and make testing more difficult.&lt;/p&gt;

&lt;p&gt;I prefer identifying the essential features first and treating additional functionality as future improvements.&lt;/p&gt;

&lt;p&gt;This makes it easier to establish a realistic starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Choose technologies based on requirements
&lt;/h2&gt;

&lt;p&gt;A technology should be selected because it fits the project, not simply because it is popular.&lt;/p&gt;

&lt;p&gt;Consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Platform compatibility&lt;/li&gt;
&lt;li&gt;Performance requirements&lt;/li&gt;
&lt;li&gt;Development complexity&lt;/li&gt;
&lt;li&gt;Available libraries&lt;/li&gt;
&lt;li&gt;Long-term maintenance&lt;/li&gt;
&lt;li&gt;Target hardware&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The right technology is the one that supports the project's actual needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Think about the user experience
&lt;/h2&gt;

&lt;p&gt;Technical functionality is important, but users interact with the application through its interface and workflows.&lt;/p&gt;

&lt;p&gt;Consider how users will navigate the software, understand its features, and recover from mistakes.&lt;/p&gt;

&lt;p&gt;An application should be understandable without requiring users to become technical experts.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Plan for future improvements
&lt;/h2&gt;

&lt;p&gt;Even a small project benefits from organized code and a maintainable structure.&lt;/p&gt;

&lt;p&gt;Clear naming, separation of responsibilities, and useful documentation make future development easier.&lt;/p&gt;

&lt;p&gt;You don't need to build a complicated architecture for every project. You need a structure appropriate to its size and requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;A successful software project does not begin with writing the most code.&lt;/p&gt;

&lt;p&gt;It begins with understanding the problem and making thoughtful decisions.&lt;/p&gt;

&lt;p&gt;Planning does not eliminate every challenge, but it gives developers a much stronger foundation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the first thing you consider before starting a new software project?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  SoftwareDevelopment #Programming #ProjectPlanning #DeveloperJourney #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why I Believe Every Developer Should Understand Performance Optimization?</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Mon, 16 Nov 2026 04:30:58 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/why-i-believe-every-developer-should-understand-performance-optimization-544g</link>
      <guid>https://dev.to/abdulhaseebmari/why-i-believe-every-developer-should-understand-performance-optimization-544g</guid>
      <description>&lt;p&gt;Software functionality is important, but functionality alone does not guarantee a good application.&lt;/p&gt;

&lt;p&gt;An application can have excellent features and an attractive interface while still delivering a poor experience because it consumes too many system resources.&lt;/p&gt;

&lt;p&gt;Performance optimization should be considered throughout development, not only after users start reporting problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the main resources
&lt;/h2&gt;

&lt;p&gt;Desktop applications commonly depend on several system resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CPU usage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unnecessary calculations, inefficient loops, and excessive background operations can increase processor usage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory consumption&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Applications should avoid retaining objects and data that are no longer needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storage operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Frequent unnecessary disk access can affect responsiveness, particularly on computers using traditional hard drives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Startup time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Users should not have to wait unnecessarily before they can access an application's main functionality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical ways to improve application performance
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Avoid unnecessary background work
&lt;/h3&gt;

&lt;p&gt;Background operations should have a clear purpose. Do not continuously execute tasks when there is nothing useful to process.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Use asynchronous operations appropriately
&lt;/h3&gt;

&lt;p&gt;Long-running operations should not block the main user interface thread.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Load information when needed
&lt;/h3&gt;

&lt;p&gt;Instead of loading every resource immediately, consider loading some data only when the user accesses the relevant feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Measure before optimizing
&lt;/h3&gt;

&lt;p&gt;Use profiling and monitoring tools to identify actual bottlenecks.&lt;/p&gt;

&lt;p&gt;Optimizing code without understanding the performance problem can waste development time.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Test on different hardware
&lt;/h3&gt;

&lt;p&gt;An application that performs well on a powerful workstation might struggle on an older computer.&lt;/p&gt;

&lt;p&gt;Testing on realistic hardware helps identify problems that might otherwise remain unnoticed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance is part of user experience
&lt;/h2&gt;

&lt;p&gt;A responsive application feels more reliable. Faster operations, reasonable memory usage, and smooth navigation make everyday tasks more comfortable.&lt;/p&gt;

&lt;p&gt;Developers should treat performance as an important product requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Good performance is not achieved by removing every feature or sacrificing usability.&lt;/p&gt;

&lt;p&gt;It comes from making thoughtful technical decisions and using system resources responsibly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When evaluating desktop software, what matters most to you: startup speed, memory usage, CPU usage, or overall responsiveness?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  PerformanceOptimization #DesktopDevelopment #WindowsDevelopment #SoftwareEngineering #Programming
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The Difference Between Writing Code and Thinking Like a Developer?</title>
      <dc:creator>Abdul Haseeb Mari</dc:creator>
      <pubDate>Mon, 16 Nov 2026 04:30:15 +0000</pubDate>
      <link>https://dev.to/abdulhaseebmari/the-difference-between-writing-code-and-thinking-like-a-developer-17f3</link>
      <guid>https://dev.to/abdulhaseebmari/the-difference-between-writing-code-and-thinking-like-a-developer-17f3</guid>
      <description>&lt;p&gt;Anyone can begin learning a programming language. But becoming a good software developer requires something more than knowing syntax.&lt;/p&gt;

&lt;p&gt;It requires learning how to think.&lt;/p&gt;

&lt;p&gt;Writing code is only one part of software development. Understanding problems, planning solutions, making technical decisions, and considering the user experience are equally important.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understand the problem before writing code
&lt;/h2&gt;

&lt;p&gt;One common mistake beginners make is immediately opening their editor and starting to write code.&lt;/p&gt;

&lt;p&gt;Before implementation, ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What problem am I trying to solve?&lt;/li&gt;
&lt;li&gt;Who will use this application?&lt;/li&gt;
&lt;li&gt;What should the application accomplish?&lt;/li&gt;
&lt;li&gt;What could go wrong?&lt;/li&gt;
&lt;li&gt;Is there a simpler solution?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding the requirements first can save significant development time.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Break complicated problems into smaller tasks
&lt;/h2&gt;

&lt;p&gt;Large problems can feel overwhelming.&lt;/p&gt;

&lt;p&gt;Instead of trying to build an entire application at once, divide the work into manageable components.&lt;/p&gt;

&lt;p&gt;For example, a desktop application might require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User interface&lt;/li&gt;
&lt;li&gt;Application settings&lt;/li&gt;
&lt;li&gt;Data management&lt;/li&gt;
&lt;li&gt;Core functionality&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;li&gt;Performance optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developing and testing these components individually makes the project easier to manage.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Focus on maintainable code
&lt;/h2&gt;

&lt;p&gt;Code should not only work today. It should also be understandable when you return to it weeks or months later.&lt;/p&gt;

&lt;p&gt;Meaningful naming, organized files, reusable components, and clear responsibilities make software easier to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Consider the user, not just the implementation
&lt;/h2&gt;

&lt;p&gt;A technically impressive application can still be frustrating if users cannot understand how to operate it.&lt;/p&gt;

&lt;p&gt;Think about navigation, accessibility, responsiveness, and the number of steps required to complete common tasks.&lt;/p&gt;

&lt;p&gt;Good software should make complicated tasks feel simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Learn from every development decision
&lt;/h2&gt;

&lt;p&gt;Not every solution will be perfect.&lt;/p&gt;

&lt;p&gt;Sometimes you will discover that your original approach creates unnecessary complexity. Recognizing this and improving the design is part of becoming an experienced developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Programming teaches you how to write instructions for computers. Software development teaches you how to solve problems for people.&lt;/p&gt;

&lt;p&gt;The goal should not simply be to write more code. It should be to build better solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you think is the most important skill a software developer should develop beyond programming?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  SoftwareDevelopment #Programming #ProblemSolving #CleanCode #DeveloperJourney
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>security</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
