-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: high level clean code content #41
base: master
Are you sure you want to change the base?
feat: high level clean code content #41
Conversation
3. Limit the amount of function parameters, preferably two. if you need more you can send the parameters inside an object. | ||
4. If you find yourself writing the same code more than once, even if its a little bit different, try to generalize it in to a function. | ||
5. Functions should be pure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Sand]
Maybe we should add a small explanation or a reference to what pure
means..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pure function is the life
#### React components | ||
1. Make your React component as short as possible | ||
2. Name Your Components Using Standard Naming Conventions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Sand]
Whats the Standard we're using for naming conventions?
1. Make your React component as short as possible | ||
2. Name Your Components Using Standard Naming Conventions | ||
3. Reduce the number of props to the minimum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Sand]
Should we talk about prop-types here or that's not a part of clean code?
4. Put Independent Functions Outside of Your Custom Hooks | ||
5. Split your components to container and presentational components | ||
6. Folderize Your Components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Sand]
Maybe putting an example of this will be good :)
design/Frontend-Design.md
Outdated
6. Folderize Your Components | ||
|
||
#### DTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a typo here :) DTY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. I wrote some comments
#### Testing | ||
When you write your code, you should write it in a way it would be easy to test it. make your code predictable and testable. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can write something about TDD or BDD. It goes very well with clean code
Interface Segregation Principle (ISP) | ||
Dependency Inversion Principle (DIP) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add YAGNI as well. Uncle Bob uses it a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AND I'm not sure SOLID should be here I look at it as something above clean code
### Clean code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have Do's and Don'ts on each topic.
No description provided.