<?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: Raziq Din</title>
    <description>The latest articles on DEV Community by Raziq Din (@raziq_din_bd0274cc2ac748b).</description>
    <link>https://dev.to/raziq_din_bd0274cc2ac748b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3439328%2F7bb3e10d-d803-4ec2-872d-8cd3591fdb66.jpg</url>
      <title>DEV Community: Raziq Din</title>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raziq_din_bd0274cc2ac748b"/>
    <language>en</language>
    <item>
      <title>Getting Started with Ollama: From Installation to Testing</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Mon, 16 Feb 2026 21:04:35 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/getting-started-with-ollama-from-installation-to-testing-281o</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/getting-started-with-ollama-from-installation-to-testing-281o</guid>
      <description>&lt;p&gt;If you want to run your AI models locally without relying on a cloud API (like ChatGPT public website) , Ollama could give you a way for that idea! In this guide , we will guide you on how to install Ollama , downloading a model and testing it with a simple prompt or message, everything in your terminal!&lt;/p&gt;

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

&lt;p&gt;Before that , let’s bring you to a simple introduction about Ollama. &lt;/p&gt;

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

&lt;h3&gt;
  
  
  What is Ollama?
&lt;/h3&gt;

&lt;p&gt;Ollama is an open-source framework that allows you to run Large Language Models (LLMs) like Llama 3, Mistral, and DeepSeek etc. directly on your own hardware (laptop or desktop). It handles the "heavy lifting" of AI , like managing memory, talking to your GPU, and downloading massive model files , so you can just type a command and start chatting!&lt;/p&gt;

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

&lt;p&gt;Of course you're wondering , why does Ollama exists? &lt;/p&gt;

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

&lt;h3&gt;
  
  
  Why does Ollama exists?
&lt;/h3&gt;

&lt;p&gt;before Ollama, running a model locally was a nightmare. You had to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manually download multi-gigabyte files.&lt;/li&gt;
&lt;li&gt;Configure complex Python environments and C++ libraries.&lt;/li&gt;
&lt;li&gt;Keep praying that your GPU drivers were compatible with the specific
version of the model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ollama exists to simplify this into a single click or a single terminal command. It packages the model weights, configuration, and the "inference engine" into one neat bundle!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  What are the benefits of running Ollama?
&lt;/h3&gt;

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

&lt;h5&gt;
  
  
  Privacy &amp;amp; Security:
&lt;/h5&gt;

&lt;p&gt;Your data never leaves your computer. This is a game-changer for businesses or individuals handling sensitive medical, legal, or personal data.&lt;/p&gt;

&lt;h5&gt;
  
  
  Zero Cost:
&lt;/h5&gt;

&lt;p&gt;No "per-token" fees. You pay for the electricity to run your computer, but the AI is free to use forever.&lt;/p&gt;

&lt;h5&gt;
  
  
  Offline Access:
&lt;/h5&gt;

&lt;p&gt;It works on a plane, in a basement, or anywhere without an internet connection.&lt;/p&gt;

&lt;h5&gt;
  
  
  Developer Friendly:
&lt;/h5&gt;

&lt;p&gt;It automatically sets up a local API (at localhost:11434) that mimics OpenAI's API, making it incredibly easy to build your own apps.&lt;/p&gt;

&lt;h5&gt;
  
  
  Performance Optimization:
&lt;/h5&gt;

&lt;p&gt;It uses "quantization" (shrinking the model size) to let you run powerful AI on standard consumer laptops, not just $10,000 servers.&lt;/p&gt;

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

&lt;p&gt;Without further ado, let's go through how to download Ollama , install it's models and run the model in Ollama!&lt;/p&gt;

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

&lt;h5&gt;
  
  
  1.Install Ollama
&lt;/h5&gt;

&lt;p&gt;Ollama provides both a GUI app and a command-line interface (CLI) that allows you to interact with models locally.&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to ollama official website : &lt;a href="https://ollama.com/" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download the installer for your own OS&lt;/li&gt;
&lt;li&gt;Run the installer and follow the prompts , after that , ollama can be
opened in your system&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h5&gt;
  
  
  2.Verify installation
&lt;/h5&gt;

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

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

&lt;/div&gt;



&lt;p&gt;in your command prompt as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j0ihe5j1m55ivog0ewq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j0ihe5j1m55ivog0ewq.png" alt="Verify Ollama Installation" width="530" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;h5&gt;
  
  
  3.Download a Model
&lt;/h5&gt;

&lt;p&gt;In the same terminal , if you want to download a model and start using it right away, use the run command. If the model isn't on your computer yet, Ollama will automatically pull it first. Since i have installed gemma3 , i attached a llama3 model that you can download through this command below;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funi2ow1n00eo13lqn2ay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funi2ow1n00eo13lqn2ay.png" alt="Download and run Ollama AI Models" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;h5&gt;
  
  
  4.Running the Model
&lt;/h5&gt;

&lt;p&gt;After that , you can use the run command with the model name that you have downloaded , the example is attached below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrwpielad2j714s35oap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frrwpielad2j714s35oap.png" alt="Running Ollama" width="767" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the prompt command is shown after you type the command , then congratulations! You have successfully installed and run your model locally via your command prompt!&lt;/p&gt;

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

&lt;p&gt;Here is also some responses the model will give you after you type an input!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ft0jrkjnrm8p234rlnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ft0jrkjnrm8p234rlnr.png" alt="Promptinggg" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;And there you have it! This is how you can run your AI models locally using Ollama. While running the model locally is convenient for data privacy and developer friendly , there are some notable fallbacks of running the models locally.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Notable Fallbacks
&lt;/h3&gt;

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

&lt;h5&gt;
  
  
  RAM is King:
&lt;/h5&gt;

&lt;p&gt;If you try to run a model larger than your available RAM (or VRAM on your GPU), it will either be painfully slow or crash.&lt;br&gt;
Rule of thumb: 8GB RAM for 3B–7B models; 16GB+ for 8B–13B models; 32GB+ for 30B+ models.&lt;/p&gt;

&lt;h5&gt;
  
  
  Silent GPU Fallback:
&lt;/h5&gt;

&lt;p&gt;If Ollama can't find your GPU (or it runs out of VRAM), it will silently switch to your CPU. You’ll know this happened because the response speed will drop from "lightning fast" to "one word every two seconds.”&lt;/p&gt;

&lt;h5&gt;
  
  
  Storage Hog:
&lt;/h5&gt;

&lt;p&gt;Models are HUGE in storage size. A single "medium" model (like Llama 3 8B) takes about 5GB. If you download 10 different models to "test" them, you'll lose 50GB of disk space very quickly.&lt;/p&gt;

&lt;h5&gt;
  
  
  No "Long-term" Memory:
&lt;/h5&gt;

&lt;p&gt;By default, Ollama doesn't "remember" you between different sessions unless you use a UI (like Open WebUI) or write a script to manage the conversation history.&lt;/p&gt;

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

&lt;p&gt;Even more so , Ollama plays a significant role to your future projects!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Ollama’s roles in any projects
&lt;/h3&gt;

&lt;p&gt;Ollama plays two critical roles in any project: it is the Librarian and the Engine.&lt;/p&gt;

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

&lt;h4&gt;
  
  
  The Librarian (Model Management)
&lt;/h4&gt;

&lt;p&gt;Ollama handles the "messy" parts of working with AI models so you don't have to.&lt;/p&gt;

&lt;h5&gt;
  
  
  Downloading:
&lt;/h5&gt;

&lt;p&gt;It pulls the massive model files (like Llama 3 or Mistral) from the internet.&lt;/p&gt;

&lt;h5&gt;
  
  
  Storage:
&lt;/h5&gt;

&lt;p&gt;It organizes them on your hard drive so they're ready to use.&lt;/p&gt;

&lt;h5&gt;
  
  
  Optimization:
&lt;/h5&gt;

&lt;p&gt;It "shrinks" the models (quantization) so they can &lt;br&gt;
actually run on a normal laptop instead of a giant server.&lt;br&gt;
 &lt;/p&gt;

&lt;h5&gt;
  
  
  The Engine (Inference Server)
&lt;/h5&gt;

&lt;p&gt;This is its main job during a project. Ollama sits in the background and waits for instructions.&lt;/p&gt;

&lt;h5&gt;
  
  
  The API:
&lt;/h5&gt;

&lt;p&gt;It creates a local "doorway" (at localhost:11434). Your web app or script knocks on this door and sends a prompt.&lt;/p&gt;

&lt;h5&gt;
  
  
  Brain Power:
&lt;/h5&gt;

&lt;p&gt;When a prompt arrives, Ollama "starts" the model's brain, uses your computer's RAM/GPU to think, and generates the answer.&lt;/p&gt;

&lt;h5&gt;
  
  
  Process Isolation:
&lt;/h5&gt;

&lt;p&gt;It keeps the AI separate from your code. If the AI model crashes because it ran out of memory, your actual website or app won't crash; only the Ollama "engine" stalls. &lt;/p&gt;

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

&lt;p&gt;There you have it! I'm looking forward to your upcoming projects being integrated with Ollama. Hopefully this article will be helpful to you and goodluck for your future work with Ollama! Thank you and let me know your feedback on this article. Will improve more :)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to bulk insert your data to Supabase with CSV</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Sun, 25 Jan 2026 07:29:00 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-bulk-insert-your-data-to-supabase-with-csv-386m</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-bulk-insert-your-data-to-supabase-with-csv-386m</guid>
      <description>&lt;p&gt;If you’re working with Supabase and want to import data from a CSV file, the key to a smooth import is proper CSV structure. A poorly structured CSV can lead to errors, rejected rows, or data mismatches. This article walks you through everything you need to know to prepare your CSV for Supabase.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15drhheyij1zl5asmx1d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15drhheyij1zl5asmx1d.png" alt="Supabase CSV" width="244" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;For clarification, Supabase provides a built-in feature that lets you bulk insert data into a database table using a CSV file, making it easy to import large amounts of data without writing any code. This is especially useful when inserting data one by one is impractical and when you need to ensure that each record is linked to the correct foreign key in one whole insert chunk.&lt;/p&gt;

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

&lt;p&gt;The use case might differ , but this method is very efficient and could be useful to some of the readers out there!&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8i7aytjdcpxe9tdta1sa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8i7aytjdcpxe9tdta1sa.png" alt="Drag and Drop CSV to supabase" width="629" height="871"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;To go through this tutorial , we will bring you to a situation , lets say if you are building a CMS that also stores quizzes for users , there are many situations we can think about simply by going through this task. To simplify this , we will separate the csv column and data structure in two situations : &lt;/p&gt;

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

&lt;h4&gt;
  
  
  1.Questions stored in a single table ( No FK required )
&lt;/h4&gt;

&lt;p&gt;Let's say we have a table column defined in our Supabase like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;quiz_questions
--------------
id (uuid, pk)
question_text (text)
option_a (text)
option_b (text)
option_c (text)
option_d (text)
correct_option (text)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;there are no foreign keys involved, to do this , you can construct your CSV files according to these columns below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;question_text,option_a,option_b,option_c,option_d,correct_option
What is the capital of France?,Berlin,Madrid,Paris,Rome,C
Which language runs in the browser?,Java,Python,JavaScript,C++,C

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

&lt;/div&gt;



&lt;p&gt;notice that I did not put the id values in my csv structure , this is because you don't have to provide it in the first place! You can simply leave it and let Supabase generate the id for you. &lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Disclaimer : ensure that your ID in Supabase is auto generated by the system itself to ensure non existence error occurence when submitting your csv file to Supabase.&lt;/strong&gt;&lt;/p&gt;

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

&lt;h4&gt;
  
  
  2.Questions and options stored in separate tables (FK required)
&lt;/h4&gt;

&lt;p&gt;This structure is used when questions and options are normalized into different tables and linked using foreign keys. In this case , our questions and options are connected using a foreign key (FK).&lt;/p&gt;

&lt;p&gt;Questions Table&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;questions
---------
id (uuid, pk)
question_text (text)

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

&lt;/div&gt;



&lt;p&gt;Options Table&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id (uuid, pk)
question_id (uuid, fk → questions.id)
option_text (text)
is_correct (boolean)

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

&lt;/div&gt;



&lt;p&gt;To put the data in your csv in case like this , we will put it based on this structure:&lt;/p&gt;

&lt;p&gt;Questions.csv&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;question_text
What is the capital of France?
Which language runs in the browser?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Options.csv&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;question_id,option_text,is_correct
4f9e1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b,Berlin,false
4f9e1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b,Madrid,false
4f9e1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b,Paris,true
4f9e1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b,Rome,false
d9876543-210e-4fba-9c8d-7e6d5c4b3a21,Java,false
d9876543-210e-4fba-9c8d-7e6d5c4b3a21,Python,false
d9876543-210e-4fba-9c8d-7e6d5c4b3a21,JavaScript,true
d9876543-210e-4fba-9c8d-7e6d5c4b3a21,C++,false

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

&lt;/div&gt;



&lt;p&gt;Notice that we have unique ids in our question_id , in order to get these ids , you need to ensure to grab the question id from Supabase tables data and paste it respectively to your CSV files and its related data. Check out the note below for more clear clarification!&lt;/p&gt;

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

&lt;p&gt;Note: For columns that have foreign key constraints, you need to provide the related primary key values in your CSV file so that Supabase can correctly associate the records and successfully insert the bulk data.&lt;/p&gt;

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

