Category

Programming Tutorials and Coding Guides

Explore programming tutorials with practical examples across multiple languages, scripting, and development concepts for beginners and advanced users.

Welcome to the Programming tutorials section, where you will learn coding concepts with real-world examples across multiple languages and platforms.

This category includes beginner to advanced guides covering scripting, automation, and application development in Java, JavaScript, Python, Go, TypeScript, and related stacks.

Whether you are learning programming for system administration or building applications, browse the articles below for practical examples and language-specific references.

Programming plays a crucial role in modern infrastructure and DevOps workflows. You can also explore DevOps and Linux to see how code integrates with system-level operations.

956 articles

Programming category illustration with code editor, automation, and debugging graphics
programming

Bash compare strings: equality, order, empty checks, and pattern match

Bash string comparison with == and !=, bash if string equals patterns, compare strings in bash using [[ ]] and [ ], ASCII order, empty (-z) and non-empty (-n) checks, quoting, case folding, and =~ regex.

Deepak Prasad5 min read
programming

Bash compare numbers and integers: variables, [[ ]], (( )), and pitfalls

Bash compare numbers and integers with -eq, -lt, -gt, bash compare variable to number in [[ ]] and (( )), bash if numeric comparison patterns, test, loops, and pitfalls (leading zeros, floats, string vs numeric).

Deepak Prasad5 min read
programming

Bash format number with commas on Linux: printf, numfmt, and script examples

Bash format number with commas using printf thousands grouping, LC_NUMERIC and GNU numfmt, plus a pure Bash comma formatter for integers and decimals. Covers locale (en_US vs en_IN), C/POSIX limits, and readable output …

Deepak Prasad5 min read
programming

JavaScript await: async functions, try/catch, Promise.all, top-level await

How await works in JavaScript: javascript await, js await, async await javascript, await promise inside async functions, sequential vs Promise.all concurrency, try/catch on rejections, await on non-promises, top level …

Olorunfemi Akinlua4 min read
programming

JavaScript factory pattern (functions, classes, and async factories)

JavaScript factory pattern and factory functions: return plain objects, pick implementations by input, constructor-based factories, ES6 class factories, closure privacy, and async factories—with Node-tested output.

Olorunfemi Akinlua4 min read
programming

Nested loops in Java (for, while, do-while, and examples)

Nested loops in Java: nested for, while, and do-while (including mixed loops), Scanner menu example, labeled break, and complexity. Runnable examples with OpenJDK 17-tested output.

Deepak Prasad7 min read
programming

Laravel Tutorial for Beginners (Step by Step)

Free, hands-on Laravel tutorial - install, routes, Eloquent ORM, Blade templates, authentication, Sanctum/Passport, validation, file storage, queues, mail, and production deployment. 40+ tested lessons.

Deepak Prasad1 min read
programming

Node.js Tutorial for Beginners (Hands-On)

Free, hands-on Node.js tutorial - installation, REPL, file system, child processes, Express, MongoDB, authentication, error handling, debugging, and HTTPS. 35+ runnable lessons.

Deepak Prasad1 min read
programming

Pandas Tutorial for Data Analysis (with examples)

Free, hands-on Pandas tutorial - DataFrame fundamentals, reading and writing CSVs, selecting, filtering, joining, grouping, reshaping, and visualizing data. 30+ examples tested on Python 3.11 + pandas 2.x.

Deepak Prasad1 min read
programming

SQL Tutorial for Beginners (Hands-On with Real Examples)

Free, complete SQL tutorial - SELECT, INSERT, UPDATE, DELETE, all JOIN types, GROUP BY, aggregate and window functions, constraints, stored procedures, transactions, and date/time/string functions. 85+ runnable lessons …

Deepak Prasad2 min read
programming

Bash String to Array (Split by Space, Delimiter, Newline + mapfile Examples)

Learn how to convert string to array in Bash using read -ra, IFS delimiters, and mapfile. Includes examples for splitting by space, comma, newline, multiple delimiters, and handling edge cases safely.

Deepak Prasad6 min read
programming

Golang Write to File, Append & Create File (os.WriteFile, OpenFile Examples)

Learn how to write, append, and create files in Golang using os.WriteFile and os.OpenFile. This practical guide covers file writing, appending data, creating files if not exists, flags explanation, real-world examples, …

Antony Shikubu7 min read
programming

Golang Generics Explained (Functions, Structs, JSON & Real Examples)

Learn Golang generics with practical examples including generic functions, structs, interfaces, and JSON parsing. This guide explains type parameters, constraints, real-world use cases, and common errors to help you …

Antony Shikubu7 min read
programming

Golang Optional Parameters (No Default Values? Best Workarounds Explained)

Learn how to implement optional parameters in Golang using variadic functions, struct-based patterns, and pointer parameters. This guide explains why Go does not support default values and shows practical workarounds …

