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
1 change: 1 addition & 0 deletions .recurseml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rules: .rules/
17 changes: 17 additions & 0 deletions .rules/anti_dry.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Don't DRY Your Code Prematurely
globs: "**/*.{js,ts,py,go,java,rb,cs}"
alwaysApply: false
---

Reference: https://testing.googleblog.com/2024/05/dont-dry-your-code-prematurely.html

Consider carefully if code duplication is truly redundant or just superficially similar before applying DRY principles. Functions or classes may look the same but serve different contexts and business requirements that evolve differently over time.

Key principles to follow:
- Avoid premature abstractions that couple behaviors which may need to evolve separately
- When in doubt, keep behaviors separate until enough common patterns emerge over time that justify the coupling
- Think about long-term evolution, not just making code shorter
- Apply YAGNI principle - tolerate a little duplication in early development stages
- Wait to abstract until clear patterns emerge

20 changes: 20 additions & 0 deletions .rules/effective_comments.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
description: Effective Code Comments
globs: "**/*.{js,ts,py,go,java,rb,cs}"
alwaysApply: true
---


For more context read: https://blog.codinghorror.com/code-tells-you-how-comments-tell-you-why/

- NEVER write comments for code that can be understood from the code itself
- Avoid redundant comments that restate the obvious
- Use comments to clarify the intent behind complex logic or decisions
- Use comments when non-obvious assumptions are made
- Keep TODO comments specific with assignees when possible
- ALWAYS update comments when the underlying code changes

# Solution

Fix redundant comments by removing them completely.
Never attempt to add additional clarification to the comments.
Loading