<?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: jana009</title>
    <description>The latest articles on DEV Community by jana009 (@jana009).</description>
    <link>https://dev.to/jana009</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%2F572152%2Fe44a989d-0cc5-407e-9cc0-7083978855db.png</url>
      <title>DEV Community: jana009</title>
      <link>https://dev.to/jana009</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jana009"/>
    <language>en</language>
    <item>
      <title>Stop Stashing! Use Git Worktree to Handle Hotfixes Parallelly</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Sat, 18 Jul 2026 17:46:05 +0000</pubDate>
      <link>https://dev.to/jana009/stop-stashing-use-git-worktree-to-handle-hotfixes-parallelly-219p</link>
      <guid>https://dev.to/jana009/stop-stashing-use-git-worktree-to-handle-hotfixes-parallelly-219p</guid>
      <description>&lt;p&gt;Today I learned about a game-changer for my Git workflow: &lt;strong&gt;Git Worktree&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you've ever been in the middle of a complex feature and suddenly had to drop everything to fix a critical bug on another branch, you probably reached for &lt;code&gt;git stash&lt;/code&gt;. While stashing works, it can be a hassle to manage multiple stashes and keep track of where you left off.&lt;/p&gt;

&lt;p&gt;Here is how &lt;code&gt;git worktree&lt;/code&gt; allows you to work on multiple branches simultaneously without touching git stash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem with the "Stash" Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually, when a hotfix comes in, we do this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;git stash&lt;/code&gt; (Save current changes)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git checkout main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git checkout -b hotfix-branch&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fix the bug, commit, and push.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git checkout original-branch&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash pop&lt;/code&gt; (Try to remember what we were doing)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This context switching is slow and can lead to merge conflicts or lost work if you have a messy stash history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Git Worktree&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of switching branches in your current directory, &lt;em&gt;git worktree&lt;/em&gt; lets you create a separate directory for a specific branch. This allows you to open both branches in different windows of your IDE and work on them at the exact same time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Adding a Worktree&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a new folder in your parent directory for a hotfix, 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 worktree add ../hotfix-bug &lt;span class="nt"&gt;-b&lt;/span&gt; hotfix-bug main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a new folder named &lt;code&gt;hotfix-bug&lt;/code&gt; one level up from your current folder.&lt;/li&gt;
&lt;li&gt;Creates a new branch called &lt;code&gt;hotfix-bug&lt;/code&gt; based on main.&lt;/li&gt;
&lt;li&gt;Checks out that branch into that new folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you can simply open a new VS Code window (or your preferred editor) in that ../hotfix-bug folder and fix the bug while your main project remains exactly as you left it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Committing and Pushing&lt;/strong&gt;&lt;br&gt;
In the new folder, you can follow your usual flow:&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;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Fixed the critical bug"&lt;/span&gt;
git push origin hotfix-bug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Cleaning Up
Once the bug fix is merged and you no longer need the parallel folder, it’s important to keep your worktree clean. Move back to your main project directory and run:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ../main
git worktree remove ../hotfix-bug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This deletes the temporary folder and unregisters it from Git, leaving your environment tidy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git worktree&lt;/code&gt; is perfect for those "drop everything and fix this" moments. It keeps your main workspace clean and prevents the "stash-and-dash" headaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;

&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://github.blog/ai-and-ml/github-copilot/what-are-git-worktrees-and-why-should-i-use-them/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.blog%2Fwp-content%2Fuploads%2F2026%2F01%2Fgeneric-mona-github.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://github.blog/ai-and-ml/github-copilot/what-are-git-worktrees-and-why-should-i-use-them/" rel="noopener noreferrer" class="c-link"&gt;
            What are git worktrees, and why should I use them? - The GitHub Blog
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Git worktrees have been around since 2015, but it wasn't until recently they became popular. Learn what they are, how to use them, and why you might.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicon.ico"&gt;
          github.blog
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
&lt;br&gt;
    &lt;div class="c-embed__content"&gt;
&lt;br&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
&lt;br&gt;
        &lt;a href="https://git-scm.com/docs/git-worktree" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;&lt;br&gt;
          &lt;span class="mr-2"&gt;git-scm.com&lt;/span&gt;&lt;br&gt;
          
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;/a&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>worktree</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Exception Handling</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Sat, 23 Sep 2023 20:45:35 +0000</pubDate>
      <link>https://dev.to/jana009/exception-handling-3opi</link>
      <guid>https://dev.to/jana009/exception-handling-3opi</guid>
      <description>&lt;p&gt;Hi Guys,&lt;/p&gt;

&lt;p&gt;In programming, lots of time we face errors. As a programmer we need to know how to handle those unexpected scenario in a best way so that's why we are going to see about &lt;strong&gt;Exception Handling&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Exception:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Exception&lt;/strong&gt; is an unwanted or unexpected situation which causes the program to &lt;strong&gt;&lt;em&gt;terminate abnormally&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Default Exception Handler:
&lt;/h2&gt;

