Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelonsql/17ac7c1ed059b44af7f1f84a964f63c9 to your computer and use it in GitHub Desktop.
Save joelonsql/17ac7c1ed059b44af7f1f84a964f63c9 to your computer and use it in GitHub Desktop.
Enhance Rust RFCs with a Minimal but Realistic Code Example

Enhance Rust RFCs with a Minimal but Realistic Code Example

Imagine opening a Rust RFC and, right at the top, before any detailed discussion or jargon kicks in, you're met with a small, relatable code example. This snippet isn't just for show; it clearly demonstrates the existing problem, pinpoints why the current approach feels cumbersome or inelegant, and showcases the elegance introduced by the RFC's proposal.

The Idea: Start every Rust RFC with a succinct real-life code example. This example would:

  1. Spotlight the Issue: Directly show what’s problematic in the current system.
  2. Pinpoint the Inelegance: Contextualize why it's an issue.
  3. Unveil the Solution: Highlight how the RFC's proposal offers a refined approach.

The Benefits:

  • Instant Context: Grasp the RFC's core idea without deep-diving first.
  • Increased Accessibility: A boon for newcomers or those unfamiliar with the topic.
  • Constructive Discourse: Grounded discussions based on a shared, tangible scenario.

To give a real-life example, let's look back at the RFC for the now established ? operator, and how it might have been enriched:

0243-trait-based-exception-handling.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment