Concept Prerequisites
Among the many programming languages used in production, Rust is one of the less beginner friendly.
This is for a couple of reasons:
- It is very strict and requires understanding of its key concepts to program effectively (which means that just jumping head first can lead to frustration)
- Knowledge of both lower-level systems programming and high-level functional/declarative programming concepts is required
- Strong static typing with explicitly written types in many places
- Concepts uncommon in the industry such as extensive pattern-matching and reliance on traits
Therefore a theoretical foundation is required before jumping head first into Rust.
It is also important to note that our field is full of trade-offs. The greater investment required to learn and implement Rust opens up the possibility of a great pay-off in terms of safety, correctness, performance and maintenance cost.
In general, languages are either good for developing effective (performant) applications or good for developing applications effectively (rapid prototyping). Rust leans more into the category of the former, although its development time requirements are not prohibitively long.
I recommend having at least a cursory knowledge of these topics (more important topics are highlighted):
- What is a variable and a reference/pointer
- https://www.careerride.com/C++-what-is-pointer.aspx
- You don't need to know the C syntax, Rust has a slightly different one, but you should know what a pointer is
- Mutability
- The capability of a value (variable binding) to be changed after initial assignment
- http://rigaux.org/language-study/various/mutability-and-sharing/
- User-defined (compound) types vs primitive types
- https://en.wikipedia.org/wiki/Data_type - See sections Primitive types and Composite types
- https://ict.senecacollege.ca/~oop244/pages/content/struc_p.html - no need to read C syntax
- Bools, Strings, Integers, Floats (IEEE-754)
- Bool - https://www.thoughtco.com/definition-of-bool-958287
- String - https://en.wikipedia.org/wiki/String_(computer_science)
- Integer - http://cs.potsdam.edu/Documentation/php/html/language.types.integer.html
- It is especially helpful to know that there is such a thing as integer overflow and underflow
- Data Types in general
- General control structures (ifs, loops, etc.)
- Subroutine - procedure, function, method and the distinction between these terms
- https://en.wikipedia.org/wiki/Subroutine
- All procedures in Rust are functions, they return a value even if it is
()indicating nothing - Traits and structures have methods implemented on them
- The terms structure, class, inheritance, enumeration, union
- Generics and polymorphism
- Generics: https://dev.to/designpuddle/coding-concepts---generics-34cf
- Polymorphism:
- https://www.educba.com/what-is-polymorphism/
- https://www.bmc.com/blogs/polymorphism-programming/
- The type of polymorphism most often employed by Rust is Bounded parametric polymorphism, you can find it described in the Strange Linked List chapter
- Manual memory management vs Garbage Collection
- https://en.wikipedia.org/wiki/Manual_memory_management
- https://cs.wikipedia.org/wiki/Garbage_collection
- Rust does not use a Garbage Collector, but it is important to know what it is. Also, reference-counting GCs are related to the
RcandArctypes
- Stack vs Heap
- Multitasking - parallel vs concurrent vs distributed systems
- Interpreted vs compiled languages
- https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/
- Rust is a compiled programming language, although an experimental Rust interpreter exists
- Imperative vs declarative programming
- https://www.freecodecamp.org/news/imperative-vs-declarative-programming-difference/
- Rust is a multi-paradigmatic programming language, and generally, you will write a blend of both mentioned above, however, where it is possible, idiomatic Rust tends to prefer a declarative approach (for example: using iterators over loops)
Feel free to just DuckDuckGo (or even Google) these topics, you don't need to be proficient in any of these, but it helps to know what these concepts are, so that you are familiar with the terms when they are mentioned.