Skip to content

Rework all code examples #838

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

Open
skade opened this issue May 29, 2019 · 5 comments
Open

Rework all code examples #838

skade opened this issue May 29, 2019 · 5 comments
Labels
A-Content The written content on the website. C-Tracking-Issue Tracking a large rework or redesign of the website.

Comments

@skade
Copy link
Contributor

skade commented May 29, 2019

Content Feature Request

Summary

We should rework all code examples. The following rules should apply:

  • If possible, a code example should be easily importable and runnable from the playground
  • If that doesn't make sense (e.g. in the case of a webserver), we should provide a downloadable project to get started
  • Code examples should only use libraries that work on stable
  • If at all possible, code examples should use libraries that are past the 1.0 version number
    • If that is not possible, a library in good support should be presented.

Motivation

A lot of code examples use libraries that were in build during the time of creation but have since passed out of maintenance, such as quicly. Others make you use the nightly compiler, such as rocket. Other ones are just 0.1 for no reason, such as ferris_says.

This gives an extremely spotty view of the language and damages our image of providing stability.

Maintenance

Setting out to have more stability will reduce maintenance burden.

@skade
Copy link
Contributor Author

skade commented May 29, 2019

Issue for playground examples: #523

@XAMPPRocky XAMPPRocky added A-Content The written content on the website. C-Tracking-Issue Tracking a large rework or redesign of the website. labels Mar 1, 2020
@Davichet-e
Copy link

To add on this, rocket is no longer actively maintained (last commit was last year), so yet another reason to change the code examples in https://www.rust-lang.org/what/networking

@Manishearth
Copy link
Member

Generally I agree with the goals stated here and would support proposals to change things.

@senekor
Copy link
Contributor

senekor commented May 18, 2025

If cargo-script is stabilized, this could be a nice use case for it. The website could show the interesting snippet and a download button downloads a single file with all that's needed to run the project, including dependencies.

@tshepang
Copy link
Member

tshepang commented May 20, 2025

we could defer ecosystem examples to cookbook (or blessed.rs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Content The written content on the website. C-Tracking-Issue Tracking a large rework or redesign of the website.
Projects
None yet
Development

No branches or pull requests

6 participants