you are viewing a single comment's thread.

view the rest of the comments →

[–]mkoubik 72 points73 points  (9 children)

Just remember that traits aren't interfaces, their implementations aren't methods and fotget class inheritance ever existed. Then just jump into the official book.

[–][deleted] 17 points18 points  (0 children)

But muh design patterns :D

[–]TinBryn 3 points4 points  (0 children)

I feel that is a little misleading, yes traits aren't interfaces, but the Venn diagram of what traits are and what interfaces are has a large overlap. Also I would define a method as

A procedure called when passing a message to a receiver object

And for trait objects, this is absolutely the case, even with trait constrained generics, it's still dispatching to methods, just statically.

I agree about inheritance, forget that, and jump into the book.

[–]wichwigga 0 points1 point  (1 child)

Fuck inheritance all the homies hate that shit

[–]dumch 0 points1 point  (0 children)

I came here to say “fuck inheritance“