Preferences

PixelForg parent
Thank you for your comment, especially for this

> I've written a lot of Rust. I've read less than half of the Rust book.

Just knowing that there's someone out there who has worked like this or has been in the same situation gives me enough confidence to go through it!(the just write code part)

I've gone through so many resources (including the book) and I never managed to finish any of them. But I think now I need to get comfortable with having gaps and just start writing code and not be afraid of writing non-idiomatic rust code, atleast for now.


ChrisMarshallNY
I've -literally- been writing Swift, every day, seven days a week, 52.4 weeks a year, since June 2, 2014 (the day it was announced), yet, I still have huge gaps in my knowledge of the language.

I speak it without an accent, but not at Ph.D level.

As to home projects, that's pretty much all I do, these days, ever since I "retired"*, in 2017.

I'm quite good at what I do, and generally achieve every goal that I set, but, since I'm forced to work alone, the scope needs to be kept humble. I used to work as part of a worldwide team, doing some pretty interesting stuff, on a much larger scale.

But what's important to me, is that I do a good job on whatever I do. Everything I write, I ship, support, and document, even if it isn't that impressive. The bringing a project to completion, is a big part of the joy that I get from the work.

* Was basically forced into it

fragmede
Unrelated question since you've got the Swift experience: How would you recommend a modern day Mac utility get sold? Is grabbing some hardware ID of a device and then charging money for a license keys somehow still the way to go for some small utility (eg window management app like Rectangle) if you want to sell to users outside of the Mac app store?
ChrisMarshallNY
With Mac, you have choices (as opposed to iOS). There’s licensing libraries that you can use. These can do things like hardware keys.

The App Store is very secure, but Apple gets their vig…

sanderjd
By the way, I fear I'm harping on "AI tools can be really useful" here, but I really find that learning new things is my favorite way to use these tools.

You said that you don't want to use them to generate code and just be a reviewer. I definitely feel that! But you can instead use them like a tutor helping you learn to the code yourself. "I'm trying to do xyz in Rust, can you show me a few techniques for that?" Then you can conversationally ask more questions about what's going on. Maybe eventually you can go read relevant sections in the book, but with the concepts better motivated.

I do this all the time when learning new things. It's not a canonical source of information, but it can be a useful guide.

speleding
Another approach that may help you, that worked for me. I was not familiar with rust so I wrote an initial proof of concept in another language (Go in my case). Then I asked Claude AI to translate it to Rust. It compiled on the first try, the only bugs being problems in the source file I gave it. Then I iterated a bunch of times by saying "please make this more rustacean style".

I only tend to use AI for assistance, but for me at least it's easier to get started this way than to start with an empty source file.

sanderjd
Yes! No tool has ever helped me more with the blank page problem.
dijksterhuis
> I've gone through so many resources (including the book) and I never managed to finish any of them. But I think now I need to get comfortable with having gaps and just start writing code and not be afraid of writing non-idiomatic rust code, atleast for now.

i was in the same boat. i’d probably gone through the first half of the rust book and made actual hand written notes several times over the last 5 years. started rustlings. started “100 exercises in rust” (can’t remember actual title). never finished them. never felt like i was going to be “ready” to handle rust.

6-9 months ago i had the time to start learning a new language. was between rust or go. decided on rust. avoided it for a month. recently released my first library crate (with another on the way).

my tips/experience

- don’t worry about the borrow checker to start, just be aware it’s a thing. clone() everything if you need to. i had to just get comfortable writing rust code first. “i wrote some rust” was the goal each day. just working on getting it to compile somehow was all that mattered. confidence building is a thing.

- i started with simple CLI binary doing stuff like “package the files in these directories as a release/dev build setup”. basically copy paste /symlink files with clap. simple but useful [0]

- start with an ide that hooks into the compiler and shows you errors. ideally one like theia or rust rover which shows you the documentation of the error when you hover over it. i’ve now switched to nano and compiling manually after like 7 months. i see fewer errors these days and usually i expect some of them.

- keep it simple. don’t worry about being idiomatic. it will come as you read other people’s libraries and code over time. i’m still not there yet.

- if you are really struggling with the compiler just wont let me do this one bloody thing why won’t you let me do it it’s so simple in language X —> you are either fighting against the type system or the borrow checker. pause. take a moment. figure out which. it’s time to figure out what you’re not understanding. accept that you might have to completely change the approach of what you were doing. it’s okay, it’s part of learning.

- i would read all the outputs of `cargo clippy` and change each one by hand. i don’t use `cargo clippy —fix` ever. repetition helps me learn. doing enough boring repetition forced me to remember basic stuff that makes my code more idiomatic. i cannot emphasise how useful this was to make my code more idiomatic up front.

- commit your changes. then use `cargo fmt` and read through the diffs. again, helps to work out what rust code is supposed to look like while writing it (eventually without needing to use `cargo fmt`). i cheated with formatting compared to clippy (see above). it’s just formatting, you can probably rely on cargo fmt and be lazy tbh.

- you don’t have to start your rust journey with hardcore systems/hardware level coding. i felt like i was cheating / doing it wrong because i wasn’t doing that. but a lot of crates are nothing to do with systems level stuff. just because it’s a systems programming language doesn’t mean you have to be that hardcore to start with. see 2nd bullet point.

- generics might be my favourite thing about rust. realising how they work and how to apply them blew my mind. once i had that ‘mind blown’ moment with something — i was hooked. i don’t wanna go back to python now!

[0]: i need to change perms. apparently i set code viewing to private somehow? wtff. https://gitlab.com/dijksterhuis-arma3/vn-mf-builder

PixelForg OP
Thank you so much for your comment! You've addressed a lot of issues I was having, each point is gold, I have no more excuses, I can simply start writing the code.
maxbond
That's awesome, best of luck to you.

This item has no comments currently.