A bit of inspiration most weekdays for exploring your mindset .

Write code for humans not machines

Khem Raj February 14, 2025 #meta

Humans use programming languages to express logic and algorithmic constructs to the computing machines, there are high level languages which have revolutionized interacting with computers and solving complex problems. It's easy to associate programming languages as medium to communicate with computers. If we look it from another vantage point they actually communicate with humans too, we have to revisit the code for many reasons, fixing defects, adding new features, just learning a new codebase. If the program is written in a human-readable fashion it becomes easy to grasp and understand it. There are few things to consider when writing code.

Use self-explaining variable names and be consistent in naming conventions no i, j, etc. please.

Break-down code into smaller logical units, compilers are smart to optimize it

Don't write comments instead try to see if code is explaining what its doing. Comments go out of sync with logic as the code is changed over time.

Have a consistent writing style, it is easy for humans to recognize patterns and grasp it quicker.