Тёмный

How does Rust make me write GOOD CODE ? 

Jeremy Chone
Подписаться 26 тыс.
Просмотров 14 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@ericb.9777
@ericb.9777 Год назад
A nice video and always nicely structured. I would also add the borrow checker, as soon as you end fighting against but working with it, you improved your knowledge of the memory model and concurrency patterns which are only optionals in other languages.
@JeremyChone
@JeremyChone Год назад
yes, very good point. I did not find a way to articulate concisely, but I see "data integrity" as part of the "Data First" point. As you say, Rust makes us understand how data flows through the application code.
@JorgetePanete
@JorgetePanete Год назад
This video helped me understand how rust uses composition better, thank you
@pup4301
@pup4301 Год назад
There is pseudo polymorphism where you have a dyn trait with a function that converts it reference holder from a dyn trait to dyn any trait. You then downcast the dyn any trait to a structure that implements the dyn trait. Also rust pseudo inheritance because you can take that same dyn trait and give a structure a structure that own that dyn trait with a as_any function, get function and get_mut function. The get functions will get the structure embedded in the owner structure. You can the implement function along with the get functions to call the functions of the slave structure while at the same time you will be able to call the functions of the owner structure.
@L0wPressure
@L0wPressure Год назад
I mean, i tried it and it works. Is it actually a good idea to use it though?
@pup4301
@pup4301 Год назад
@@L0wPressure Yes because I no longer have to type out the paths for a embedded structure and I can have a list of different typed structures and pass them around as if they are the same type.
@L0wPressure
@L0wPressure Год назад
Good points. Regarding the inheritance: i'm reading a book Web programming in rust and right in the beginning author suggests to create artificial parent class BaseRole to be inherited in AdminRole { super_class: BaseRole ... }. It's probably to make Java guys feel at home, but that looks SO weird in the rust context.
@JeremyChone
@JeremyChone Год назад
Hum, that would be a miss-used IMO. My strategy with Languages is to not fight with their spirits. Don't code TypeScript the Java way, don't code Swift the Java way, and obviously, don't code Rust the Java way. Understanding the "gist" of the language and embracing is essential (IMO). Otherwise, we are in constant dissonance.
@krischalkhanal2842
@krischalkhanal2842 Год назад
Henry Tance
@glennmiller394
@glennmiller394 Год назад
Thanks!
@JeremyChone
@JeremyChone Год назад
Thanks a lot, very much appreciated.
@李晧暐
@李晧暐 Год назад
Thank you for your video !! You explain so clear and make me understand easily!! Great author
@FauzulChowdhury
@FauzulChowdhury Год назад
Alright alright... I am gonna start 🦀 rust. Nuf said.
@BA-oq2ih
@BA-oq2ih Год назад
Thanks for the video! 👍🏼
@vanlepthien6768
@vanlepthien6768 Год назад
For every good feature, there is someone who will find out to make it go bad :)
@adjbutler
@adjbutler Год назад
amazing video! well done!
@blasm1713
@blasm1713 Год назад
very informative, frenchman
@electron6825
@electron6825 Год назад
A bit rude lol
@user-qr4jf4tv2x
@user-qr4jf4tv2x Год назад
if only we can have a js,c# like structure without the pitfalls of each and the performance of rust and the best parts of rust.. if its not for performance people would have still stick to high language.
@esben181
@esben181 Год назад
Wtf is good code? If it's fast and doesn't segfault then great
@JeremyChone
@JeremyChone Год назад
Here is my take on what makes good code (probably not exhaustive) 1) Fast to start, fast to run. 2) No segfault. 3) No thread-unsafe code. 4) Componentized and compartmentalized. 5) Simple to get back into 6 months after. 6) Simple to add new functionality while improving the data and "application" model. Here Simple != Easy. Easy = Close of reach. Can get something working fast without too much learning at the cost of intertwined layers. Simple = Various layers/structures are more decoupled but integrate well without knowing about each other. Often require more upfront work on learning the technology and designing the model, but from our experience, it scales much better.
@esben181
@esben181 Год назад
@@JeremyChone Yes I agree
@MarcosVMSoares
@MarcosVMSoares Год назад
No Rust isn't data first. That is Elixir, Clojure and outher functional languages. Rust still mix data with functions and therefore create methods. But still better the OOP or something like Go
@HansBezemer
@HansBezemer 3 месяца назад
"Data first" is a state of mind. You might find languages that facilitate that more than others, but it still depends on the programmer. OOP _thinks_ it puts "data first", but all it does is integrate code into the data - and _bind_ it to that data. And this is not the right way to express relationships. Let me put it this way: do the bonds between two hydrogen atoms and one oxygen atoms belong to the oxygen atom or to the two hydrogen atoms?
Далее
SurrealDB - Rust Embedded Database - Quick Tutorial
17:24
8 deadly mistakes beginner Rust developers make
14:14
Просмотров 169 тыс.
Women’s Goalkeepers + Men’s 🤯🧤
00:20
Просмотров 926 тыс.
Rust Programming: TypeState Builder Pattern Explained
14:30
Rust Error Handling - Best Practices
21:33
Просмотров 21 тыс.
Stop writing Rust
9:41
Просмотров 270 тыс.
Rust multi-threading code review
12:13
Просмотров 197 тыс.
Don't Write Comments
5:55
Просмотров 805 тыс.
UUID v7 vs. v4 + Rust Programming Examples
19:41
Просмотров 15 тыс.
The Rust Survival Guide
12:34
Просмотров 151 тыс.
My 10 “Clean” Code Principles (Start These Now)
15:12
Women’s Goalkeepers + Men’s 🤯🧤
00:20
Просмотров 926 тыс.