2
Someone told me my code was 'too clever' and it stung but they were right
I was trying to impress my study group by using list comprehensions and lambda functions everywhere until one guy said it looked like I was showing off instead of just solving the problem. I rewrote that Python script with simple for loops and if statements, and it actually made more sense to me a week later when I looked back at it. Has anyone else had to dial back their code to make it readable?
3 comments
Log in to join the discussion
Log In3 Comments
kellys783d ago
Yeah totally been there. I started writing all my functions as one-liners with ternary operators and nested comprehensions (which I thought was so slick at the time) but then I couldn't debug a single thing. I had to force myself to use separate variables and basic loops instead, and suddenly I could actually follow my own logic when I opened the file a month later.
5
seanjackson3d ago
I read somewhere that clever code is the enemy of maintainable code.
10
janarivera3d ago
A whole MONTH without touching your own code?
5