DEV Community

Discussion on: When is code "too clever" / how do you think about readability/cognitive load?

Collapse
dienand profile image
DieNand

Some languages and frameworks have bizarre ways to do things (RoR is a good example of this) and it may take someone else with less experience in the framework a long time to understand.

Which brings me to my answer; Always ask the question beforehand - Will the person who maintains the code understand what I did here easily? If no, then refactor. If yes, then keep it as is.

Where I work people have often moved around between projects, and not all of them have the same amount of experience with the vast amounts of frameworks and languages that these projects are written in. So I always consider who will be reading the code before I write something. Kind of like writing a layman's article vs. writing an academic article.