&lt;p&gt;So there you have it! To wrap this up , here is a little trick and tips for you when doing this task:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use snake_case for headers (eg , course_title, created_at) for consistency between your Supabase DB and CSV files&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Keep text simple: avoid emojis or formatting.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Treat the CSV like a database migration: structured, clean, and precise.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Test a small CSV first before importing thousands of rows.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;For more info , simply refer to Supabase's official documentation on this task! : &lt;a href="https://supabase.com/docs/guides/database/import-data" rel="noopener noreferrer"&gt;Supabase CSV Data Insert&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt; &lt;br&gt;
Getting your CSV right makes everything with Supabase so much easier. When your headers match your table, your data types make sense, and your formatting is clean, the import process becomes quick and painless. A little prep goes a long way; double-check your file, test with a small batch first, and fix any issues early. Once that’s done, you’ll be able to bulk insert data confidently without the usual headaches.&lt;/p&gt;

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

&lt;p&gt;Thank you everyone! Happy weekend!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>Fixing the "Ghost Folder" in GitHub: Converting a Broken Submodule to a Normal Folder</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Fri, 26 Dec 2025 22:53:51 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/fixing-the-ghost-folder-in-github-converting-a-broken-submodule-to-a-normal-folder-44c5</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/fixing-the-ghost-folder-in-github-converting-a-broken-submodule-to-a-normal-folder-44c5</guid>
      <description>&lt;p&gt;If you’ve ever pushed your code to GitHub and noticed a folder icon with a white arrow on it, and found that you couldn't click into that folder to see your files, you aren’t alone. This is a common headache for developers, typically caused by a "nested repository" or a broken Git submodule.&lt;/p&gt;

&lt;p&gt;Check the example down below ( it's my repo , a pretty interesting use case from one of my projects ) : &lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzykdgh02ldvyopeiqbm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzykdgh02ldvyopeiqbm5.png" alt="Broken submodule" width="800" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h4&gt;
  
  
  The Anatomy of the Problem
&lt;/h4&gt;

&lt;p&gt;The arrow icon on the folder indicates that Git is treating that directory as a submodule. This usually happens when you initialize a project (like a React app using create-react-app) inside an existing Git repository.&lt;/p&gt;

&lt;p&gt;Because the new folder that I initiated comes with its own hidden .git folder, your main repository gets confused. It thinks, "I shouldn't track these files, I should just point to this other repository instead." Since that "other" repository isn't linked correctly on GitHub, you end up with an empty, unclickable folder.&lt;/p&gt;

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

&lt;p&gt;In this article , We're going to walk through how to solve this issue!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h4&gt;
  
  
  Step 1 : Locate to root project
&lt;/h4&gt;

&lt;p&gt;Locate yourself to your root project , 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;project-root/
├── backend_folder/     # Go backend
│   └── main.go
├── my-app/             # Expo / React Native app

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

&lt;/div&gt;



&lt;p&gt;I will navigate back to &lt;code&gt;project-root/&lt;/code&gt; directory &lt;/p&gt;

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

&lt;p&gt;Run this command after that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm --cached my-app

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

&lt;/div&gt;



&lt;p&gt;This command is used to stop your git ecosystem from tracking the &lt;code&gt;my-app/&lt;/code&gt; folder as a submodule (since the folder has the .git file). This command will remove the tracking version of the folder without losing your files&lt;/p&gt;

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

&lt;h4&gt;
  
  
  Step 2: Delete the Internal Git Data
&lt;/h4&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Remove-Item -Recurse -Force my-app/.git

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

&lt;/div&gt;



&lt;p&gt;Your backend or frontend folder might have a hidden .git file to track its own folder files changes. You have to delete the file so it will stop acting as its own independent repository. In my case , the .git file is in my react native folder called &lt;code&gt;my-app/&lt;/code&gt;.&lt;/p&gt;

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

&lt;h4&gt;
  
  
  Step 3 : Re-add and Push
&lt;/h4&gt;

&lt;p&gt;Once your .git file in some of your folders are deleted , you can start tracking your folders and files under one parent git repository.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add your-folder-name/
git commit -m "Fixed: converted submodule to a normal directory" 
git push origin your-branch-name

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

&lt;/div&gt;



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

&lt;p&gt;Now , your remote repository will store all your folders and files in the project on Github!&lt;/p&gt;

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

&lt;h4&gt;
  
  
  The End Results:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91qm5mp699nqafyar3az.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F91qm5mp699nqafyar3az.png" alt="New repo" width="800" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;There you go, thank you very much for the read. Hopefully this tip is useful to you dear readers :). Have a good day and let me know your thoughts on this!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>git</category>
    </item>
    <item>
      <title>Demystifying Django Architecture : A Beginner-Friendly Guide</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Fri, 12 Dec 2025 18:41:13 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/demystifying-django-architecture-a-beginner-friendly-guide-3p84</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/demystifying-django-architecture-a-beginner-friendly-guide-3p84</guid>
      <description>&lt;p&gt;Django has a reputation: "Powerful....but scary". You install a new project and suddenly you're staring at files and folders like &lt;code&gt;urls.py&lt;/code&gt; , &lt;code&gt;wsgi.py&lt;/code&gt; , &lt;code&gt;settings.py&lt;/code&gt; , &lt;code&gt;apps&lt;/code&gt; , &lt;code&gt;models&lt;/code&gt; and magic commands like &lt;code&gt;migrate&lt;/code&gt; , all before even touching your django project.&lt;/p&gt;

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

&lt;p&gt;Unlike Flask’s simplicity in software architecture, Django provides a more structured, batteries-included framework that enforces clear separation of concerns and scalable architecture from the beginning.&lt;/p&gt;

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

&lt;p&gt;This guide will demystify Django's structure , why it's designed this way , how each part plays a role in building your modern web applications.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  1. Django's Core Pattern: MVT != MVC
&lt;/h3&gt;

&lt;p&gt;While most frameworks such as Laravel , Rails and even Flask extensions follow the classic MVC method (Model-View-Controller) design pattern, Django takes a slightly different by closely related approach called MVT (Model-View-Template)&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Model&lt;/strong&gt; defines the database structure and handles data interactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template&lt;/strong&gt; handles what the user sees such as UI rendering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View&lt;/strong&gt;  processes logic, receives requests and return responses.&lt;/p&gt;

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

&lt;p&gt;A simple flow of how Django works are shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User requests -&amp;gt; URL -&amp;gt; View (Logic) -&amp;gt; Model (Data) -&amp;gt; Template (Display UI) -&amp;gt; Browser (Chrome , Opera etc)

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

&lt;/div&gt;



&lt;p&gt;This separation helps developers maintain clean, scalable code. Perfect for complex application with both user features and admin management!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  2. Understanding Django's multiple folder system
&lt;/h3&gt;

&lt;p&gt;Let's take a broader look at a Django project. A Django project is organized into two main types of folders, each serving a distinct purpose:&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
myproject/
│
├── myproject/           # Project settings folder
│   ├── __init__.py
│   ├── settings.py      # Configuration for DB, apps, middleware, templates
│   ├── urls.py          # URL routing for the whole project
│   ├── wsgi.py / asgi.py# Server gateway interface
│
├── myapp/               # Application folder
│   ├── __init__.py
│   ├── models.py        # Database schema (used by both User &amp;amp; Admin)
│   ├── views.py         # Logic for User side
│   ├── urls.py          # Routes specific to this app
│   ├── templates/       # HTML templates (User side)
│   │   └── myapp/
│   │       └── *.html
│   ├── admin.py         # Admin interface registration
│   ├── forms.py         # Forms for both User &amp;amp; Admin (optional)
│
├── manage.py            # Command-line utility for migrations, running server, etc.
└── db.sqlite3           # Example database

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

&lt;/div&gt;



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

&lt;h4&gt;
  
  
  2.1 myproject folder under myproject folder
&lt;/h4&gt;

&lt;p&gt;Pretty weird concept right? Well , when you create a django project , you will begin with this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;django-admin startproject myproject

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

&lt;/div&gt;



&lt;p&gt; &lt;br&gt;
When you run this command , Django will create:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outer folder (myproject/)&lt;/strong&gt; – This is the project root or workspace. It holds everything related to your project, including your apps, the database, and manage.py. Think of it as the body of your project where all files live.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inner folder (myproject/)&lt;/strong&gt; – This is the project configuration folder. It contains all the settings and configuration files necessary to run your Django project, such as settings.py, urls.py, wsgi.py/asgi.py, and &lt;strong&gt;init&lt;/strong&gt;.py. Think of it as the brain of your project.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Key files in the inner folder:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;settings.py&lt;/strong&gt; → Central place for configuration: databases, installed apps, middleware, templates, static files, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;urls.py&lt;/strong&gt; → Central routing table for the project; can include app-specific URL patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;wsgi.py / asgi.py&lt;/strong&gt; → Entry points for deploying your project on a web server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;init.py&lt;/strong&gt; → Marks the folder as a Python package, enabling imports.&lt;/p&gt;

&lt;p&gt;Think of the inner folder as the brain of the project, while the outer folder is the body or workspace that holds everything together.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h4&gt;
  
  
  2.2 myapp project in myproject folder
&lt;/h4&gt;

&lt;p&gt;After creating a project, you create apps to handle different functionalities. 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;python manage.py startapp myapp

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

&lt;/div&gt;



&lt;p&gt;Django creates the following structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
myapp/
├── __init__.py       # Marks folder as a Python package
├── admin.py          # Register models to the admin interface
├── apps.py           # App configuration
├── models.py         # Database models for this app
├── views.py          # Logic / controllers for this app
├── urls.py           # App-specific routes (optional, you can create manually)
├── migrations/       # Database migrations for this app
└── templates/        # Optional HTML templates for this app

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

&lt;/div&gt;



&lt;p&gt;From this structure , Django suggests that :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apps are modular → Each app is self-contained.&lt;/li&gt;
&lt;li&gt;Reusable → You can plug an app into multiple projects.&lt;/li&gt;
&lt;li&gt;Organized → Each app has its own models, views, and templates.&lt;/li&gt;
&lt;li&gt;Example: You could have a blog app, a shop app, and a users app, all inside the same project.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h4&gt;
  
  
  2.3 How Project and App Work Together
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;myproject/&lt;/code&gt; is responsible for the global settings and routing.&lt;/li&gt;
&lt;li&gt;Each app that you created contains its own models, views, templates, and logic.&lt;/li&gt;
&lt;li&gt;For example , a &lt;code&gt;blog&lt;/code&gt; app that you created can register their routes in the project-level urls.py using include():
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
# myproject/urls.py
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('blog/', include('blog.urls')),  # routes from the 'blog' app
]

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This modular design keeps your code organized and scalable, especially for larger projects.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h4&gt;
  
  
  2.4 Key Takeaways
&lt;/h4&gt;

&lt;p&gt;Django's architecture is designed based of separation of concerns.The project acts as the central configuration, holding global settings, URLs, and server interfaces, while each app is a self-contained module responsible for a specific feature, with its own models, views, and templates. This separation ensures that models handle data, views handle logic, and templates handle presentation, keeping the code organized and maintainable. The project + app structure dynamic also makes it easier to scale, as new functionality can be added by creating new apps without affecting existing ones. &lt;/p&gt;

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

&lt;p&gt;Thank you for reading , look forward to more software engineering digest!&lt;br&gt;
Happy weekend :)&lt;/p&gt;

</description>
      <category>django</category>
      <category>programming</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Applying Object Relational Mapping (ORM) on a C# .NET application</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Sat, 18 Oct 2025 08:08:52 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/applying-object-relational-mapping-orm-on-a-c-net-application-54g1</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/applying-object-relational-mapping-orm-on-a-c-net-application-54g1</guid>
      <description>&lt;p&gt;Hello everyone! In this post , we will go through about ORM implementation on a C#/.NET program, from introduction of ORM concepts all the way to CRUD demonstration.&lt;/p&gt;

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

&lt;p&gt;Recently, I’ve been building an indie music player, a Terminal User Interface (TUI) application, since I love minimalistic and lightweight apps. As I worked through the project requirements, I decided to integrate an Object Relational Mapping (ORM) system into my project alongside PostgreSQL to handle database operations more efficiently.&lt;/p&gt;

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

&lt;p&gt;While exploring the &lt;a href="https://learn.microsoft.com/en-us/ef/core/" rel="noopener noreferrer"&gt;Microsoft Entity Framework Core documentation&lt;/a&gt;&lt;br&gt;
, I discovered that the implementation process is surprisingly straightforward and beginner-friendly!&lt;/p&gt;

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

&lt;p&gt;This walkthrough has been simplified to give a clear overview of how ORM works and how to apply it to your .NET project.&lt;/p&gt;

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

&lt;p&gt;Below are the libraries you’ll need to add in order to integrate ORM into your .NET development workflow:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;1. Microsoft.EntityFrameworkCore&lt;/strong&gt;&lt;br&gt;
     This is the main ORM library for C#/.NET projects, This library&lt;br&gt;
     provides the core features of Entity Framework, including model &lt;br&gt;
     creations and data access in our C#/.NET projects&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
&lt;strong&gt;2. Npgsql.EntityFrameworkCore.PostgreSQL&lt;/strong&gt;&lt;br&gt;
     This is our PostgreSQL provider library for Entity Framework Core. It allows our ORM setup to communicate with our PostgreSQL database.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
