Idiomatic solutions

Hey! I just signed up today so I am quite new here.

I am trying to learn rust and currently working on “Write your own shell” challenge. But once I pass the test, I would like to compare my messy code to code that a seasoned rust developer would write. I would like to know what idiomatic rust would look like, what the best practices are etc. Without those things, I am just learning how to hack my way into building something and not really grasping how a particular project would be best built using the power a particular language provides. Do other people share this feeling?

I can see code examples from other people in the community, but it seems like there’s no way to determine which solutions are the ideal ones. Most of them are from other people like me who are also trying to learn the language but don’t necessarily know the best way to solve any given problem using the correct idioms. There also doesn’t seem to be a finished repo of the whole project that would teach code organization etc.

Are those aspects just not a priority here or am I missing something?

1 Like

Just something we haven’t tackled properly yet! Some challenge/language combinations do have “editor’s choice” code examples along with screencasts but most don’t.

We’re experimenting with ways to solve this. With 2000+ stage-language combinations we can’t really rely on humans for this, has to be an automated ranking system. More details on the common complaints with code examples that we’re trying to address: Feedback on Code Examples?

In the meantime, one trick I use is to look for published repositories on GitHub: Repository search results · GitHub. Usually going through a few of those I’ll land on a well-architected one.