(no title)
n_u | 1 month ago
In particular, an error on one line may force you to change a large part of your code. As a beginner this can be intimidating ("do I really need to change everything that uses this struct to use a borrow instead of ownership? will that cause errors elsewhere?") and I found that induced analysis paralysis in me. Talking to an LLM about my options gave me the confidence to do a big change.
augusteo|1 month ago
I've noticed the same pattern learning other things. Having an on-demand tutor that can see your exact code changes the learning curve. You still have to do the work, but you get unstuck faster.
jauntywundrkind|1 month ago
carlmr|1 month ago
There's a simple trick to avoid that, use `.clone()` more and use fewer references.
In C++ you would be probably copying around even more data unnecessarily before optimization. In Rust everything is move by default. A few clones here and there can obviate the need to think about lifetimes everywhere and put you roughly on par with normal C++.
You can still optimize later when you solved the problem.
eddd-ddde|1 month ago
Another option is to just use cells and treat the execution model similarly to JavaScript where mutation is limited specific scopes.
monero-xmr|1 month ago
lmm|1 month ago
pfdietz|1 month ago
EDIT: typo fixed, thx
happytoexplain|1 month ago
I.e. the parent is speaking in the context of learning, not in the context of producing something that appears to work.
n_u|1 month ago
> I don't see why it *shouldn't be even more automated
In my particular case, I'm learning so having an LLM write the whole thing for me defeats the point. The LLM is a very patient (and sometimes unreliable) mentor.