TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Refactoring if statements for readability

2 pointsby mostlystaticover 9 years ago

1 comment

akoderover 9 years ago
Lets not limit it to if statements. Writing or refactoring existing code by using meaningful variable names can go a long way in increasing the readability of the code. I follow a simple rule to make my code easy to follow: 1.variable names should indicate what they will be containing<p>2.name the function with atleast one verb denoting what the function does.<p>3.file names indicate what code in it is trying to do.<p>Small changes like this can help more than comments some times to understand and read code.<p>Finally code is meant for humans to read. So be expressive!