boshiang / .NET-MVC-Workshop1

0 stars 0 forks source link

[CodeReview]-Coding Style & Coding Quality #4

Open GSSBilly opened 5 years ago

GSSBilly commented 5 years ago

冗餘程式碼

[多餘註解]

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Views/Book_maintenance/Index.cshtml#L8

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Controllers/Book_maintenanceController.cs#L58

GSSBilly commented 5 years ago

一致性

[htmlAttributes,具名參數使用與否請維持一致性]

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Views/Book_maintenance/Search.cshtml#L12

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Views/Book_maintenance/Search.cshtml#L14

GSSBilly commented 5 years ago

DRY 原則(Do not repeat yourself)

[重複的 Script 設定, 請善用 Layout]

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Views/Book_maintenance/Insert.cshtml#L83-L85

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Views/Book_maintenance/Edit.cshtml#L95-L97

GSSBilly commented 5 years ago

命名原則

[Class 名稱請用 Pascal Case]

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Controllers/Book_maintenanceController.cs#L10

GSSBilly commented 5 years ago

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

https://github.com/boshiang/.NET-MVC-Workshop1/blob/79a504eadf447c8ba6b24d9401f5efdca4a57d39/Workshop2/Controllers/Book_maintenanceController.cs#L15