4 ms·
I would also suggest taking a page out of Apple's playbook and providing some official sample apps like https://developer.apple.com/library/content/navigation/#
by adamnemecek 10y ago
I would also suggest taking a page out of Apple's playbook and providing some official sample apps like https://developer.apple.com/library/content/navigation/#section=Resource%20Types&topic=Sample%20Code https://developer.apple.com/library/content/navigation/#sect.... Reading the books is one thing, but seeing the patterns actually used is another. You don't need as many as Apple, only a couple really, but make sure they are well written and straddle a couple of use cases. And like go crazy with the idioms, I want to see the most idiomatic Rust code.
When learning a new platform, it's always frustrating having to hunt for good code. I actually find these similarly important as docs (maybe even more because I tend to reference good open source for much longer than docs).
- nrjames 10y agoI agree with the example apps. Some annotated source would be great, too. Something similar to the way dc.js annotates this example: https://dc-js.github.io/dc.js/docs/stock.html https://dc-js.github.io/dc.js/docs/stock.html
- dumindunuwan 10y ago+1 for usinf dc.js type examples. I wished many times "Rust by example" could follow this type of detailed explanations and complex examples.
- threeseed 10y agoPersonally I think Rust should take this one step further. Actually build templates into the platform itself. For example one for creating a microservice complete with routes, test cases, JSON support etc. Another for a command line application. In languages with a steeper learning curve like Rust there needs to be more of an opinionated approach to teaching users.
- bluejekyll 10y agoI'm not sure how valuable this type of thing really is. Templates tend to fall out of date, since they're not actively used, they're not actively updated to new practices. I've seen this with lots of templates in other languages. The libraries having excellent documentation and pointing to apps that are similarly implemented tends to be better maintained, IMO.
- pjmlp 10y agoMaybe this could be some kind of cargo command: cargo template-gen name something
- steveklabnik 10y agohttps://github.com/rust-lang/cargo/issues/396 https://github.com/rust-lang/cargo/issues/396
- pjmlp 10y agoThanks for point it out, it just isn't clear what the current state is. It looks kind of dropped with the github repository only having a basic example.
- steveklabnik 10y agoYeah. Nobody has championed it as of yet. That's open source :)