DEV Community

Discussion on: Readable Code

Collapse
 
ghost profile image
Ghost

To me "Short and simple or long and complex" is like asking how long should a program be, depends, the main purpose of a name is clearly indicate what it is/does, second is how long; the name should be as short as possible without losing it's main goal. Restrict oneself with artificial rules seems useless to me, the amount of chars or words are not the purpose of a name.

I usually make a stupid long name and then ask myself, and start iterating, can I shorten it while keeping understandable? when the answer is no, that's what I keep. If the end result is inconvenient (too long and used too often) maybe there is a deeper problem in my code.