Uploaded April 2024 | Updated November 2026, 2 hours ago
Here are some best practices for error handling in Rust programming that I've found effective:
- For tests and examples, use "box dyn error" instead of "anyhow."
- Prefer the "?" pattern over "unwrap" or "expect," even in tests and examples, to align with production coding standards.
- "Box dyn error" is excellent for error passthrough, as are `map_err` and `ok_or` with static strings and formatted strings.
- In production code, use an enum with fully descriptive variant names and favor struct variants with clear names over tuple variants.
- Avoid relying on the display to convey the meaning of error variants.
- In web or device applications, human error rendering might not occur at the enum/type level, so using Debug for display may suffice.
- For web or device applications, using Serialize for errors that need to be logged or sent to the client for display can be a powerful and straightforward pattern.
- Prioritize clarity in error naming (variants) and focus on consistency as the code develops.
- Don't be afraid of medium-length enum variant names; remember, type refactoring is straightforward.
- In summary, start with progressive and clear practices, and become more structured as the code matures.
== Jeremy Chone:
- Patreon - patreon.com/jeremychone - Any help is a big help (for Rust educational content)
- Twitter - twitter.com/jeremychone
- Discord general-rust - discord.gg/W2besKCzjx
- Discord rust10x - discord.gg/XuKWrNGKpC
- Rust10x - rust10x.com - Rust resources for production coding.
Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.
== Rust10x AI / OpenAI / Ollama
- Rust OpenAI API Tutorial: youtube.com/watch?v=PHbCmIckV20&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Ollama Tutorial: youtu.be/OcH-zT5VNgM
== Rust10x Web App production coding:
Episode 01: youtube.com/watch?v=3cA_mk4vdWY&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 02: youtube.com/watch?v=-dMH9UiwKqg&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 03: youtube.com/watch?v=zUxF0kvydJs&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 04: youtube.com/watch?v=3E0zK5h9zEs&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 05.1: youtube.com/watch?v=Gc5Nj5LJe1U&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Web Site: rust10x.com/web-app
GitHub: github.com/rust10x/rust-web-app
Discord rust10x - discord.gg/XuKWrNGKpC
Patreon - patreon.com/jeremychone - Any help is a big help (for Rust Production Coding educational content)
== Other
Other popular Rust Programming videos:
- Rust Web App Production Coding Blueprint - youtube.com/watch?v=3cA_mk4vdWY&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Axum - Full Course - youtube.com/watch?v=XZtlD_m59sM&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Type State Builder Pattern - youtube.com/watch?v=pwmIQzLuYl0&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Quick Start Code Layout - youtube.com/watch?v=oxx7MmN4Ib0&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- AWESOME-APP Full Overview - Rust template for building Awesome Desktop Application: youtube.com/watch?v=BY_ZjPGqJJk&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Tauri Quick Introduction (Desktop App wit Rust Programming): youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Web App tutorials series: youtube.com/watch?v=VIig9IcQ-w8&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q&list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Bevy Full Tutorial - Game Development with Rust: youtube.com/watch?v=j7qHwb7geIM&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust for Java Developers series: youtube.com/watch?v=iFdh4sPC5Tg&list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc&index=2&t=654s
Playlists:
- Rust AI Programming Series: youtube.com/playlist?list=PL7r-PXl6ZPcBcLsBdBABOFUuLziNyigqj
- Rust Web App Production Coding Series: youtube.com/playlist?list=PL7r-PXl6ZPcCTTxjmsb9bFZB9i01fAtI7
- Rust For Desktop App: youtube.com/playlist?list=PL7r-PXl6ZPcAQAi1lfVrtHCSbaJbwZ4O8
- Everything Rust Programming - Tutorials, Courses, Tips, Examples: youtube.com/playlist?list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Programming for Web Development: youtube.com/playlist?list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Courses: youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE
- Rust for Java Developers: youtube.com/playlist?list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc
Rust10x - Coding Resources for Production Coding in Rust. ➜ rust10x.com
Other notes:
- ScreenBrush for the green lines. (Gromit seems to be the equivalent on Linux)
- Sketchapp for some graphics.
- Davinci Resolve and Fusion video editing.
- VSCode with Google Material icon themes (with some customization)
Here are some best practices for error handling in Rust programming that I've found effective:
- For tests and examples, use "box dyn error" instead of "anyhow."
- Prefer the "?" pattern over "unwrap" or "expect," even in tests and examples, to align with production coding standards.
- "Box dyn error" is excellent for error passthrough, as are `map_err` and `ok_or` with static strings and formatted strings.
- In production code, use an enum with fully descriptive variant names and favor struct variants with clear names over tuple variants.
- Avoid relying on the display to convey the meaning of error variants.
- In web or device applications, human error rendering might not occur at the enum/type level, so using Debug for display may suffice.
- For web or device applications, using Serialize for errors that need to be logged or sent to the client for display can be a powerful and straightforward pattern.
- Prioritize clarity in error naming (variants) and focus on consistency as the code develops.
- Don't be afraid of medium-length enum variant names; remember, type refactoring is straightforward.
- In summary, start with progressive and clear practices, and become more structured as the code matures.
== Jeremy Chone:
- Patreon - patreon.com/jeremychone - Any help is a big help (for Rust educational content)
- Twitter - twitter.com/jeremychone
- Discord general-rust - discord.gg/W2besKCzjx
- Discord rust10x - discord.gg/XuKWrNGKpC
- Rust10x - rust10x.com - Rust resources for production coding.
Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.
== Rust10x AI / OpenAI / Ollama
- Rust OpenAI API Tutorial: youtube.com/watch?v=PHbCmIckV20&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Ollama Tutorial: youtu.be/OcH-zT5VNgM
== Rust10x Web App production coding:
Episode 01: youtube.com/watch?v=3cA_mk4vdWY&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 02: youtube.com/watch?v=-dMH9UiwKqg&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 03: youtube.com/watch?v=zUxF0kvydJs&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 04: youtube.com/watch?v=3E0zK5h9zEs&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Episode 05.1: youtube.com/watch?v=Gc5Nj5LJe1U&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
Web Site: rust10x.com/web-app
GitHub: github.com/rust10x/rust-web-app
Discord rust10x - discord.gg/XuKWrNGKpC
Patreon - patreon.com/jeremychone - Any help is a big help (for Rust Production Coding educational content)
== Other
Other popular Rust Programming videos:
- Rust Web App Production Coding Blueprint - youtube.com/watch?v=3cA_mk4vdWY&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Axum - Full Course - youtube.com/watch?v=XZtlD_m59sM&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Type State Builder Pattern - youtube.com/watch?v=pwmIQzLuYl0&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Quick Start Code Layout - youtube.com/watch?v=oxx7MmN4Ib0&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- AWESOME-APP Full Overview - Rust template for building Awesome Desktop Application: youtube.com/watch?v=BY_ZjPGqJJk&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Tauri Quick Introduction (Desktop App wit Rust Programming): youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Web App tutorials series: youtube.com/watch?v=VIig9IcQ-w8&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q&list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Bevy Full Tutorial - Game Development with Rust: youtube.com/watch?v=j7qHwb7geIM&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust for Java Developers series: youtube.com/watch?v=iFdh4sPC5Tg&list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc&index=2&t=654s
Playlists:
- Rust AI Programming Series: youtube.com/playlist?list=PL7r-PXl6ZPcBcLsBdBABOFUuLziNyigqj
- Rust Web App Production Coding Series: youtube.com/playlist?list=PL7r-PXl6ZPcCTTxjmsb9bFZB9i01fAtI7
- Rust For Desktop App: youtube.com/playlist?list=PL7r-PXl6ZPcAQAi1lfVrtHCSbaJbwZ4O8
- Everything Rust Programming - Tutorials, Courses, Tips, Examples: youtube.com/playlist?list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Programming for Web Development: youtube.com/playlist?list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Courses: youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE
- Rust for Java Developers: youtube.com/playlist?list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc
Rust10x - Coding Resources for Production Coding in Rust. ➜ rust10x.com
Other notes:
- ScreenBrush for the green lines. (Gromit seems to be the equivalent on Linux)
- Sketchapp for some graphics.
- Davinci Resolve and Fusion video editing.
- VSCode with Google Material icon themes (with some customization)

