Back to articles
[Rust Guide] 3.4. Functions and Comments

[Rust Guide] 3.4. Functions and Comments

via Dev.toSomeB1oody

3.4.0. Before the Main Content Welcome to Chapter 3 of Rust self-study. There are 6 sections in total: Variables and Mutability Data Types: Scalar Types Data Types: Compound Types Functions and Comments (this article) Control Flow: if else Control Flow: Loops Through the small game in Chapter 2 ( strongly recommended for beginners who haven't read it ), you should already understand the basic syntax of Rust. In Chapter 3, we will go deeper and learn general programming concepts in Rust. If you like it, remember to like, bookmark, and follow. Follow the series if you want to keep learning. 3.4.1. Basic Understanding of Functions Functions are declared using the keyword fn By convention, function and variable names follow snake_case: All letters are lowercase, and words are separated by underscores Example: another_function Rust does not require functions to be defined before they are called, as long as they are declared and can be found. This is more flexible than some older languages (

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles