Comments (1)
Hi @QuineDot, thanks a lot!
You do say "We will look at mutating static data in the chapter on Unsafe Rust", and indeed have a page on
static mut
.. That slide should just be deleted.
I have not actually used this particular feature myself, so this is valuable information. To be honest, the slide is only there because I wanted to at least mention all the "super powers" you get when you use the unsafe
keyword. I wanted to de-mystify what it does — when teaching the class, I make a point out of telling people that unsafe
doesn't "disable the borrow checker" like you sometimes see people imply.
If you must leave in
static mut
, at least coverOnce
. But really that's just a tedious and error prone way of building up things likeonce_cell
manually. In practice people just useonce_cell
and similar instead of rolling their own.
We don't have to leave static mut
in and I'm happy to replace the page with a write up about how to actually do it like you suggest.
In fact, your suggestion touches on something I've discussed with @qwandor and @maurer from my team: we need a set of slides which gives people an opinionated approach to Rust. Something like "Real life Rust" with a bunch of problems and suggested solutions. I already entered that a bit with the examples of how to use thiserror
and anyhow
for error handling. I think we need more of this.
Such a section matches feedback I got from teaching the course internally: people who are new to Rust want to be told what the best solution is by people who have already spent the time searching for a solution. The students are smart people, but we can save them a lot of time by taking them directly to a recommended solution.
from comprehensive-rust.
Related Issues (20)
- `From` and `Into` slide should emphasize losslessness and infallibility
- `let`...`else` example should demonstrate denesting HOT 1
- syntax: explain that rust pervasively allows separators to be used as terminators
- Call out `Neg` trait in speaker notes
- cortex-m-rt 0.7.4 has been yanked
- Possible clarification in chapter "6.2.1. for" HOT 1
- Page `Exercise: Iterator Method Chaining` rust code not rendering HOT 1
- Most code snippets don't work anymore HOT 2
- Dead link found in the glossary.md translations HOT 1
- Korean (ko): Catch-up with EN version
- Spanish (es): Catch-up with EN version HOT 19
- Brazilian Portuguese (pt-BR): Catch-up with EN version
- Chinese Simplified (zh-CN): Catch-up with EN version
- Chinese (Traditional) (zh-TW): Catch-up with EN version
- Make `Fork` useful in Dinning Philosopher exercises HOT 1
- The language switching menu requires clicking on the text, not elsewhere in the menu item HOT 5
- dprint fmt failing HOT 2
- Local `dprint` and `dprint` in CI want opposite things HOT 1
- Rust
- Automated slide size analysis with a new slide scoring tool HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comprehensive-rust.