Ask HN: What made you improve your logical reasoning?

3 pointsposted 14 hours ago
by Nurbek-F

Item id: 45816582

2 Comments

abstractspoon

6 hours ago

For me, logic is easier to understand when each operand is either on a separate line with a trailing comment, or where each operand is stored in a well named variable.

Any expression with more than 3 operands I rewrite in this way.

I will also reconstruct the expression so that it reads like a line of prose, and where the chain of reasoning reads from left to right, with the most significant operands coming first.

I also use brackets liberally and never rely on the rules of precedence because that reduces the cognitive load.

Sometimes I will also break up the overall expression into named sub-expressions, each with their own comments.