From 323ae83b5dbb859b2c1244c2b626a4ec55a29307 Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 19 Nov 2019 11:49:11 +0000 Subject: [PATCH] refering to good practices --- subjects/ascii-art-reverse.en.md | 2 +- subjects/ascii-color.en.md | 2 +- subjects/ascii-fs.en.md | 2 +- subjects/ascii-justify.en.md | 2 +- subjects/ascii-output.en.md | 2 +- subjects/good-practices.en.md | 28 ++++++++++++++++++++++++++++ 6 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 subjects/good-practices.en.md diff --git a/subjects/ascii-art-reverse.en.md b/subjects/ascii-art-reverse.en.md index 868abc57..c9065e70 100644 --- a/subjects/ascii-art-reverse.en.md +++ b/subjects/ascii-art-reverse.en.md @@ -20,7 +20,7 @@ This project will help you learn about : ### Instructions - Your project must be written in **Go**. -- The code must respect the **good practices**. +- The code must respect the [**good practices**](https://github.com/01-edu/public/good-practices.en.md). - It is recommended that the code should present a **test file**. ### Usage diff --git a/subjects/ascii-color.en.md b/subjects/ascii-color.en.md index 7dd59238..5c1aedac 100644 --- a/subjects/ascii-color.en.md +++ b/subjects/ascii-color.en.md @@ -21,6 +21,6 @@ This project will help you learn about : ### Instructions - Your project must be written in **Go**. -- The code must respect the **good practices**. +- The code must respect the [**good practices**](https://github.com/01-edu/public/good-practices.en.md). - It is recommended that the code should present a **test file**. - You may use the same `banner` file. diff --git a/subjects/ascii-fs.en.md b/subjects/ascii-fs.en.md index 464e0fa7..9a342c63 100644 --- a/subjects/ascii-fs.en.md +++ b/subjects/ascii-fs.en.md @@ -16,7 +16,7 @@ This project will help you learn about : ### Instructions - Your project must be written in **Go**. -- The code must respect the **good practices**. +- The code must respect the [**good practices**](https://github.com/01-edu/public/good-practices.en.md). - It is recommended that the code should present a **test file**. ### Usage diff --git a/subjects/ascii-justify.en.md b/subjects/ascii-justify.en.md index 35f5d754..98e60899 100644 --- a/subjects/ascii-justify.en.md +++ b/subjects/ascii-justify.en.md @@ -21,7 +21,7 @@ This project will help you learn about : ### Instructions - Your project must be written in **Go**. -- The code must respect the **good practices**. +- The code must respect the [**good practices**](https://github.com/01-edu/public/good-practices.en.md). - It is recommended that the code should present a **test file**. - You should build your one files with the templates you desire. diff --git a/subjects/ascii-output.en.md b/subjects/ascii-output.en.md index e3adbe5f..090d1017 100644 --- a/subjects/ascii-output.en.md +++ b/subjects/ascii-output.en.md @@ -19,7 +19,7 @@ This project will help you learn about : ### Instructions - Your project must be written in **Go**. -- The code must respect the **good practices**. +- The code must respect the [**good practices**](https://github.com/01-edu/public/good-practices.en.md). - It is recommended that the code should present a **test file**. - You may use the same `banner` file. diff --git a/subjects/good-practices.en.md b/subjects/good-practices.en.md new file mode 100644 index 00000000..09ad819a --- /dev/null +++ b/subjects/good-practices.en.md @@ -0,0 +1,28 @@ +## good practices + +### [code](https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--net-8118) + +- Commenting and Documentation +- Consistent Indentation +- Avoid Obvious Comments +- Code Grouping +- Consistent Naming Scheme + - camelCase + - under_scores +- [**DRY**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Don't Repeat Yourself) or [**DIE**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Duplication is Evil) principle +- [**KISS**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Keep It Simple Stupid) +- [**YAGNI**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (You Aren’t Gonna Need It) +- [**SOC**](https://thefullstack.xyz/dry-yagni-kiss-tdd-soc-bdfu) (Separation of Concerns) +- Avoid Deep Nesting +- Limit Line Length +- File and Folder Organization +- Consistent Temporary Names +- Separation of Code and Data +- Code Refactoring + +### Go + +- [**Go**](https://golang.org/doc/effective_go.html) +- [**gofmt**](https://golang.org/cmd/gofmt/) +- [**goimports**](https://godoc.org/golang.org/x/tools/cmd/goimports) +- [**foimports vs gofmt**](https://goinbigdata.com/goimports-vs-gofmt/)