There's some truth to that. When I first started programming, I thought the more clever I was the better. I worked at minimizing the lines of code and using as many tricks as I could just to show how clever I was. Then I tried going back to some of that code and tried to understand it. It would sometimes take me longer to make sense of it than it had taken me originally to write it. Now I strive for clarity. I use explicit variable names and will sometimes add a line of code if I think it makes my intention more clear. Then I add sufficient comments so that I can immediately understand the intent when reviewing the code. I only use "tricks" when no other method will suffice and then I add extra comments, like breadcrumbs so I can find my way back through my original logic.

0

Comments

0

Share