Antony Shikubu6 min read
programming

Golang If Else (Syntax, Multiple Conditions, One-Line & Best Practices)

Learn how to use if, else if, and else statements in Golang with practical examples. This guide covers multiple conditions, logical operators (AND, OR, NOT), one-line if statements, real-world use cases, and best …

Antony Shikubu6 min read
programming

Golang Read File (Line by Line, Entire File, Large Files Explained)

Learn how to read files in Golang using os.ReadFile, bufio.Scanner, and bufio.Reader. This guide covers reading entire files, line-by-line processing, handling large files efficiently, and common errors with practical …

Deepak Prasad7 min read
programming

Read File in Golang with Timeout (Handle Large Files, Scanner Errors & Real Examples)

Learn how to read files in Golang with timeout handling using select, time.After, and context.WithTimeout. This guide covers reading files line by line, in chunks, handling large files, fixing bufio.Scanner errors, and …

Deepak Prasad9 min read
programming

Golang JWT Authentication (Gin + REST API + Middleware Examples)

Learn how to implement JWT authentication in Golang using Gin and PostgreSQL. This step-by-step guide covers user signup, login, JWT token generation, middleware validation, REST API usage, and common errors for building …

Antony Shikubu14 min read
programming

Pytest Logging Explained (Set Log Level, Show Logs, caplog, Fix Issues)

Learn how to configure and use pytest logging effectively. This guide covers setting log levels, enabling live logs, using log_cli and caplog, fixing logs not showing, logging to file, and advanced configurations. …

Deepak Prasad5 min read
programming

Python Set add() Explained (Add Elements, Multiple Items, Common Mistakes)

Learn how to add elements to a set in Python using add() and update() methods. This guide covers adding single and multiple elements, handling duplicates, common mistakes like append() and insert(), and real-world use …

Deepak Prasad7 min read
programming

Python Compare Strings (==, Ignore Case, Substring, Examples)

Learn how to compare strings in Python with practical examples. This guide covers string equality, case-insensitive comparison, substring matching, lexicographic comparison, character-by-character comparison, and …

Deepak Prasad7 min read
programming

Python floor() Function Explained (math.floor, Examples, vs int & round)

Learn how to use floor() in Python with practical examples. Understand math.floor(), differences between floor vs int vs round, handling negative numbers, Pandas and NumPy usage, and common errors. Includes syntax, …

Bashir Alam6 min read
programming

Fix "Setting an Array Element with a Sequence" in Python (NumPy ValueError Explained + Examples)

Learn how to fix the "ValueError: setting an array element with a sequence" in Python and NumPy. Understand inhomogeneous shape errors, causes, real examples, and step-by-step solutions to resolve array shape mismatch …

Azka Iftikhar4 min read
programming

npm run pass arguments (with & without --) – Complete Guide + Examples

Learn how to pass arguments to npm scripts using double dash (--) and without it. Includes real examples, npm_config usage, environment variables, and best practices for Node.js scripts.

Steve Alila4 min read
programming

Hexagonal Architecture in Golang: Project Structure, Example & Best Practices

Learn Hexagonal Architecture in Golang with a real-world example, project structure, and best practices. Understand ports and adapters, dependency flow, testing strategies, and when to use this architecture in Go …

Antony Shikubu15 min read
programming

Python Regex Tutorial with Examples (re Module Cheat Sheet & Use Cases)

Learn Python regex (regular expressions) with practical examples, cheat sheet, and real-world use cases. Understand re module functions like search, match, findall, sub, and split with beginner-friendly explanations and …

Deepak Prasad8 min read
programming

How to Uninstall Golang (Go Compiler) on Linux, macOS, and Windows

Learn how to uninstall Golang (Go compiler) on Linux, macOS, and Windows. This guide explains how to remove Go installed using tarball archives, package managers, Homebrew, or installers, including cleaning environment …

Tuan Nguyen10 min read
programming

How to Remove or Uninstall a Go Package (go get, Go Modules, Tools)

Learn how to remove or uninstall a Go package added with go get or go install. This guide explains how to remove Go module dependencies from go.mod, uninstall globally installed Go tools, clean module cache, and undo …

Tuan Nguyen7 min read
programming

What is the Golang Gopher? History, Meaning and Go Mascot Explained

Learn about the Golang Gopher, the official mascot of the Go programming language. Discover its origin, creator Renée French, history, design evolution, and why the Go community uses the gopher as its iconic symbol.

Tuan Nguyen14 min read
programming

Java Arrays vs Collections Explained with Practical Examples

Learn the differences between arrays and collections in Java with practical examples. This guide explains how to create arrays, initialize lists, print arrays, determine collection size, and work with common Java …

Bashir Alam11 min read