

Thanks For Asking!
source link: https://www.tuicool.com/articles/hit/AV3YzqJ
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

One part of my personal dedication to Rust is writing weekly “Ask easy questions here” threads on the rust subreddit . One thing that recently occurred to me is that most of the questions asked may hint at a deficiency in documentation and teaching material. We are, as far as I know, not using this resource for now.
So here’s a broad categorization of the topics of the last three weeks’ worth of questions:
- questions about the new edition, or other new / unstable features. Those are to be expected and usually come from early adopters which accept missing documentation
- people asking for code review. Interestingly I haven’t seen request for mentors yet
- misleading or hard to interpret error messages – those are usually followed up with a rust issue. Though there is still work to be done, all is well in that regard
-
generics, where clauses, associated types (especially the
<Foo as Bar>::Baz
syntax), coherence and trait object safety - lifetime issues, we still haven’t found an easy way to teach them, so people are going through some pain here. On the other hands, most such questions get quite great answers, which we should probably mine for teaching approaches
-
macro_rules!
definition and usage – though DanielKeep’s little book of rust macros is a great resource, either it is insufficiently advertised, or we need to come up with other documentation -
error handling:
?
operator, Error type translation, custom error types, the failure crate - crate organization, subcrates and workspaces. I must admit that I don’t yet have a handle on how this stuff works, despite using it in three of my projects
-
the module system (“can
main.rs
usepath/to/lib.rs
, and if yes, how?”), how and why touse somecrate::prelude::*
– this stuff is in flux and will probably be improved soon -
iterator usage: Perhaps the
Iterator
documentation could use more examples - data strucure pragmatics and usage
-
allocation,
Box
, the distinction between owned and borrowed values -
drop order,
drop()
and the significance of theDrop
trait - numeric casts and the non-availability of numeric inter-type operations
- blanket implementations of traits for arrays and tuples (those should probably have docstrings once #51885 is merged)
- cross-compiling to non-standard targets (embedded, WASM or CUDA)
Hopefully someone interested in improving Rust’s learnability finds this useful.
Recommend
-
181
Do you want the user’s Apple ID password, to get access to their Apple account, or to try the same email/password combination on different web services? Just ask your users politely, they’ll probably just hand over their credentials, as they’re tr...
-
98
Note: I was supposed to put this post up about two weeks ago… Well, you know how it is. Life got in the way. As such, this is not fully updated with what I’ve discovered in the last two…
-
42
git-logo.jpg Hundreds of developers have had had Git source code repositories wiped and r...
-
8
Why asking stupid questions is good
-
12
14 December 2020 ...
-
11
开源日报 开源日报第983期:《强制传送 python-goto》 2020-12-17 53...
-
4
Home Chevron iconIt indicates an expandable section or menu, or sometimes previous / next navigation options.Politics ...
-
8
Fresh pcaps, free for the asking One thing network people hate is having to get access to a machine (or groups of them) in order to run tools like tcpdump. They want a packet trace from somewhere, and having to obtain not just ssh...
-
9
Why do people keep asking permission to learn things? I think programming is a matter of drive and motivation. I keep seeing these questions on sites like Stack Exchange with the same general pattern: "how do I teach my cow...
-
3
If killall is the answer, you're asking the wrong question Have you ever noticed that when you see one thing that's cosmically bad in a program, it's usually not alone? It's the broken window theory: once someone smashes through...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK