| Section | Description |
|---|---|
| What Are Coding Conventions? | Definitions and real-world analogies |
| Benefits of a Unified Style | How consistency boosts readability and reduces bugs |
| Recommended Shell Script Conventions | Naming patterns, formatting rules, and directory organization |
What Are Coding Conventions?
Coding conventions are agreed-upon practices that determine how code is structured and named. Much like social norms guide behavior in gatherings, technical conventions help developers understand each other’s work at a glance.Why Consistent Style Matters
In any engineering discipline—from aircraft cockpit layouts to network topologies—standardized designs enhance safety and efficiency. In software, conventions:- Reduce cognitive load when switching between projects
- Simplify onboarding for new contributors
- Prevent subtle bugs caused by inconsistent formatting
Conventions focus on style, not interpreter rules. Violating them won’t usually break your code, but following them makes future maintenance far easier.

Shell Script Conventions: Naming & Style
Below are high-level recommendations for shell scripts. We’ll dive into each in detail later.- Use lowercase, snake_case for variable names (e.g.,
user_home) - Prefix boolean flags with
is_orhas_(e.g.,is_enabled) - Name functions with verbs and snake_case (e.g.,
backup_database) - Indent with two spaces for readability
- Organize scripts into
bin/,lib/, andconf/directories
Community Standards in Other Languages
Languages like Java and Python have de facto style guides that virtually every developer follows—think PEP 8 or Google’s Java Style Guide. In those ecosystems, naming functions, classes, and methods requires little debate.
Scope & Getting Started
This guide targets style—naming conventions, file layouts, and formatting—rather than performance optimizations or interpreter quirks. For example, the following assignments behave differently at runtime:Shell interpreters enforce certain rules (like no spaces around
= in assignments). Always validate your scripts with ShellCheck before deployment.