&lt;strong&gt;3. Microsoft.EntityFrameworkCore.Tools&lt;/strong&gt;&lt;br&gt;
This library provides useful command-line tools that help in managing migrations, scaffolding, and database updates directly from your terminal. It’s especially handy for generating models and applying schema changes without writing manual SQL commands.&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
Once these packages are installed (either through the NuGet Package Manager in Visual Studio or via the .NET CLI), you’re ready to start setting up your ORM structure!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Setting Up Your Data Model
&lt;/h3&gt;

&lt;p&gt;Let’s start by creating a simple model class to represent our database entity.&lt;br&gt;
For example, in a music player app, we might have a Song model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Song
{
    public int Id { get; set; } 
    public string Name { get; set; } 
    public string Artist { get; set; } 
    public string Album { get; set; } 
    public int DurationInSeconds { get; set; }
}

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

&lt;/div&gt;



&lt;p&gt;This class will serve as our schema for the database table. Entity Framework will map this model to a Songs table in PostgreSQL automatically.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Step 2: Creating the Database Context
&lt;/h3&gt;

&lt;p&gt;Next, we’ll define a DbContext, which serves as the bridge between your C# code and the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.EntityFrameworkCore;

public class MusicDbContext : DbContext
{
    public DbSet&amp;lt;Song&amp;gt; Songs { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseNpgsql("Host=localhost;Database=musicdb;Username=postgres;Password=yourpassword");
    }
}

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;DbSet&amp;lt;Song&amp;gt;&lt;/code&gt; represents your table, and the connection string inside &lt;code&gt;OnConfiguring&lt;/code&gt; points to your PostgreSQL database. You can change the &lt;code&gt;musicdb&lt;/code&gt; to your database name , &lt;code&gt;Username&lt;/code&gt; and &lt;code&gt;Password&lt;/code&gt; to your own too!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Step 3: Running the Initial Migration
&lt;/h3&gt;

&lt;p&gt;After defining your model and context, it’s time to generate and apply the migration to create the database schema.&lt;br&gt;
 &lt;br&gt;
Run these commands in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
dotnet ef migrations add InitialCreate
dotnet ef database update

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;migrations add&lt;/code&gt; creates a migration file that defines your database structure. &lt;code&gt;InitialCreate&lt;/code&gt; can be changed to your desired name of the addition.&lt;br&gt;
&lt;code&gt;database update&lt;/code&gt; applies the migration to your PostgreSQL database.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Step 4: Performing CRUD Operations
&lt;/h3&gt;

&lt;p&gt;Once your database is ready, you can now perform Create, Read, Update, and Delete operations directly from your C# code using Entity Framework Core.&lt;br&gt;
 &lt;/p&gt;

&lt;h4&gt;
  
  
  Create (Inserting Data)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using (var db = new MusicDbContext())
{
    var newSong = new Song 
    { 
        Name = "Landslide", 
        Artist = "Fleetwood Mac", 
        Album = "Fleetwood Mac", 
        DurationInSeconds = 220 
    };
    db.Songs.Add(newSong);
    db.SaveChanges();
}

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;db.Songs.Add(newSong)&lt;/code&gt; tells Entity Framework to add a new record into the &lt;code&gt;Songs&lt;/code&gt; table.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;db.SaveChanges()&lt;/code&gt; commits the changes to the database.&lt;br&gt;
This is how you insert data without writing a single &lt;code&gt;SQL INSERT&lt;/code&gt; statement!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h4&gt;
  
  
  Read (Retrieving Data)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using (var db = new MusicDbContext())
{
    var songs = db.Songs.ToList();
    foreach (var song in songs)
    {
        Console.WriteLine($"{song.Name} by {song.Artist}");
    }
}

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;db.Songs.ToList()&lt;/code&gt; retrieves all records from the &lt;code&gt;Songs&lt;/code&gt; table and stores them in a list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can then loop through the results and display or process them as needed.&lt;br&gt;
This is equivalent to running &lt;code&gt;SELECT * FROM Songs;&lt;/code&gt; in SQL.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h4&gt;
  
  
  Update (Modifying Data)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
using (var db = new MusicDbContext())
{
    var song = db.Songs.FirstOrDefault(s =&amp;gt; s.Name == "Landslide");
    if (song != null)
    {
        song.Album = "The Dance";
        db.SaveChanges();
    }
}

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;FirstOrDefault&lt;/code&gt; searches for the first song record with the name &lt;code&gt;“Landslide.”&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once found, we modify its &lt;code&gt;Album&lt;/code&gt; property.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;db.SaveChanges()&lt;/code&gt; applies the update automatically in the database.&lt;br&gt;
This works just like a &lt;code&gt;SQL UPDATE&lt;/code&gt; statement, but handled fully in C#.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h4&gt;
  
  
  Delete (Removing Data)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using (var db = new MusicDbContext())
{
    var song = db.Songs.FirstOrDefault(s =&amp;gt; s.Name == "Landslide");
    if (song != null)
    {
        db.Songs.Remove(song);
        db.SaveChanges();
    }
}

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We fetch the target record first, then call &lt;code&gt;db.Songs.Remove(song)&lt;/code&gt; to mark it for deletion.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, &lt;code&gt;db.SaveChanges()&lt;/code&gt; removes the record permanently from the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This is equivalent to running &lt;code&gt;DELETE FROM Songs WHERE Name = 'Landslide';&lt;/code&gt; in SQL.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;By using Entity Framework Core, we’ve replaced complex SQL statements with clean, object-oriented C# code. This makes database interactions safer, easier to read, and much more maintainable, especially as your project grows.&lt;br&gt;
 &lt;br&gt;
Whether you’re developing a large-scale enterprise app or a small hobby project like my indie TUI music player, integrating ORM through EF Core can drastically simplify your database workflow.&lt;br&gt;
 &lt;br&gt;
