Alright, so we gotta talk about mutability. Mutability refers to the ability of an object's value to be changed after it's creation. If you can change it, it's considered mutable. If you cannot alter it after its creation, it is considered immutable. So, by default, when we use variables and
Possibly-uninitialized? But we did. We DID. We didn't. We declared a type, but we didn't give it a value. It's like the sound of one hand clapping. We can't use it. Lucky Number Seven.
With this file, we're starting to look at data types. It's not happy with line 7, where we tell it that we are going to be using a variable, x. It says, consider giving x a type, but let's be honest, when it says consider, it really means you have
Let's start on variables1.rs. When we look at the errors it's not quite intuitive, coming from Ruby. My initial reaction is that when we look at line 8, what do you mean not found in this scope? We're just making a new variable x, and setting five into it.
Learn to set up Rustlings
Today we're talking about the difference between static and dynamic typing in our programming languages. Ruby is a dynamically typed language, and Rust is a statically typed language. This all revolves around how we handle data types in our code. We know that generally, different kinds of data in computing
Hopefully, at this point, you've got Rust installed and you're good to go. If you haven't, just pop on over here. We want to start things off by having you get to know your way around Cargo. Cargo is Rust's build system and package manager. Now, there's no real Ruby
Presumably, you are here because you want to get Rust installed on your computer. If you're a Rubyist, you're probably wanting to know what version manager you're going to have to install, whatever the Rust equivalent to rvm or rbenv is. And then you're going to want to know what
One of the things that is important to understand as we transition from Ruby to Rust is the difference between compiled and interpreted programming languages. Rust is one of the former and Ruby is one of the latter. To discern between the two, we have to go a bit back