summaryrefslogtreecommitdiff
path: root/content/posts/coding_standards.md
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-06-24 19:46:28 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-06-24 19:48:08 +0400
commit6e77e0358abff4fe1997a9da882fae35c44a277a (patch)
tree336e795eeec04cf5e4a415c8fbddf22d74202352 /content/posts/coding_standards.md
init: first commit
Diffstat (limited to 'content/posts/coding_standards.md')
-rw-r--r--content/posts/coding_standards.md54
1 files changed, 54 insertions, 0 deletions
diff --git a/content/posts/coding_standards.md b/content/posts/coding_standards.md
new file mode 100644
index 0000000..728b7dd
--- /dev/null
+++ b/content/posts/coding_standards.md
@@ -0,0 +1,54 @@
+---
+title: "Post Title"
+slug: post-title
+created: 2024-12-31
+updated: 2025-06-23
+description: "A brief summary of what this page is about."
+tags: [linux, self-hosting, minimalism]
+draft: true
+---
+
+
+Here are my **personal** coding standards for some languages.
+
+## Interpreted languages
+#### Never put the file extension to the source file instead use a shebang.
+``
+ #!/bin/sh
+ #!/bin/python3
+ #!/bin/perl
+``
+
+## Posix shell
+#### Always wrap variables with `"${}"` to prevent globbing.
+``
+ echo "${var}"
+ echo "${1}"
+ echo "${@}"
+``
+
+## Makefiles
+#### If Makefile is fully posix complient and doesn't have anything extra add
+`.POSIX:` to the beginning of the file
+
+## C
+#### Use K&R style `if`s
+``
+ if (condition) {
+ do this;
+ do that;
+ do another;
+ }
+``
+#### if only one line don't use curly braces.
+``
+ while (condition)
+ do this
+``
+
+``
+ if (condition)
+ do this
+ else
+ do that
+``