onesour / Net-Mvc-Workshop1

0 stars 0 forks source link

[CodeReview]-Coding Style & Coding Quality #2

Open GSSBilly opened 5 years ago

GSSBilly commented 5 years ago

DRY 原則(Do not repeat yourself)

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Views/Home/Create.cshtml#L83-L85

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Views/Home/Edit.cshtml#L99-L101

GSSBilly commented 5 years ago

命名原則

[使用有意義、符合語意命名] Select => Get

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L130

[複數集合命名] ClassID => Classes or ClassNames or ClassList

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L16-L21

[公共私有變數大小寫區分]

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L55

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L57

GSSBilly commented 5 years ago

良好&有意義&格式正確註解

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L130

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L145

https://github.com/hsuan51/Net-Mvc-Workshop1/blob/44836a994e9a1f6a3ee853ba09a21f6b97adf01c/Net-Mvc-Workshop1/Controllers/HomeController.cs#L166