4 ms·
>> but it only really matters if you explicitly upgrade to 2018 This is OK for programmers who already know Rust. But for new programmers coming to the languag
by pritambarhate 7y ago
>> but it only really matters if you explicitly upgrade to 2018
This is OK for programmers who already know Rust. But for new programmers coming to the language, it presents a very difficult challenge.
To give one anecdote, I was trying out Rust a few days ago. Just baby steps. I wanted to read a file. But since the try! the macro syntax is changed, almost every example I could find on the Internet was broken. Took me almost an hour to figure out what was going on. (I have programmed professionally for more than 10 years in Java, JS, Objective-C, PHP, Python and Go) Lost the interest to pursue it further.
Another time, I thought I would read some small projects in Rust from Github to improve my understanding of Rust. I wanted to checkout "programs" and not libraries. So I went on exploring Rust projects on Github and tried out 2-3 smallish programs. But because of Rust version incompatibilities, I was not able to get them to build and run. Now I accept, if I had been dogged enough, maybe I could have found out the exact version of Rust required for the programs. But it was too much work for a weekend afternoon where I just wanted to learn something new in 2-3 hours.
Rust community and senior Rust programmers might not accept this, but the Rust ecosystem has instability issues from a NewBie perspective.
Edit: Sorry the problem I was facing about was related to writing a file and "unwrap" and "?" syntax. Not the try! macro syntax. (I think that surfaced some other time.) I just checked my example after posting this comment. But still keeping the comment here as it shows struggle a Rust noob faces while learning the language.
- ChrisSD 7y ago> I wanted to read a file. It's probably too late to help now but I recommend the official documentation[0] and book[1]. They both have examples. [0]: https://doc.rust-lang.org/std/fs/struct.File.html https://doc.rust-lang.org/std/fs/struct.File.html [1]: https://doc.rust-lang.org/stable/book/ch12-02-reading-a-file.html https://doc.rust-lang.org/stable/book/ch12-02-reading-a-file...
- dralley 7y agoI'm not saying your experience is invalid, but the first 5 google results I get for "read a file Rust" all return working code (I didn't look beyond the first 5).
- lordCarbonFiber 7y agoStale links is something that plagues pretty much every language though. Hell python2 documentation still tends to be higher ranked in search results and that's a decade out of date. Then for frameworks or somethign like php you might find an answer that "works" but is so unidiotmatic or insecure in "current year" that you're almost better off having it fail. In this way I'd say rust is far ahead of the pack. If you want to do something in "2 or 3 hours" you can go to the official documentation https://doc.rust-lang.org/book/ https://doc.rust-lang.org/book/ and be certain that things are up to date and work. This is also why random things on the internet tend to not be as well maintained, there's no need and that's not where new people are expected to go. There's only so much a community can do when users like yourself go out of your way to avoid reading any official documentation (and then are left confused).
- deleted 7y ago[deleted]
- steveklabnik 7y agoI think it's unfair you've been downvoted. That is, I don't dis-believe your experience. It's just so, so so hard to reproduce these things, and it happens to every language to some degree. Measuring that degree is very hard, and also, Google personalizes results, so it's impossible to recreate. I don't expect you to have this handy, but if you had data, that is, what posts you found, what you searched for, that would be helpful. Most users do not report this experience, though I'm sure that's survivorship bias.
- pritambarhate 7y agoThanks for replying Steve. I appreciate all of the work you do make rust accessible to new programmers. Don't mind the downvotes as I just wrote from vague memory without properly verifying things. I tried to look through my Google history to see how I landed into that specific problem. But was not able to find out how exactly I landed on that syntax issue about writing files. If it helps here is my chronological Google Search and visit history on that day about how I finally went from "try" macro to understanding how "?" operator is used in Rust. * Searched for "try macro rust" * Visited "std::try! - Rust" * Visited "Learning to 'try!' things in Rust - Jonathan Turner" * Searched for "rust expected expression, found reserved keyword `try`" * Visited "Try keyword reservation breaks macro try - The Rust Programming ..." * Searched for "rust try macro removed" * Visited "Error Handling - The Rust Programming Language" * Visited "How to use ? and catch in Rust? - Stack Overflow" * Searched for "rust optional unwrapping" * Visited "What is unwrap in Rust, and what is it used for? - Stack Overflow" * Visited "Killing unwrap() • Dimitri Merejkowsky - dmerej.info" * Searched for "rust ? operator" * Visited "The ? operator for easier error handling - The Edition Guide"
- steveklabnik 7y agoThanks so much! This is helpful.
- ldng 7y agoThat is very important. Because, personnally, I never rely on one source of information. Problem is, as illustrated, what a good source beside the official doc ? Adding insult to injury, not that it is specific to Rust, there are so many bloggers out there that don't put a date and/or give version of the software they're talking about that you just can't know if the info is correct or obsolete.
- Manishearth 7y agoYeah this was my biggest fear with edition changes: You can fix live code, but you can't as easily fix existing programmers' mental models, and you can't update all existing online resources. OpenGL has this issue and it sucks, and i did bring this up during the edition discussions but it didn't stack up as well against arguments on the other side. I'm self taught and "google things until it works" is a key aspect of how i learn, and i'm disappointed to see this workflow somewhat broken in Rust. Over time, it will heal (it's much harder to find stuff that uses `try!` now), but it's still annoying.