Fundamentals 7 min read

20 Counterproductive Coding Practices (Satirical Guide)

The article humorously lists twenty counterproductive coding “tips” – from using single‑letter variables and omitting comments to writing one‑line code, ignoring errors, creating unused variables, deep nesting, and skipping tests – claiming these practices boost productivity despite harming readability and reliability.

IT Services Circle
IT Services Circle
IT Services Circle
20 Counterproductive Coding Practices (Satirical Guide)

Recently I saw a comment full of profanity, which reminded me of an interesting open‑source project that became wildly popular for its twenty tongue‑in‑cheek "tips" on how to write code that won’t get scolded.

Variable names should be as simple as possible

For example, use a instead of age , saving two‑thirds of typing time. The article jokes that readability is irrelevant for a programmer.

// Recommended
let a = 42;
// Not recommended
let age = 42;

Never write comments

Comments are a waste of time; a mature programmer doesn’t need them, and if a colleague can’t understand the code, it’s their fault.

Never write comments; trust your teammates.

Write code on a single line

Putting code on one line reduces unnecessary storage space, which can improve network transmission speed and user experience in high‑speed mobile internet scenarios.

// Recommended
document.location.search.replace(/(^\?)/, '').split('&').reduce(function(o,n){n=n.split('=');o[n[0]]=n[1];return o;},{});

// Not recommended
document.location.search
  .replace(/(^\?)/, '')
  .split('&')
  .reduce((searchParams, keyValuePair) => {
    keyValuePair = keyValuePair.split('=');
    searchParams[keyValuePair[0]] = keyValuePair[1];
    return searchParams;
  }, {});

Don’t handle errors

Showing error dialogs or logging errors is portrayed as a terrible user experience; the article suggests ignoring all exceptions to keep users from complaining.

// Recommended
try {
  ...
} catch (error) {
  // do nothing
}

// Not recommended
try {
  ...
} catch (error) {
  // show error message
  showErrorMessage(error.message);
  // log the error
  logError(error);
}

Create variables you never use

Adding unnecessary variables is claimed to test the limits of the execution environment; if the server can handle it, the article jokes that the team is safe.

// Recommended
function sum(a, b, c) {
  const timeout = 1300;
  const result = a + b;
  return a + b;
}

// Not recommended
function sum(a, b) {
  return a + b;
}

Use deep nesting

Writing heavily nested if/for structures is presented as a way to showcase technical prowess; only a solid programmer can survive such complexity.

// Recommended
function someFunction() {
  if (condition1) {
    if (condition2) {
      asyncFunction(params, (result) => {
        if (result) {
          for (;;) {
            if (condition3) {
              // ...
            }
          }
        }
      })
    }
  }
}

// Not recommended
async function someFunction() {
  if (!condition1 || !condition2) {
    return;
  }
  const result = await asyncFunction(params);
  if (!result) {
    return;
  }
  for (;;) {
    if (condition3) {
      // ...
    }
  }
}

Never test your code

The final tip advises developers to skip testing entirely, arguing that testing engineers should handle quality assurance and that avoiding tests doubles development speed.

Strictly follow the "code only, no testing" principle to increase productivity.

JavaScriptProgrammingsoftware developmentcode qualitydeveloper habitscodinganti-patterns
IT Services Circle
Written by

IT Services Circle

Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.