2 ms·
When first learning Python, I was amazed at how my code would shrink. That is, I would write something in the first, most-obvious way that occurred to me. The
by redblacktree 14y ago
When first learning Python, I was amazed at how my code would shrink.
That is, I would write something in the first, most-obvious way that occurred to me. Then, recognizing patterns, I would refactor it down to something smaller. Usually this repeated a few times, until the 100ish lines of code I wrote turned into 10 or 20.
Python gives a programmer a lot of help in reducing redundant code. It makes C#/Java/etc. feel really tedious with all of the boilerplate code you end up writing.
tl;dr: DRY