3 ms·
Although many of them boil down to preferences and philosophical points of view, I find these kinds of idioms useful. Whenever I write code in a new language, I
by jackmaney 13y ago
Although many of them boil down to preferences and philosophical points of view, I find these kinds of idioms useful. Whenever I write code in a new language, I want to "write as a native" so that I can maximize the effect that the language has on how I think about programming.
For Python in particular, Jeff Knupp's "Writing Idiomatic Python"[1] (not free, but not expensive, either) goes into detail on a lot of the concepts in the OP's slides. (I'm not affiliated with Jeff in any way, just a satisfied customer.)
[1] http://www.jeffknupp.com/writing-idiomatic-python-ebook http://www.jeffknupp.com/writing-idiomatic-python-ebook
- tbirdz 13y agoWhat level would you say the idioms in the book are at? I have already been programming in python for a little while, and I wouldn't want to pay for something which I already know. It would be nice if there were more sample idioms on that site so you could have a better idea of what the rest of the book was like.
- e12e 13y agoGiven that the author is willing to give away copies to those that can't afford the book, I'm sure he'll consider a preview/promise refund if you send him an email? (See bottom of page). Note: Also not affiliated in any way. [edit: given: http://www.goodreads.com/book/show/17354838-writing-idiomatic-python-2-7-3 http://www.goodreads.com/book/show/17354838-writing-idiomati... it doesn't look like it's of all that much value to an experienced python developer. I'd love to hear some other comments, though.]
- jackmaney 13y agoIt's of more use to a new Python developer than an old hand, but it does touch on some relatively unknown language features (eg for loops having an else clause). Honestly, though, it's only $10, so it's not a massive investment.