Add coding rule: prefer existing packaged functions over rolling your own - #213
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromCLAUDE.mdnext toavoid-nesting(so the lab manual can transclude it too). The motivating example: usewithr::with_seed()instead of hand-rolling a.Random.seedsave/restore — which is exactly the cleanup just done acrossettbc(#16/#21/#23/#24).🤖 Generated with Claude Code
Generated by Claude Code