DEV Community

Discussion on: What programming concept did you struggle the most with?

Collapse
 
rad_val_ profile image
Valentin Radu • Edited

Monads are much easier to learn by example. If I tell someone: "Look, this is an Optional, this is how it works, the Optional is a monad. Now imagine you can apply this pattern to a whole lot of things, not just wrapping nullable values", they get it pretty fast and it's usually enough to get them rolling code using monads.

As for inheritance/polymorphism, I used to be somewhat confused about it too and I blame it on the myriad of articles and books that don't clearly differentiate between the two just because the easiest way to show polymorphic behaviour is through inheritance (which is by the way, something you usually want to avoid)