DEV Community

Discussion on: A function’s intent should be revealed by its name

Collapse
 
aeddi13 profile image
Patrick Decker

Good article. The correct naming of variables and methods is one of the most important and fundamental parts of programming that many developers still get wrong.

In some cases however, it is not possible to name the method correct for every place where it is used. In these cases adding a variable with the correct name before the if statement will increase the readability a lot.

bool openContactsScreenWhenCustomerIsCompany = handleClickItem(customer);

if (openContactsScreenWhenCustomerIsCompany) {
return;
}

Collapse
 
le0nidas profile image
le0nidas

That's true. Thank you for pointing it out :)