Clean Code/ Refactoring/ Secure Coding
✅ Clean Code
code with better readability
- method naming
- no error
- no repetition
- dependency ❌
- one function per one class/method
- adequate spacing between functions
Naming
use explicit names for variable, class, method
Comment
- only comment when necessary
- Aesthetics
- adequate indent, spacing
- simple, repeated patterns
- Making control flow easy to read
- left: variable, right: number
if(length>10)
- use
true
thanfalse
if(a == b)
- Function
- smaller the function, better
- one job per function
✅ Refactoring
legacy code 👎🏻
➡️➡️➡️➡️➡️clean code 👍🏻
better code, maintaining the same functions
make software better understandable, easier to maintain
>
code inspection
check already developed code to update to cleaner code
- remove repeated code
- long methods
- huge class
- swtich👎🏻 override👍🏻
- refactor prodedral programming(절차지향)
✅ Secure Coding
elminiate potential risk in code
- SQL injections
- URL parameter
This post is licensed under CC BY 4.0 by the author.