DEV Community

Discussion on: Clean code... Why bother?

Collapse
 
yucer profile image
yucer

Better naming the identifiers is one of the harder tasks

It would be good to research more about how that affects the understanding of the code.

For example giving negated names for boolean variables like: no_update

When negating that it would be:

if not no_update then...

It would be better:

if update then..

Collapse
 
ehorodyski profile image
Eric Horodyski

For me, name booleans with question identifiers. Like "is updated" or "hasBeenUpdated". Then you get code like "if(hasBeenUpdated)" and it makes more sense linguistically. However, if you work with members who aren't super fluent in English it becomes tough, because English is totally a tricky language.

Collapse
 
paulasantamaria profile image
Paula Santamaría

I try to do this as well, makes it easier to read.

Collapse
 
sshanzel profile image
Hansel Solevilla

This is the case where you'd really scratch your head when encountered.