{
  "id": "enwiki-001372508587",
  "slug": "redundant-code",
  "title": "Redundant code",
  "qid": "",
  "lead": "In computer programming, redundant code is source code or compiled code that is unnecessary. Code that can be removed without affecting its desired behavior is redundant.",
  "body": "In computer programming, redundant code is source code or compiled code that is unnecessary. Code that can be removed without affecting its desired behavior is redundant. ==Categories== Notable categories of redundant code include: Recomputing: Calculating again a value that has previously been calculated and is still available. Dead code: Code that is executed but has no external effect (i.e., does not change the output produced by a program). Unreachable code: Code that is never executed (also called dead code). NOP padding: A NOP instruction might be considered redundant if it is for padding. But if the NOP is required for proper functionality, then it is not redundant. Unused identifier: Something declared, but never referenced, is a redundant declaration. ==Examples== In the following C code, the second x * 2 expression is redundant code. Line 2 can be removed, or alternatively, line 3 can be changed to . int foo(int x) { int y = x * 2; return x * 2; } A more subtle example involves the C preprocessor that inserts code before compilation. Consider: define min(A,B) ((A) After preprocessing, the code expands to code that evaluates both and twice. To eliminate the duplicate code, the macro could be converted to a function. int shorter_magnitude(int a, int b, int c, int d) { return sqrt(((a*a + b*b) ==See also== ==References==",
  "categories": [
    "20323469",
    "20416984",
    "23118434",
    "23603337",
    "24927790"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1372508587",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1788219612.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001372508587",
    "type": "webpage",
    "title": "Redundant code",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/redundant-code",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001372508587",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1372508587",
    "note": "Immutable snapshot enwiki-001372508587"
  }
}