Awesome Reviewers

Reviewer · Code Style

Prefer explicit, simple control flow

Write code whose intent is obvious at a glance rather than relying on clever but opaque constructs. Avoid multi-line or nested ternaries — use a plain `if`/`else` instead. Avoid introducing boolean "state" flags to coordinate branches when the branches' logic can simply be duplicated in each path; a few extra lines are often clearer than tracking a flag...

Instruction

Write code whose intent is obvious at a glance rather than relying on clever but opaque constructs. Avoid multi-line or nested ternaries — use a plain if/else instead. Avoid introducing boolean “state” flags to coordinate branches when the branches’ logic can simply be duplicated in each path; a few extra lines are often clearer than tracking a flag across control flow. Avoid default parameter values that silently carry over a previous or ambient value (e.g. param = someOuterVariable), since the caller can’t tell whether the default or an explicit value is in effect — require the value to be passed explicitly if its meaning is ambiguous. Avoid adding single-purpose isX(...) helper checks scattered through the code; instead branch once (e.g. via an existing switch) and let the following code path make the decision, matching the structure the codebase already uses. Likewise, don’t introduce unnecessary indirection such as instance fields or factory functions when a plain, directly-parameterized function would do the same job just as well. For example, prefer:

// Instead of a flag-driven finally block:
if (keepWriting) {
  completeWriting(destination);
  flushBuffered(destination);
} else {
  completeWriting(destination);
}

// Instead of a multi-line ternary:
if (args.length > 0) {
  return function () { ... };
} else {
  return function () { ... };
}

These choices keep logic easy to trace, reduce hidden coupling between branches, and keep new code consistent with the control-flow patterns already established elsewhere in the codebase.