Thank you for reading, do give out your feedback and comments for further improvements of my articles writing! Happy weekend :)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>csharp</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to make loops in Common Business-Oriented Language (COBOL)</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Sat, 20 Sep 2025 21:06:41 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-make-loops-in-common-business-oriented-language-cobol-13hl</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-make-loops-in-common-business-oriented-language-cobol-13hl</guid>
      <description>&lt;p&gt;Hello everyone! In this article, we will explore how to create loop statements in Common Business-Oriented Language (COBOL). Again , a couple of twists and turns when it comes to this language (that's why I write a lot about this language haha). &lt;br&gt;
 &lt;br&gt;
For starters, COBOL does not have direct for or while loops. Instead, it uses the PERFORM statement to handle loops. COBOL can implement loops similar to:&lt;br&gt;
 &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Count-controlled loops (similar to for loops)&lt;/li&gt;
&lt;li&gt;Condition-controlled loops (similar to while loops)
 &lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;First, Let's go through &lt;strong&gt;Count-controlled Loops&lt;/strong&gt; , a loop similar to &lt;strong&gt;For-Loop&lt;/strong&gt;.&lt;br&gt;
 &lt;/p&gt;

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

&lt;h3&gt;
  
  
  1. Count-Controlled Loops (For Loop)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1nm1dcatp6xyhzdk3e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1nm1dcatp6xyhzdk3e9.png" alt="COBOL Count-Controlled Loops" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;br&gt;
Let's go through the fundamental part of the code snippet!&lt;br&gt;
 &lt;/p&gt;

&lt;h4&gt;
  
  
  1.1 User Input Field
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DISPLAY "Enter a number between 1 and 10: ".
ACCEPT userInput.

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

&lt;/div&gt;



&lt;p&gt;This is how we get input from the user in COBOL. The &lt;strong&gt;DISPLAY&lt;/strong&gt; statement shows a message on the terminal, prompting the user to enter a value. The &lt;strong&gt;ACCEPT&lt;/strong&gt; statement then reads the input from the user and assigns it to the variable &lt;strong&gt;userInput&lt;/strong&gt;. In this example, &lt;strong&gt;userInput&lt;/strong&gt; is defined to store integer values.&lt;/p&gt;

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

&lt;h4&gt;
  
  
  1.2 PERFORM VARYING STATEMENT
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 PERFORM VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER &amp;gt; userInput
    DISPLAY "Hello World " COUNTER " times."
 END-PERFORM.

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

&lt;/div&gt;



&lt;p&gt;This is how we do a 'for loop' in COBOL. Below are the orders:-&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PERFORM VARYING&lt;/strong&gt; is the first statement needs to be made to make a for loop in COBOL. It is used to run a block of code (eg. this for loop) in the main program.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VARYING&lt;/strong&gt; will introduce a loop controlled variable that will change on each iteration. In this case , &lt;strong&gt;VARYING&lt;/strong&gt; will change the value on &lt;strong&gt;COUNTER&lt;/strong&gt; variable on each iteration. We are technically saying "VARYING is modifying COUNTER values on each loop".&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;COUNTER&lt;/strong&gt; is the loop control variable. The value of &lt;strong&gt;COUNTER&lt;/strong&gt; will change on each iteration. From this snippet, COUNTER will start from 1.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FROM 1&lt;/strong&gt; specifies the starting value of the loop control variable. From here , &lt;strong&gt;COUNTER&lt;/strong&gt; starts from 1.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BY 1&lt;/strong&gt; specifies the increment value for each iterations of the loop. The code explains that &lt;strong&gt;COUNTER&lt;/strong&gt; increases by 1 for one iteration.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UNTIL COUNTER &amp;gt; userInput&lt;/strong&gt; is the exit condition of the loop. The loop will continue until the value of &lt;strong&gt;COUNTER&lt;/strong&gt; is more than &lt;strong&gt;userInput&lt;/strong&gt; value that we set. After that , the loop stops.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DISPLAY&lt;/strong&gt; "Hello World" &lt;strong&gt;COUNTER&lt;/strong&gt; "times" prints the message once per loop, showing the current value of &lt;strong&gt;COUNTER&lt;/strong&gt; each time, until &lt;strong&gt;COUNTER&lt;/strong&gt; exceeds &lt;strong&gt;userInput&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;END-PERFORM&lt;/strong&gt; closes the loop and tells COBOL where the repeated statements stop in the program!&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qum2ep6pamknmbgin15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qum2ep6pamknmbgin15.png" alt="For Loop Output" width="800" height="489"&gt;&lt;/a&gt;&lt;br&gt;
(NOTE: the &lt;code&gt;Enter a number between 1 and 10:&lt;/code&gt; is an input field , I typed in 10 lol)&lt;/p&gt;

&lt;p&gt;So there you have it! This is how you do a Counter-Controlled Loop , technically a For-Loop. Now , let's move on to another half of the article , a while loop or in COBOL terms, Condition-Controlled Loop!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  2. Condition-Controlled Loop (While Loop)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhb6f3vo2gpg6htqww8qh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhb6f3vo2gpg6htqww8qh.png" alt="While Loop" width="800" height="762"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Pretty similar to Counter-Controlled Loop right? Well , the algorithm is pretty much the same, through identification and declaration of variables. Let's jump to the keyword that enables the program to perform a Condition -Controlled Loop.&lt;/p&gt;

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

&lt;h4&gt;
  
  
  2.1 PERFORM UNTIL COUNTER &amp;gt; 10
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; PERFORM UNTIL COUNTER &amp;gt; 10

           DISPLAY "Counter count: " COUNTER

           ADD 1 TO COUNTER

           END-PERFORM.

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

&lt;/div&gt;



&lt;p&gt;A definite explanation is down below!:&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;UNTIL&lt;/strong&gt; is a unique keyword to enable COBOL program to perform Condition-Controlled Loop. This keyword is used to compare the current value of &lt;strong&gt;COUNTER&lt;/strong&gt; to the value &lt;strong&gt;100&lt;/strong&gt;. In this case , we made a condition that the operation will perform the display message until the value of &lt;strong&gt;COUNTER&lt;/strong&gt; is more than &lt;strong&gt;100&lt;/strong&gt;. If &lt;strong&gt;COUNTER&lt;/strong&gt; value is more than the value &lt;em&gt;100&lt;/em&gt;, the loop terminates and display operation will stop.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxh8z86f50xd5weekrvxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxh8z86f50xd5weekrvxu.png" alt="While Loop Output" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the only difference between these 2 loops in COBOL!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Key Takeaways
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;COBOL doesn’t have for or while keywords, but PERFORM covers both use-cases cleanly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose PERFORM VARYING when your loop is strictly numeric and predictable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose PERFORM UNTIL when the loop should continue until some business rule or external condition is satisfied.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Thank you very much for your time to read this! Stay tuned for more COBOL series and share us your thoughts and recommendations to further improve this series!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>basic</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To declare , define and display a variable in Common Business-Oriented Language (COBOL)</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Thu, 04 Sep 2025 21:19:54 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-declare-define-and-display-a-variable-in-common-business-oriented-language-cobol-1j7k</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-declare-define-and-display-a-variable-in-common-business-oriented-language-cobol-1j7k</guid>
      <description>&lt;p&gt;Hello everyone! This article will guide you on how to declare and define variables in Common Business-Oriented Language (COBOL), while also explaining the logic and meaning behind each keyword used. Variable declaration in COBOL may differ from other programming languages, as it includes some special setter conditions such as initial values, conditions, or constraints in defining how the variables behave , so it’s important to understand why certain keywords exist and how they shape the structure of the program.&lt;/p&gt;

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

&lt;p&gt;Take a look at this code snippet as an example , I will explain little by little!&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Code Snippet Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uy9ie2ah2gxi55equjt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6uy9ie2ah2gxi55equjt.png" alt="cobol snippet in declare , define and display variable" width="800" height="784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may find some unusual keywords that you may not find in other compiled languages like C++ or Java for instance, but once you understand it, it will be simple.&lt;/p&gt;

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

&lt;p&gt;Let's go through the new division headers that we haven't covered from our previous article! If you found some of these syntax unfamiliar , do check out my previous ones where I covered about the fundamental components in COBOL &lt;a href="https://dev.to/raziq_din_bd0274cc2ac748b/how-to-print-hello-world-in-cobol-common-business-oriented-language-115p"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;  &lt;br&gt;
Without further ado , let's go!&lt;br&gt;
  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. DATA DIVISION
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 DATA DIVISION.
  *&amp;gt; defines the variables that are used in the program for data processing
  *&amp;gt; this section is where all data that will be used in the program is defined


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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;DATA DIVISION&lt;/strong&gt; is used to define all the data items required by the program. It specifies the variables, constants, and file structures that the program will use during execution. In other words, this division acts as the program’s data dictionary, where every piece of data to be processed must first be declared.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  2. WORKING-STORAGE SECTION
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
  WORKING-STORAGE SECTION.
   *&amp;gt; describes data records that is new and unknown to the file
   *&amp;gt; describe data types whose values are assigned in the source program and do not change the execution of the object program


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

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;WORKING-STORAGE SECTION&lt;/strong&gt; is part of the &lt;strong&gt;DATA DIVISION&lt;/strong&gt; where programmers declare variables and data items that exist for the entire duration of the program. These data items are created when the program starts and remain available until it ends. They are mainly used to hold temporary values, counters, flags, and constants.&lt;br&gt;
  &lt;/p&gt;

&lt;h3&gt;
  
  
  3. 01   userName     PIC X(20) VALUE "John Doe".
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 01   userName  PIC X(20) VALUE "John Doe".
   *&amp;gt; declare a variable named "userName" 
   *&amp;gt; assign it a value named "John Doe" by putting VALUE keyword before the value

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

&lt;/div&gt;



&lt;p&gt;Let's break this into lists of orders (because it's gonna be quite long haha :D)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;01&lt;/strong&gt; is a level number. It indicates that &lt;strong&gt;userName&lt;/strong&gt; variable is a top-level variable. Whenever you want to declare a new variable , you have to add 01 before naming your variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;userName&lt;/strong&gt; is the variable name. You can name it however you want!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PIC&lt;/strong&gt; is a picture , it tells COBOL ecosystem what kind of data that can be stored in this variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;X(n)&lt;/strong&gt; is a condition that enables the variable to accept letters, numbers , symbols as a value. Using X is preferable as it is more flexible!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;(20)&lt;/strong&gt; means the maximum length is 20 characters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VALUE "John Doe"&lt;/strong&gt; assigns a default initial value to the variable at program start. In this case, userName will be filled with "John Doe" followed by spaces until the length is 20.&lt;br&gt;
  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4.  01   userAge      PIC 9(3)  VALUE 30.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 01   userAge      PIC 9(3)  VALUE 30.
   *&amp;gt; declare a variable names "userAge"
   *&amp;gt; assign a value 30 

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