- 2024-05-23` - Updated to Bevy 0.12 & 0.13. Thanks to [Vinzenz Schroeter (@kaesaecracker)](https://github.com/kaesaecracker)
- 2023-10-11 - Updated to Bevy 0.11.3. Thanks to [juliohq](https://github.com/juliohq)
- 2023-05-02 - Updated to Bevy 0.10. Thanks to [ehasnain](https://github.com/ehasnain)
- 2022-12-13 - Updated to Bevy 0.9. Thanks to [GiulianoCTRL](https://github.com/GiulianoCTRL)
- 2022-08-07 - Updated to Bevy 0.8. Thanks to [DomagojRatko](https://github.com/DomagojRatko)
Chapters:
- 00:00:00 - Intro
- 00:01:45 - First Bevy WIndow
- 00:03:11 - First ECS System (setup system)
- 00:05:39 - First Player Game Sprite
- 00:11:15 - Spawn Player System
- 00:14:54 - First Bevy Plugin (Player Plugin)
- 00:16:28 - First Bevy ECS Components (Player, Velocity)
- 00:18:35 - First Player Movement System
- 00:21:19 - Keyboard Game Controller Move System
- 00:23:37 - Player Laser
- 00:25:49 - Player Laser Move (Movable System)
- 00:28:39 - Despawn Lasers
- 00:29:59 - Bi Lasers
- 00:31:24 - First Enemy Spawn
- 00:34:13 - Laser Collision System
- 00:39:53 - Explosion
- 00:48:42 - Enemy Respawn
- 00:53:42 - Enemy Fire
- 00:57:54 - Player Explosion
- 01:00:21 - Player Respawn
- 01:04:32 - First Enemy Movement (ellipse)
- 01:08:59 - Enemy Formations
- 01:18:53 - Final Demo
Jeremy Chone:
- Twitter - https://twitter.com/jeremychone
- Discord On Rust - https://discord.gg/W2besKCzjx
- AWESOME-APP - https://awesomeapp.dev - Rust Templates for building awesome applications.
- Patreon - https://patreon.com/jeremychone - Any help is a big help (for Rust educational content)
Other popular Rust Programming videos:
- Desktop Application Code Rust Programming template full Overview: https://www.youtube.com/watch?v=BY_ZjPGqJJk&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Tauri Quick Introduction (Desktop App wit Rust Programming): https://www.youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Web App tutorials series: https://www.youtube.com/watch?v=VIig9IcQ-w8&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q&list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Bevy Full Tutorial - Game Development with Rust: https://www.youtube.com/watch?v=j7qHwb7geIM&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust for Java Developers series: https://www.youtube.com/watch?v=iFdh4sPC5Tg&list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc&index=2&t=654s
Playlists:
- Rust For Desktop App: https://youtube.com/playlist?list=PL7r-PXl6ZPcAQAi1lfVrtHCSbaJbwZ4O8
- Everything Rust Programming - Tutorials, Courses, Tips, Examples: https://youtube.com/playlist?list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- Rust Programming for Web Development: https://youtube.com/playlist?list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- Rust Courses: https://youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE
- Furst for Java Developers: https://youtube.com/playlist?list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc
More notes on Bevy:
For Linux developer (From Ryans comment below)
Commands:
install package:
sudo apt-get install libasound2-dev
systemd update(needed for next command):
sudo apt-get install systemd
libudev-sys related package:
sudo apt-get install libudev-dev
Topics learned and used:
- Rust Programming for Game Development
- Game ECS Engine Bevy
- Bevy System, Bevy Components, Bevy Resources
- Bevy Plugins
- Bevy entities spawn and despawn
- Bevy SpriteBundle, Sprite Sheet (SpriteAtlas)
- Bevy Timesteps, Time, and Timer
- Bevy custom system criteria
- Indirection strategy to spawn explosions
- Sprite Sheet atlas for sprite animations
- Basic Rust Programming
- Rust module
- Rust closure
- Rust matches
Resources:
- Rust:
- [Rust Book](https://doc.rust-lang.org/book/)
- [Rust Video Course](https://www.youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE)
- Bevy:
- [Official Bevy Web Site](https://bevyengine.org/)
- [Official Bevy Book](https://bevyengine.org/learn/book/introduction/)
- [Unofficial Bevy Cheat Book](https://bevy-cheatbook.github.io/)
- [Official Bevy API Doc](https://docs.rs/bevy/latest/bevy/index.html)
- [Official Bevy Assets](https://bevyengine.org/assets/)
- [Offical GitHub examples](https://github.com/bevyengine/bevy/tree/latest/examples)
- [Great Blog Post - snake game](https://mbuffett.com/posts/bevy-snake-tutorial/)
- Assets:
- [Player, Laser, Enemy Sprites](https://opengameart.org/content/space-shooter-redux)
- [Explosion](https://opengameart.org/content/explosion) Rust Bevy Full Tutorial - Game Development with Rust - Git Code Updated to Bevy v0.14 !!!](https://i.ytimg.com/vi/j7qHwb7geIM/mqdefault.jpg)
![State Management with Native Web Components - Full Code Walkthrough - No Frameworks! [intermediate]
Full code walkthrough of state management with Native Web Components, with no framework, no virtual DOM, just best practices, and scalable code design.
- Episode source code: https://github.com/jeremychone-channel/s01e05-client-state-management
- Quickstart source code: https://github.com/dom-native/quickstart
00:00 - Intro
00:34 - Setup
00:52 - v-project base component
02:18 - DcoMock (create and list)
04:42 - v-project refresh method
05:31 - c-task component
07:15 - Add new task logic (v-project)
08:55 - c-task click to update concept
10:49 - c-task click to update code
12:40 - c-task update in-place
13:42 - Recommendations
Approach:
Scalable web application UI code using the Browser As The Framework.
NO ReactJS, NO Angular, NO vuejs/virtual-dom.
Good code design and Native Web Component can scale as well if not better than big or small web framework.
Principles:
- Best Practices over Frameworks
- Simple scales better
- Making something easy does not make it right.
OWN your code design from the start, do not delegate it to frameworks!
#JavaScript #WebComponents #TypeScript #NativeWebComponents #Frontend
Icon attributions:
- (brain & maze icons) Icon made from http://www.onlinewebfonts.com/icon, Icon Fonts, is licensed by CC BY 3.0
- (feather icon) Icon made by https://www.flaticon.com/authors/freepik from https://www.flaticon.com State Management with Native Web Components - Full Code Walkthrough - No Frameworks! [intermediate]](https://i.ytimg.com/vi/k2RLCMetpLw/mqdefault.jpg)








