News for hackers. Stuff that matters.

Ask HN: Recommend Reading on Classes vs. Functions

I'm struggling to draw a clear line in my head on when to use classes vs pure functions. I get the positives of having your functionality grouped and together in the class-based approach, but in recent projects I've been really burned by painful inheritance/mixins problems. So now I'm questioning if I should have gone pure functions all the way.

Could someone recommend some good articles / books / tutorials that touch on this topic?

( 3 comments | 2 points | on HN )
Re:Ask HN: Recommend Reading on Classes vs. Functions by Jugurtha on Saturday October 02, 2021 @10:32AM (#28728854)
Re:Ask HN: Recommend Reading on Classes vs. Functions by ilmoi on Sunday October 03, 2021 @05:07AM (#28735660)
this is actually awesome, thanks so much for sharing
Re:Ask HN: Recommend Reading on Classes vs. Functions by Jugurtha on Sunday October 03, 2021 @05:29AM (#28735752)
You are welcome. There are a couple of books (editions) by Brett Slatkin titled "Effective Python: [59|90] Specific Ways to Write Better Python". 59 for the first edition, 90 for the second. There's also a video course.