&lt;/div&gt;



&lt;p&gt;In this code , we are now declaring and defining a numeric variable!&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PIC 9(n)&lt;/strong&gt; defines a numeric field of length n digit. Each position can store one digit (0–9).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;(3)&lt;/strong&gt; means the variable can store up to 3 digit (000 - 999).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VALUE 30&lt;/strong&gt; initializes the variable with the value 30. Since the field length is 3, COBOL automatically stores it as 030 (leading zero added). If we set the variable value to 100 , COBOL will store it as 100 (no 0 at the front as 100 fulfills the 3 digit length!)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h3&gt;
  
  
  5.  01   userAddress  PIC X(60) VALUE "United States".
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
  01   userAddress  PIC X(60) VALUE "United States".
   *&amp;gt; declare a variable names "userAddress"
   *&amp;gt; assign a value "United States"

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

&lt;/div&gt;



&lt;p&gt;We apply the same steps that we did for &lt;strong&gt;userName&lt;/strong&gt; variable! But just for a change:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;(60)&lt;/strong&gt; is the new length for the value of this userAddress variable. We sets the maximum length of the variable to 60 characters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VALUE "United States"&lt;/strong&gt; , this initializes the variable with the string United States. COBOL will pad the remaining unused positions with spaces until the total length is 60.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h3&gt;
  
  
  6. DISPLAY ourVariable
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROCEDURE DIVISION.


  DISPLAY "below is your full information:".
  DISPLAY userName.
  DISPLAY userAge.
  DISPLAY userAddress.
   *&amp;gt; DISPLAY the variable that we have declared and defined in WORKING-STORAGE SECTION.


EXIT PROGRAM.

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

&lt;/div&gt;



&lt;p&gt;In the &lt;strong&gt;PROCEDURE DIVISION&lt;/strong&gt;, we use the &lt;strong&gt;DISPLAY&lt;/strong&gt; statement to output the values of the variables defined in the &lt;strong&gt;WORKING-STORAGE SECTION&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;Below are the results from our snippet!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Expected Output:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7k3rk8zfoqlbk5qkzjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7k3rk8zfoqlbk5qkzjb.png" alt="Output" width="533" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;And there you have it! The output above are the values that we defined from the variables. Therefore , that is how we declare, define and display variables and its values in COBOL.&lt;br&gt;
 &lt;br&gt;
Thank you for your time. If there is any suggestions, feedbacks, recommendations, do let me know and share in the comments below! See you soon!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>How to print "Hello World" in COBOL (Common Business-Oriented Language)</title>
      <dc:creator>Raziq Din</dc:creator>
      <pubDate>Wed, 27 Aug 2025 07:36:49 +0000</pubDate>
      <link>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-print-hello-world-in-cobol-common-business-oriented-language-115p</link>
      <guid>https://dev.to/raziq_din_bd0274cc2ac748b/how-to-print-hello-world-in-cobol-common-business-oriented-language-115p</guid>
      <description>&lt;p&gt;For my very first post on this platform, I’ll be guiding you through a simple “Hello World” program in COBOL, while also giving a quick breakdown of the key syntax you’ll need to make it work.&lt;/p&gt;

&lt;p&gt;But before we dive into the code, let’s take a step back and look at COBOL’s origins, and why it still powers over 70% of legacy systems in critical sectors like finance, banking, and beyond.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  What is COBOL?
&lt;/h2&gt;

&lt;p&gt;Common Business-Oriented Language a.k.a COBOL is a high-level , English-like compiled programming language that is developed specifically for business data processing needs.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  What led to the founding of COBOL?
&lt;/h2&gt;

