Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

einatnielsen
Copy link
Contributor

No description provided.

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
Copy link
Contributor

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..

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 :)

6. Folderize Your Components

#### DTY
Copy link
Contributor

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

Copy link

@talJoffeExelate talJoffeExelate left a 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.

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)

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

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants