News for hackers. Stuff that matters.
Re:Ask HN: What made you improve your logical reasoning? by abstractspoon on Wednesday November 05, 2025 @12:55AM (#45819696)
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.

There are no comments on this comment yet.