&lt;p&gt;When executing the program if an exception occurs then the method in which the exception created is responsible to create the &lt;strong&gt;Exception Object&lt;/strong&gt;.The Exception Object Contains 3 information&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name of the Exception&lt;/li&gt;
&lt;li&gt;Description of the Exception&lt;/li&gt;
&lt;li&gt;Stack trace(provide the information from which method and which line exactly the error occurs) and handover this object to the JVM(Java Virtual Machine).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then JVM gives the object to &lt;strong&gt;&lt;em&gt;Default Exception Handler&lt;/em&gt;&lt;/strong&gt; and terminates the program abnormally without executing rest of the lines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example with no Exception:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        int num=10/2;
        System.out.println("Print the A Value  "+num);
        System.out.println("End of the Program! ");

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cu_JTRiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihq0u8l8gu0razt2fb6h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cu_JTRiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihq0u8l8gu0razt2fb6h.png" alt="Without Exception" width="336" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example with Exception
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        int num=10/0;
        System.out.println("Print the A Value  "+num);
        System.out.println("End of the Program! ");

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xPCr_cFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh6pzdbciuzqhsf1j8jw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xPCr_cFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh6pzdbciuzqhsf1j8jw.png" alt="With Exception" width="433" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Example Without Exception the program runs successfully and we got the output but in the Example with Exception the program terminates abruptly without executing the rest of the lines and prints the details of the Exception &lt;strong&gt;ArithmeticException&lt;/strong&gt;.&lt;br&gt;
In above exception exception example&lt;br&gt;
&lt;em&gt;ArithmeticException&lt;/em&gt; =&amp;gt; Name of the Exception&lt;br&gt;
&lt;em&gt;/ by zero&lt;/em&gt; =&amp;gt; Description of the Exception&lt;br&gt;
&lt;em&gt;at ExcepExample.main(ExcepExample.java:4)&lt;/em&gt; =&amp;gt; Is the stack trace.&lt;/p&gt;

&lt;p&gt;So as programmer we need to handle this scenario and make program to terminate in normal way.&lt;/p&gt;

&lt;p&gt;For that will use try...catch&lt;/p&gt;

&lt;h2&gt;
  
  
  Try...Catch
&lt;/h2&gt;

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

&lt;p&gt;&lt;code&gt;try{&lt;br&gt;
    //code Which cause the Exception&lt;br&gt;
}Catch(Exception ex){&lt;br&gt;
   // Customize the how to display the exception&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        try{
                int num=10/0;
                System.out.println("Print the A Value  "+num);
        }catch(ArithmeticException ex){
            ex.printStackTrace();
       }

        System.out.println("End of the Program! ");

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qHzvpxTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i19su9jjiulzxn86hved.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qHzvpxTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i19su9jjiulzxn86hved.png" alt="try...catch" width="374" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>exception</category>
      <category>programming</category>
    </item>
    <item>
      <title>Callback Function</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Fri, 29 Jul 2022 19:06:54 +0000</pubDate>
      <link>https://dev.to/jana009/callback-function-3dml</link>
      <guid>https://dev.to/jana009/callback-function-3dml</guid>
      <description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;Today we are going to discuss the &lt;strong&gt;Callback function&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Callback is the one of the weird concept if you people are coming from the &lt;strong&gt;C&lt;/strong&gt; programming language.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Callback&lt;/em&gt;&lt;/strong&gt; is nothing but a function which is passed as an parameter to the other function and being used  inside that(the function where it is passed as an parameter.) function&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;function greeting(name) {&lt;br&gt;
  alert('Hello ' + name);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function processUserInput(callback) {&lt;br&gt;
  var name = prompt('Please enter your name.');&lt;br&gt;
  callback(name);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;processUserInput(greeting);&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Callback_function"&gt;Example Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snippet Explanation :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First the &lt;strong&gt;proceessUserInput&lt;/strong&gt; method executes which takes &lt;strong&gt;greeting&lt;/strong&gt; function as an parameter, Where the first line of the method asks as to type the name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second line where the &lt;strong&gt;greeting&lt;/strong&gt;(callback) function calls which the function inside the other function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It takes name output from the &lt;strong&gt;processUserInput&lt;/strong&gt; and alerts the greeting message.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;OUTPUT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Please enter your name.  John&lt;/p&gt;

&lt;p&gt;Hello John&lt;/p&gt;

&lt;p&gt;That's it 😃 &lt;/p&gt;

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

&lt;p&gt;Comment your feedback to boost up 💪 my writing &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Javascript</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Sat, 25 Jun 2022 19:32:13 +0000</pubDate>
      <link>https://dev.to/jana009/javascript-cgg</link>
      <guid>https://dev.to/jana009/javascript-cgg</guid>
      <description>&lt;p&gt;Hello👋&lt;/p&gt;

&lt;p&gt;It's my first blog so i am not familiar with writing the blog...So could you provide me tips and feedbacks that needs to improved in the comment section .Thanks in advance!!!&lt;/p&gt;

&lt;p&gt;Javascript is a scripting language which was used for manipulating dom but now it becomes more powerful with different frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Javascript Data types:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Primitive Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Primitive types the datas are stored as values in memory(Call by value) and are fixed in size&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - Boolean
  - Null
  - Undefined
  - Number
  - String
  - Symbol
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Non-Primitive Type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Non-Primitive types the datas are stored in memory with its address and reference the value(Call by reference).It is not in fixed size&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  -Objects
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Boolean&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It is either &lt;em&gt;true&lt;/em&gt; or &lt;em&gt;false&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: var isOdd =true;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Null&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript null is an type where it as absence of any type.(i.e no memory was created for that particular value)&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: var name=null;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Undefined&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It means the variable with out any value.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var name;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Number&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript both integer and floating values are assigned with 'Number' type&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var value1=5;/var value2=5.2&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;String&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It is a combination of characters&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var greeting="hello";&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Objects&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript objects are key and value pair&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var name={firstName:"john",&lt;br&gt;
lastName:"doe"&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>basics</category>
      <category>datatypes</category>
    </item>
  </channel>
</rss>
