How does Rust make me write GOOD CODE ?

Ғылым және технология

How does Rust Programming make us write better code? That was a good question from reddit (link below).
Help support this channel: / jeremychone
Reddit original question: / how_does_rust_make_me_...
#Rust #rustprogramming
Jeremy Chone:
- Twitter - / jeremychone
- Discord On Rust - / discord
- AWESOME-APP - awesomeapp.dev - Rust Templates for building awesome applications.
- Patreon - / jeremychone - Any help is a big help (for Rust educational content)
Other popular Rust Programming videos:
- AWESOME-APP Full Overview - Rust template for building Awesome Desktop Application: • Building Awesome Deskt...
- Tauri Quick Introduction (Desktop App wit Rust Programming): • Rust Tauri 1.0 - Quick...
- Rust Web App tutorials series: • Rust Web App - 1/3 - D...
- Rust Bevy Full Tutorial - Game Development with Rust: • Rust Bevy Full Tutoria...
- Rust for Java Developers series: • Rust for Java Develope...
Playlists:
- Rust For Desktop App: • Rust Programming for D...
- Everything Rust Programming - Tutorials, Courses, Tips, Examples: • Everything Rust Progra...
- Rust Programming for Web Development: • Rust Programming for W...
- Rust Courses: • Rust Course 2021 by th...
- Furst for Java Developers: • Rust for Java Developers
Jeremy Chone:
- Twitter - / jeremychone
- Discord General Rust - / discord
- Discord Awesome-App - / discord
AWESOME-APP ➜ awesomeapp.dev - Rust Templates for building awesome applications.
Rust AWESOME-APP GitHub - github.com/orgs/rust-awesome-...

Пікірлер: 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

  • @user-ex8vj4qe7n
    @user-ex8vj4qe7n Жыл бұрын

    Thank you for your video !! You explain so clear and make me understand easily!! Great author

  • @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.

  • @BA-oq2ih
    @BA-oq2ih Жыл бұрын

    Thanks for the video! 👍🏼

  • @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.

  • @FauzulChowdhury
    @FauzulChowdhury Жыл бұрын

    Alright alright... I am gonna start 🦀 rust. Nuf said.

  • @adjbutler
    @adjbutler Жыл бұрын

    amazing video! well done!

  • @vanlepthien6768
    @vanlepthien6768 Жыл бұрын

    For every good feature, there is someone who will find out to make it go bad :)

  • @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.

  • @blasm1713
    @blasm1713 Жыл бұрын

    very informative, frenchman

  • @electron6825

    @electron6825

    Жыл бұрын

    A bit rude lol

  • @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

    26 күн бұрын

    "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?

Келесі