&lt;p&gt;In the late 1950s , each operating systems that has existed at the time has it's own programming languages. However , this somehow leads to hurdles between companies as they had to work with systems of numeral brands and made cross-company data processing difficult. Grace Hopper(1906-1992), one of the pioneers in the Computer Science field, saw this issue and therefore created the early version of the language called FLOW-MATIC to simplify business programming tasks, which later inspired Conference on Data Systems Languages (CODASYL) to create COBOL programming language. Ever since then, COBOL was integrated and used by thousands of companies all around the world, producing over 800 billion of legacy code that is consistently maintained by the people in the country all around the world until now.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Is COBOL still in use in the field today?
&lt;/h2&gt;

&lt;p&gt;Well, to put this in to perspective, you are using part of COBOL's several code snippets every time you wave your debit or credit card when you want to make a payment at any stores or shops. So yes, it is being used and relevant until this day.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  COBOT "Hello World" Code Snippet
&lt;/h2&gt;

&lt;p&gt;The code snippet below is the full code snippet and required syntax to print a basic "Hello World". Let me guide you slowly as you cannot skip any order based on the code here, as it holds strong functionality and purpose for the program to run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       IDENTIFICATION DIVISION.


       PROGRAM-ID. helloworld. 


       PROCEDURE DIVISION.


       DISPLAY "hello world".


       STOP RUN.

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

&lt;/div&gt;



&lt;p&gt;Pretty simple, right? Yes it is. That’s because COBOL was designed to make programming easier by using an English-like syntax. This approach ensures that programs are easier to read, write, and maintain, even for those who aren’t professional programmers!&lt;/p&gt;

&lt;p&gt;Now, let's go through all the fundamental syntax and it's purpose to make the program runs smoothly.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  1. IDENTIFICATION DIVISION
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IDENTIFICATION DIVISION

 *&amp;gt; should be coded first as the first division in cobol program
 *&amp;gt; provides metadata about the program , such as its name , author , components required to make the cobol ecosystem recognize the syntax
 *&amp;gt; mandatory division in COBOL program

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;IDENTIFICATION DIVISION.&lt;/strong&gt; is the first mandatory component in the COBOL program that provides documentary information , including the property of the program itself such as the name and the type of program. The syntax will recognize the date compiled , author or any relevant info about the program in the ecosystem. Take this syntax as the initializer of the whole program in your COBOL file , or simply put , a "cover page" of the program.&lt;/p&gt;

&lt;p&gt;It does not disturb the program logic or your main COBOL code. So don't worry lol. Check out the extended example below as you can add this info to your code after &lt;strong&gt;IDENTIFICATION DIVISION.&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Extended Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IDENTIFICATION DIVISION.

*&amp;gt; below are the info about this COBOL program

PROGRAM-ID. PayrollSystem.
AUTHOR. Raziq Din.
INSTALLATION. Hospital Kuala Lumpur.
DATE-WRITTEN. August 2025.
REMARKS. Handles employee payroll and deductions.

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

&lt;/div&gt;



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

&lt;h3&gt;
  
  
  2. PROGRAM-ID.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
PROGRAM-ID. helloworld. 

*&amp;gt;  used to specify the program name
*&amp;gt;  mandatory and should be in the first entry after the IDENTIFICATION DIVISION.
*&amp;gt;  helloworld. is user defined alphanumeric word that identifies the program uniquely
*&amp;gt;  take it like a unique id for each program to make it unique

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PROGRAM-ID&lt;/strong&gt; is a required syntax after declaring IDENTIFICATION DIVISION. in your program. This is the syntax that will identify your program name uniquely. You are free to name it however you want BUT , there are certain rules:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Length:&lt;/strong&gt;&lt;br&gt;
up to 30 characters only for a program name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Characters:&lt;/strong&gt; &lt;br&gt;
the name must consists from alphabets (A-Z,a-z), digits (0-9), hyphens (-) or underscores (_).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alphabetical Requirements:&lt;/strong&gt;&lt;br&gt;
At least one character in the name must be in alphabetic and the first character must be in alphabetical&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Underscore Restrictions:&lt;/strong&gt;&lt;br&gt;
Cannot be at the start or end of the program name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hyphens Restrictions:&lt;/strong&gt;&lt;br&gt;
Cannot be at the start and end of the program name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reserved COBOL words:&lt;/strong&gt;&lt;br&gt;
Avoid using it , like really , it might cause conflict (e.g MOVE , IF)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uniqueness:&lt;/strong&gt;&lt;br&gt;
Your program name must be different in each COBOL file, when you work with multiple COBOL files , you will need to rename it uniquely&lt;/p&gt;

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

&lt;h3&gt;
  
  
  3. PROCEDURE DIVISION.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROCEDURE DIVISION.
  *&amp;gt;  defines the all operations that will be written in the cobol file

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;PROCEDURE DIVISION.&lt;/strong&gt; holds that whole logic of COBOL program. This syntax will operate on the data that was defined in the &lt;strong&gt;DATA DIVISION.&lt;/strong&gt; (will talk about it after this) and uses a structured format based on sections , paragraphs, or statements. Since COBOL language is procedural programming based language , the program will usually run from the top line until the last line (from top to bottom).&lt;/p&gt;

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

&lt;h3&gt;
  
  
  4. DISPLAY "Hello World".
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DISPLAY "hello world".
 *&amp;gt;  output the string "hello world" to the terminal

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;DISPLAY&lt;/strong&gt; means output. I mean , it literally mean output. To your Command Line Interface (CLI). Yes. You write &lt;strong&gt;DISPLAY&lt;/strong&gt; and include your "yourmessage" after it.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  5. STOP RUN.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;STOP RUN.
*&amp;gt;  terminate the program 

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STOP RUN.&lt;/strong&gt; will end your program runtime.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Expected Output
&lt;/h2&gt;

&lt;p&gt;Here is the output expected from your terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95g4nhkiz51p2s2bqgna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F95g4nhkiz51p2s2bqgna.png" alt="" width="634" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;So there you have it, a "Hello World" display program. Now that you’ve read through it, it’s essential to understand that COBOL syntax relies on specific keywords, each carrying a very particular purpose. Missing or misplacing even one can cause the program to fail.&lt;/p&gt;

&lt;p&gt;That said, this strict structure is also what makes COBOL so reliable for business-critical applications. Once you grasp the fundamentals, like IDENTIFICATION DIVISION, PROGRAM-ID, PROCEDURE DIVISION, and statements such as DISPLAY and STOP RUN , you’ll have the foundation to explore more advanced COBOL features, from handling data files to building complete business systems.&lt;/p&gt;

&lt;p&gt;Hope you enjoy the reading! Apologies for any little misinformation! I'm happy to learn more!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
