···5566# CRC Card playground
7788+Let's make CRC Card! I've wrote a [whole article](/posts/crc-cards-as-training-material) about it.
99+810<CrcProject />
···7788# CRC Cards as training material
991010-CRC Card: **C**lass name, **R**esponsibilities, **C**ollaborators.
1010+> CRC Card: **C**lass name, **R**esponsibilities, **C**ollaborators.
11111212[CRC Cards](https://en.wikipedia.org/wiki/Class-responsibility-collaboration_card) are a teaching tool on how to design software. They were proposed by [Kent Beck](https://www.kentbeck.com) and [Ward Cunningham](https://en.wikipedia.org/wiki/Ward_Cunningham), and, hell yeah it's useful.
1313···136136137137Only the `user id` is necessary, why not just give the user id instead of the whole object? That will be our first simplification <OrderTag order={1} />.
138138139139-> We'll simplify at the very end, once we'll be finished with our CRC card.
139139+> ℹ️ We'll simplify at the very end, once we'll be finished with our CRC card.
140140141141-> Here is a classic responsibility leak I frequentely see. When you're developing a feature, you have the big picture but `UserBookmarks` and its local knowledge don't care about the user having a `user.address.line1` property.
141141+> ℹ️ Here is a classic responsibility leak I frequentely see. When you're developing a feature, you have the big picture but `UserBookmarks` and its local knowledge don't care about the user having a `user.address.line1` property.
142142143143## The secret sauce
144144145145Now comes where we'll challenge how the component does its magic.
146146147147-### Tell me about your hooks, I'll tell you who you are
147147+### _"Tell me about your hooks, I'll tell you who you are"_
148148149149Without being a rule of thumb, I like to count how many `use` there are in the component, it gives me good approximation about how many responsibilities lies.
150150···160160 responsabilities={[
161161 "Display user bookmarks",
162162 "fetching bookmarks",
163163- "handling async processes (loading, error)",
163163+ "handling async processes (loading and error state)",
164164 "handling add bookmark modal visibility",
165165 ]}
166166 collaborators={["Home.tsx"]}
···216216// ...
217217```
218218219219-### <OrderTag order={2} /> not responsible about the animation
219219+### <OrderTag order={2} /> not responsible of child's animation
220220221221```tsx
222222// removing the magic number at the same time