|
|
|
|
|
by ibraheemdev
1870 days ago
|
|
Note that implementing Deref/DerefMut to mimic OOP is considered a bad practice. They were originally meant solely for smart pointer types, although some have opinions™ about that. Either way, you may need to reshape the way you think about program design coming from OOP languages - I know you've probably heard that before, but its true :) There are usually better options. Learning from FP pattern helps, as Rust leans more towards FP than OO in my opinion, although it has elements of both. Separating data and implementation (behavior) at the syntax level is one instance of that design decision showing through, no inheritance is another. |
|
These sentences direct copy paste from Author post, but I agree that Rust leans more towards to FP. The creator labeled Rust as Linear FP language.