Traits are weird

  Рет қаралды 1,647

timClicks

timClicks

Күн бұрын

Пікірлер: 17
@alskidan
@alskidan Жыл бұрын
A longer version would be much appreciated 😊
@mitchbet
@mitchbet Жыл бұрын
Great video, would love a longer version
@jamesl5149
@jamesl5149 Жыл бұрын
There is definitely a discoverability issue with traits. If you're working on a trait heavy API like Axum it can be really perplexing why your code won't build - and the IDE doesn't offer any suggestions. At least, mine doesn't. Maybe RustRover will do a better job
@avatar098
@avatar098 Жыл бұрын
I started thinking of modules as their own type. Traits are part of the module as much as any other struct / function that is defined.
@wojciechrazik
@wojciechrazik Жыл бұрын
Shouldn't the trait be in the same scope as the macro? Maybe the good practice should be to always expose the trait? Please record longer video with explanations!
@JohnSmith-ni4cs
@JohnSmith-ni4cs Жыл бұрын
Traits are indeed weird. Perhaps do a video on how to organize code using traits for people that are used to thinking in the OOP way?
@jahongirrahmonov7323
@jahongirrahmonov7323 Жыл бұрын
You left out one "lbalbalba" at 2:12 lmao
@markmcdonnell
@markmcdonnell 11 ай бұрын
This issue of a trait having to be imported is so annoying in Rust
@agustindiaz3361
@agustindiaz3361 10 ай бұрын
good video! thanks for it some constructive feedback: I think this had a lot of intro and little explanation + conclusion. I think it could be improved by going a bit faster in the beginning and then explaining deeper
@sus7801
@sus7801 Жыл бұрын
why is this?
@JohnPywtorak
@JohnPywtorak Жыл бұрын
I was wondering the same, but thinking is it related to being buried in a macro and that’s why it needs to be in scope.
@dmitriidemenev5258
@dmitriidemenev5258 Жыл бұрын
It is actually a useful behavior because then it's easier to understand where methods come from. It's better for the reader.
@sus7801
@sus7801 Жыл бұрын
@@dmitriidemenev5258 I think it's kinda cringe, I'd hate to have to have a class which implements an interface, use that class in another file...then have to import that interface anyway, feels a bit leaky / breaking encapsulation
@dmitriidemenev5258
@dmitriidemenev5258 Жыл бұрын
@@sus7801 The point is that you can implement (local) traits for external crates. And traits can use the same method names.
@sus7801
@sus7801 Жыл бұрын
@@dmitriidemenev5258 you can still get name collisions though, although I do guess I sort of understand, blanket implementations would break a lot of code, not an ideal solution though
@greggoog7559
@greggoog7559 Жыл бұрын
Programmers are really weird. Does anyone need all that odd jargon?
Rust by Example read-through - part 1 (chapters 1-8)
3:36:25
timClicks
Рет қаралды 4,2 М.
Is Functional Programming DEAD Already?
21:07
Continuous Delivery
Рет қаралды 70 М.
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 113 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 34 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 18 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 28 МЛН
Why More People Dont Use Linux
18:51
ThePrimeTime
Рет қаралды 321 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 734 М.
iced GUI | Rust Language
17:00
Learning Rust
Рет қаралды 10 М.
Advent of Neovim: Why Neovim?
10:21
TJ DeVries
Рет қаралды 28 М.
The TRUTH About Golang Backend Frameworks
6:31
Melkey
Рет қаралды 130 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 80 М.
Python is 71x Slower, Uses 75x More Energy, Than C
23:29
Bryan Lunduke
Рет қаралды 34 М.
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 113 МЛН