Coder Social home page Coder Social logo

Comments (4)

Gnosnay avatar Gnosnay commented on July 23, 2024

I believe here we need to introduce what the end of scope is.
E.g. the end of one code block, one pointer transfer to another function e.t.c

from comprehensive-rust.

mgeisler avatar mgeisler commented on July 23, 2024

Hi @Yansongsongsong,

You are completely correct that the error message is about scopes and that the instructor will have to explain what a scope is at this point. That is normally super easy, though, since the course participants already know how to program. To my knowledge, a scope in Rust is the same as a scope in C++ (please correct me if I'm wrong?) and so I normally tell the students that.

To me, ownership is mostly a matter of who should deallocate this value when it goes out of scope? So that is why I start the discussion of borrowing and ownership with scopes.

We should eventually write something about this into speaker notes #53.

from comprehensive-rust.

Gnosnay avatar Gnosnay commented on July 23, 2024

Hi @Yansongsongsong,

You are completely correct that the error message is about scopes and that the instructor will have to explain what a scope is at this point. That is normally super easy, though, since the course participants already know how to program. To my knowledge, a scope in Rust is the same as a scope in C++ (please correct me if I'm wrong?) and so I normally tell the students that.

To me, ownership is mostly a matter of who should deallocate this value when it goes out of scope? So that is why I start the discussion of borrowing and ownership with scopes.

We should eventually write something about this into speaker notes #53.

hi @mgeisler ,
Thank you for your reply.
That sounds great. Looking forward to new version with spears notes!

Feel free to close this issue at any time.

from comprehensive-rust.

mgeisler avatar mgeisler commented on July 23, 2024

Thanks, I'll close it for now.

from comprehensive-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.