Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ skills/
└── complexity.md
```

## Credits

- Clean code practices in `clean-code.md` include concepts from the **"Clean Code" course summary** by [Academind GmbH / Maximilian Schwarzmuller](https://academind.com) (c) 2020.

## License

MIT
16 changes: 16 additions & 0 deletions skills/solid/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ See: [references/solid-principles.md](references/solid-principles.md)
4. **Brevity** - Short but not cryptic
5. **Searchability** - Unique, greppable names

**Functions:**
- Minimize parameters (0 best, 1 good, 2 okay, 3+ use parameter objects)
- Keep functions small and focused on one thing
- All operations at the same level of abstraction, one level below the function name
- Don't mix abstraction levels in a single function
- Split reasonably - avoid redundant extractions
- Avoid unexpected side effects (function name must imply all effects)

**Control Structures:**
- Prefer positive checks (`isEmpty(x)` over `!hasContent(x)`)
- Avoid deep nesting - use guards and fail fast
- Extract nested control structures into separate functions
- Use polymorphism and factory functions to eliminate repeated conditionals
- Embrace real errors (throw/catch) instead of synthetic error codes

**Structure:**
- One level of indentation per method
- No `else` keyword when possible (early returns)
Expand All @@ -77,6 +92,7 @@ See: [references/solid-principles.md](references/solid-principles.md)
- One dot per line (Law of Demeter)
- Keep entities small (< 50 lines for classes, < 10 for methods)
- No more than two instance variables per class
- Distinguish between **objects** (hide data, expose behavior) and **data containers** (expose data) - don't mix types

**Value Objects are MANDATORY for:**
```typescript
Expand Down
Loading