Joined 40w ago. Seen 38w ago.
A friend of mine just got into writing python. He's now asking if there are any resources for learning to write code more elegantly. Has anyone ever read anything that's helped you with the quality of your code?
Learning Haskell is what improved the quality of my code the most. It changed the way I thought about code and then I brought what I learned back to other languages.
I'd like to cosign general sentiment of @apos's reply; learning varied languages will improve how you write code generally. Though for python specifically I would recommend Effective Python (amazon.com/Effecti...). I read it years ago and found it very useful. Besides books, I think you'll find that reading the PEPs and code on GitHub are both very useful.
I highly recommend the Real Python website. It has tons of detailed articles.
I highly recommend the "99 bottles of ruby" book (2nd edition just came out and I've received a 50% off coupon) and exercism.io (same authors)
Related somewhat to the Haskell reply, I'd advise being very _conscious_ of mutable state. You're in a high-level language which aims to support functional style in many places, so err towards minimising mutable state, and introduce it only with full consciousness of its purpose and consequences.
Clean Code - Robert Cecil Martin
Check LosTechies.com and look for S.O.L.I.D principles