Skip to content

Add coding rule: prefer existing packaged functions over rolling your own - #213

Merged
d-morrison merged 1 commit into
mainfrom
claude/intelligent-mccarthy-sgxud9
Jun 25, 2026
Merged

Add coding rule: prefer existing packaged functions over rolling your own#213
d-morrison merged 1 commit into
mainfrom
claude/intelligent-mccarthy-sgxud9

Conversation

@dem-extra1

Copy link
Copy Markdown
Collaborator

Captures a standing preference from a work session: look for an existing, well-maintained packaged function before writing your own — base R, tidyverse/r-lib, a focused CRAN package, or one of our own lab packages ({bcs}, {ettbc}, {gha}).

New shared fragment shared/coding/prefer-packaged-functions.md, referenced from CLAUDE.md next to avoid-nesting (so the lab manual can transclude it too). The motivating example: use withr::with_seed() instead of hand-rolling a .Random.seed save/restore — which is exactly the cleanup just done across ettbc (#16/#21/#23/#24).

🤖 Generated with Claude Code


Generated by Claude Code

… own

Captures the standing preference to look for an existing, well-maintained
package function (base R, tidyverse/r-lib, a focused CRAN package, or our own
lab packages) before writing a bespoke one. New shared fragment, referenced
from CLAUDE.md alongside avoid-nesting so the lab manual can transclude it too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGYr9eMYnoeLH8j9fpkkB8
@d-morrison
d-morrison merged commit d302c4e into main Jun 25, 2026
2 checks passed
@d-morrison
d-morrison deleted the claude/intelligent-mccarthy-sgxud9 branch June 25, 2026 16:12
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.

3 participants