Live Stellar Workshop, Week 2, Day 3
Автор: SM Web Systems
Загружено: 2026-03-01
Просмотров: 4
Описание:
Welcome back to Week 2, Day 3 of the Live Stellar Workshop! As we continue our Rust Crash Course, we are shifting our focus to the core logic that drives our applications: Functions and Control Flow.
When designing robust financial systems architecture or writing smart contracts for the Stellar network (XLM), controlling the exact execution path of your program is essential for security and efficiency. In this session, we will learn how to modularize your code using functions, handle returning values, and direct your program's logic using Rust's powerful if/else expressions and loop constructs.
Course Resources & Links:
GitHub Repository (Code & Notes): https://github.com/smwebsystems/rust-...
📺 Watch the Full Workshop Playlist: • Build, Learn & Deploy on Stellar - 8 Week ...
What We Cover in This Session:
Anatomy of a Function: How to define functions, pass parameters, and understand scope.
Statements vs. Expressions: A crucial Rust concept for handling return values without the return keyword.
If/Else Expressions: Branching logic and using if in a let statement to assign variables conditionally.
Repetition with Loops: * loop: Executing code infinitely (and how to break out of it).
while: Running loops based on a condition.
for: The safest and most common way to iterate through collections like arrays.
Practical Coding: Applying control flow to real-world scenarios in our local Cargo environment.
Timestamps:
0:00 - Welcome Back & Day 2 Recap
4:15 - Defining Functions & Passing Parameters
12:30 - Statements vs. Expressions in Rust
18:45 - Returning Values from Functions
25:10 - Control Flow: If and Else Conditions
33:20 - Using If in a Let Statement
38:15 - Repetition: The loop Keyword & Returning Values from Loops
45:00 - Conditional Loops with while
51:30 - Iterating Safely with for Loops
58:00 - Q&A and Homework for Next Session
Homework: Check the GitHub repository for today's exercises. Write a function that uses a for loop to iterate through an array of data, incorporates an if/else check, and returns a specific value. Getting comfortable with these logic blocks is vital before we tackle Rust's Ownership model next!
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: