3 ms·
I've been programming python for nearly 10 years, but your comment just helped me clarify a thought that I've had for ages but have never been able to put in to
by simonw 15y ago
I've been programming python for nearly 10 years, but your comment just helped me clarify a thought that I've had for ages but have never been able to put in to words before: a well designed Python API is one that can be effortless used within the REPL. And that's why urllb2 sucks.
- gruseom 15y agoThis is the thing that got me off OO altogether. Typical OO code is hard to call from the REPL. You have to know what objects to construct before constructing an object that has the method you want to call, which probably requires more objects to be constructed and passed as args, etc. Yet more often than not the function in question is simple enough that it ought to be easy to call without all that baggage. That got me so annoyed that I finally just started making all my functions easy to call from the top level and never looked back. You're right that this leads to better designs.
- teyc 15y agoWriting good python has been more of a challenge for me lately. The more C#/Java I write, the harder it is for me forget dependency injection, factories, etc and just feel the freedom Python provides.