Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback on Chapter 6: The package within #803

Closed
jthomasmock opened this issue Jun 24, 2022 · 2 comments
Closed

Feedback on Chapter 6: The package within #803

jthomasmock opened this issue Jun 24, 2022 · 2 comments

Comments

@jthomasmock
Copy link

I love this chapter! It feels like a more compact journey through the whole game from a realistic perspective. Bravo!

While I don't necessarily think it requires an additional section in this exact chapter, as a middling package dev I am looking for guidance in protecting against craft or novice useRs. It could be an example in the side-effects vein. Ultimately, I think it's worth a whole chapter somewhere 😄 .

IE what happens when the user passes a list() rather than a single df and how to write defensive code with checks/validators:

  • stopifnot(), warning(), the checkmate, assertthat, assertivepackages, etc.
  • Almost a variation of this: https://blog.r-hub.io/2022/03/10/input-checking/
  • Some components of this are converted in testing chapter, but that feels very dev-focused as opposed to package writing that provides a delightful user experience.

I'm not sure if it's fully in scope for this chapter/section, but documenting design patterns for "defensive programming" and avoiding bad "code smells" in argument validation and function writing would be highly valuable!

When I teach about Package development, I spend the first half of the time on writing functions and providing basic validations and/or useful error messages/defense against unexpected inputs.

@jennybc
Copy link
Collaborator

jennybc commented Sep 1, 2022

I love this chapter! It feels like a more compact journey through the whole game from a realistic perspective. Bravo!

Thanks! I'm not particularly satisfied with this chapter, but I do think it's important. Hearing that you like it is much-needed encouragement that it's worth holding on to and improving.

The content you're describing sounds very much in the wheelhouse of what https://design.tidyverse.org aims to address.

I propose to close this issue here, but open the equivalent issue there.

@jennybc
Copy link
Collaborator

jennybc commented Mar 26, 2023

As previously discussed, closing in favor of tidyverse/design#141.

@jennybc jennybc closed this as completed Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants