A quick note from the editor:
I recently got to join and moderate a live AMA call that Jayson did with our students in the Zero To Mastery virtual campus.
Students and I asked questions about Rust, how it works, some technical questions, how he got started learning to code (without the internet 😱), and there were even some ‘out there’ tangents.
You can check out Jayson's answers to the questions from his AMA call below, but first, let me introduce him.
Jayson is a self-taught software developer and Linux computing enthusiast, as well as the instructor of our Zero To Mastery course on the Rust programming language.
Using his knowledge from being industry certified in networking & security, Jayson has designed, written, and deployed reliable and secure Rust-powered full-stack web applications, so he’s highly experienced and also a fantastic teacher.
His lessons are clear, detailed, and easy to follow so his students can understand what will be covered, how to actually implement what they've learned, and then review why it worked as well as common errors and issues that you'll likely encounter.
(Jayson also puts a large focus on giving practical exercises, so that you can practice and immediately apply what you're learning to real projects.)
Want a sneak peek of Jayson's Rust course?
Well we just released a 6 hour Rust 101 teaser on Youtube, or check it out below:
As you can see, he knows what he's talking about when it comes to Rust, so without further adieu, here are Jayson's AMA answers
The questions below were either live on the call, or sent in via our Rust Discord channel.
If you want to ask questions for future AMA's, be sure to join our Discord here.
Rust is what I like to call, the “next generation” of programming languages. It checks your work along the way, so it helps catch bugs before they can reach deployment and cause downtime.
You can use Rust for general purposes or any kind of application, but it mostly focuses (and is marketed towards), high-speed and reliable applications that are low on memory usage.
Even though it's mainly used for high-performance projects, I think Rust is great for general purpose as well, because you save a lot of time when working with Rust, as opposed to using a different language and having to crush bugs at 2 am because your server went down.
Instead, you just hit compile and if there’s an issue, Rust will let you know before you deploy!
I think Rust is popular for a lot of reasons because every part of Rust seems to be designed to improve upon the Developer experience, and just makes it so much easier to work with the code, especially with the compiler.
The compiler will even go so far as to print out your code with the error, and then print out a corrected version and say “Hey, you might want to try this code to fix this problem!”
To me, that just makes the whole Developer experience really great.
In terms of specific applications, there are a lot of Linux command-line tools that have been written in Rust, such as ls and grip. (They’ve been made multi-thread and given modern features such as using icons and things in the terminal.)
There are also a lot of back-end things that have been built with Rust (and which most people won’t have had exposure to), but for example, Discord, a lot of their infrastructure is running on Rust now.
So for big servers such as the ZTM server (our private Developer Discord community), where there are over 300,000 students now... that's a huge amount of data that’s being managed by Rust.
Rust’s ability to crunch through that volume of data quickly is really important for fast web services and a good user experience.
Hmm, not sure about that one! I haven’t used R, but it has no relation to Rust whatsoever.
(It may be that people assume it’s the same tool or a variation, simply because they both start with the same letter.)
It kind of depends on how you approach learning it. If you come to Rust with no experience, I personally think it’s easy to intermediate difficulty to learn. (As I said before, the compiler is great at guiding you along.)
But if you’re coming in with an Object-Oriented background with years of experience, then you may find that switching over to Rust is slightly more difficult, just because of how it differs from what you already know, and because you’ll be trying to apply object-oriented principles to Rust, which doesn’t mesh well with that approach.
Rust is a hybrid between functional and imperative. There’s not many of the typical object-oriented programming methodologies in there. There’s no classes or inheritance, but you can sort of emulate those behaviors if you want to, but it’s not the recommended way to use Rust to code.
I think if you’re serious about a career in Software Engineering, then you can for sure pick it up as your first language.
But if you’re more casually programming, or working on some small apps or a website, then it would help to have a little bit of programming experience before you jump into Rust.
10 years is a pretty long way out, so it’s hard to know. The release cycle for Rust (for new updates) is every 6 weeks, so we basically have a new version and possibly new features every 6 weeks.
Then, every 1.5-2 years, they lock the features down at that point, which allows them to make breaking changes without breaking old code, by using a special addition system that keeps everything separated.
As far as its 10-year trajectory, I think in the next 5 years, people will be using Rust more often for high-speed applications and anything that needs a lot of performance, whereas, in 10 years, I think we’ll see a lot more general-purpose usage, thanks to the compiler and how easy it is to code in Rust.
As far as ‘best language’ goes, there is no best language, only the best one suited for your needs or goals. However, in terms of performance, Rust does perform extremely quickly and is on par with C and C++. It also has a lot of great features, but without seeing any performance penalties.
(Traditionally if you have a scripting language or a garbage collection language, they have a lot of overhead to make them work and be convenient, but with Rust, you get that same convenience without the performance issues.)
No, Rust is its own language. The original compiler was written in OCaml, and then eventually it was bootstrapped, and now Rust is written in Rust.
However, Rust does take a lot of inspiration and examples from different programming languages and paradigms:
For example
When you create a variable or object in Rust, the way it does this is that when you create it you own it, and so that piece of memory is yours for that variable.
The idea for things like that was taken from C++, but Rust formalized it into a system where it kind of tracks everything for you, which is how you get the great performance along with the ergonomics.
As far as embedded systems go, you’ll need to target some of the more popular chips so, the really small ones that are in calculators and things would probably not be the best choice.
But for a Raspberry Pi or similar, Rust would be a great choice for those because there are targets and you can compile for those chips.
The best option if unsure is to simply check that your chipset has support so you can overcome any issues.
For Rust, I would recommend either VScode or Clion.
CLion actually wrote their own Rust plugin which will analyze the code for you and get you autocompletions and all that good stuff.
VScode uses Rust Analyzer which is an open-source project. This means that when new commits are added from Rust updates, VScode is the first IDE to update and adopt those changes and features.
I haven’t done anything with quantum computing so I’m not sure sorry. I do know that Python is pretty popular for creating bindings and things for Machine Learning, so I would probably stick with Python for now.
I haven’t done any (HFT) high-frequency trading programming, however, given the risk involved in HFT, I would assume that you would want as many things checking your code as possible.
With this in mind, I would imagine that over time people would transition to Rust so that they don’t have any erroneous transactions that could lose millions of dollars in a couple of minutes!
The best way to become any Developer is to just start writing code.
The job is to write code and build things, so if you start off building a small project and gradually add more features before moving on to bigger projects, you’ll start to broaden your horizons.
Also, don’t stick with just one specific segment of the market. Try different things to see what you like and don’t like, and find what you’re good at. Eventually, you’ll have enough projects and be able to make a portfolio so that you can sell businesses on your skills and get a career.
Algorithms!
Interviewers love to give you the algorithm and data structure questions, so spend a few months practicing those, nail the interview, and then once you get the job you can just do the easier stuff!
Note:
We have a course here at Zero To Mastery exactly on these Data structures + Algorithm interview questions.
I always have that feeling of not knowing enough, but I get over it by building things.
For example
If I set a goal to build a specific project, I work on it until completed. Seems simple, but by being able to finish it, I now know that I know enough in that particular area which can give you confidence.
The thing with programming is that there’s always something new to learn, and you’ll never know it all. When you realize that though, it’s freeing and allows you to push through it and adapt.
Also, there’s always something. Usually, some small detail that you didn’t know ends up being the crux of a project. The thing is, by learning it during the project, you’ll know it far better than if you never had that hands-on experience.
Don’t try to know everything. Instead, focus on learning the 20% that’s important and then learn to adapt and learn how to learn efficiently!
For me, it was 3 years and it involved lots of making projects and submitting applications.
It can help if you have a degree, so if you’re in an economic position where you can go to college and get a degree, then that’s probably something that could help, mainly because the software that they use to filter applicants will often check for “must-have degree” before it moves you to the next section.
There are ways to get around this, such as great pitches or being recognized in coding comps, etc. (You can also do freelance work, ethical hacking, bug bounties, and other things without the degree or needing to be hired.)
For practice and experience, work with the projects that are part of the tutorials and video training, but then take the next step and expand on those.
Dive into learning how they work and add new features, and then once you get comfortable with this, start making your own projects completely from scratch, as this will help you stand out.
This way you have a foundation to start with so it’s not so daunting, and then you can build on it and differentiate yourself from the crowd.
Note:
ZTM student Duaij did exactly this by building a small app to solve a problem for his current company, and they went ahead and paid for his education to become a full-time Developer!
Rust is pretty complex and there are a lot of elements, so there’s never one specific question that stands out, more a range of them across the board.
That being said, we do have a Discord channel in the ZTM Discord dedicated to Rust where people can ask anything, but no, nothing that stands out right now sorry.
I prefer Rust over Go, simply because I think Rust has a lot more features, and I really like the compiler because it catches all my bugs!
As far as the differences, Rust is more of a general-purpose language so you can kind of use it for anything. Whereas Go is more designed for Google with microservices etc.
Also, Go follows the more traditional programming models that people might be more familiar with. This means that hopping into Go is really easy (assuming you have previous coding knowledge), compared to hopping into Rust, simply due to the differences and extra work required to learn Rust.
If you know Python or Javascript, you’ll find Go an easier language to get into and be fairly efficient in a couple of weeks.
My self-learning path is a little bit different than what is possible today because when I started I didn’t have the internet or access to programming books or courses.
I kind of stumbled my way at the time through Windows 95, and eventually, I found a help document buried deep in the Windows folder that had QBASIC and some very basic commands, and with that, I learned to automate my Math homework.
I didn’t want to do homework as a student, and then from there I just kept going.
As I said, my path is a lot different from what would be typical today!
Lazy programmers are really efficient at making stuff that automates things 😉
For starter programs, I always go with the GNU utilities such as ls, cat, or echo. Really easy ones to get started with.
The reason I always recommend those, especially if you have LS or GRIP, is because you can just start simple and just do the bare bones that you need to do, but you can keep adding features to them as you keep learning more about Rust.
For example
You can start with just loading files and just reading through one at a time, and then you can start adding on parallel processing threads, etc.
After that, you can start doing optimization with the different string parsing, and then add even more features like colors and it just keeps going on and on, because there are so many features you can add.
Graydon Hoare created Rust as a pet project while working at Mozilla.
Mozzila found out about their work and then started to fund the project, which makes sense because web browsers are one of the most complicated softwares around. They’re basically an operating system with a whole bunch of features and so the code becomes more and more complicated over time.
But because Rust's compiler helps to remove that complexity due to it checking everything, it made total sense for Mozilla to help fund its creation. (Rust checks every single line on every compile!)
It would be great if Rust had a garbage collected interface, so that if you ever just want to throw something together and not have to worry about dealing with lifetime issues, or if you make too many copies of data then you could.
It would be nice to just have a way to say “Hey, I just want to turn garbage collected mode on”, and then just ignore all the issues with tracking things.
That might already be doable with some fancy macros or a language feature, but it would be great to have something like that built-in, to help people ease their way into Rust and not worry about managing memory by hand.
I’ve been programming in Rust for around 6-7 years now, and I’ve never used unsafe a single time.
Rust has memory safety guaranteed, and that enforces a type system, so if you tell the compiler you’re working with someone's name for example, then you can’t just convert that person’s name into a truck or a vehicle or something, as that’s not allowed.
But as soon as you go into the unsafe mode, you can go to that individual chunk of memory and just tell the compiler, “Hey, this is actually something completely different to what it’s listed as, but trust me, I know what I’m doing”.
That’s the purpose of unsafe mode. To manually tell the compiler that you want to convert something or interpret it differently than what the language thinks is happening.
But like I say, in 7 years I’ve never run into an issue where I needed to use unsafe because when you go into unsafe you lose some of the benefits of the compiler, and I would prefer to let my code run smoothly!
That being said, if you have a background in C++, then you might want to use this mode to let you run and bypass learning some of the Rust processes.
When it comes to Game Development, I always ask 2 questions:
If you want to make a game, then I recommend using Unity or Unreal engine, because those engines are already built and ready for you to make a game on.
But, if you want to make a game and do all of the programming, then you’ll probably spend 80-90% of your time just making the engine before you can even get to the point where you start making the game itself!
However there are multiple crates (which are libraries in Rust) that allow you to make games and one of them does have a built-in editor, so it’s similar to Unity but it’s very bare-bones.
The other crates are more focused on collision detection or graphics drawing and other things. So you totally could use Rust to develop a game, but ask yourself if you want to make a game or an engine first.
As far as topics go, we update the courses every year on ZTM, so as new features get added to Rust, they’re going to show up in the Rust course.
And as far as projects go, drop something in the Discord channel and let us know what you want to work on. If enough people also want that project then we’ll get it made.
If you want to learn more about the Rust programming language and follow a step-by-step training program with examples and tutorials, then check out Jayson’s course on Rust here.