<!--
title: Remove commented code
domain: cloud-infra
topic: Code Style
language: Yaml
source: chef/chef
updated: 2023-04-19
url: https://awesomereviewers.com/reviewers/chef-remove-commented-code/
-->

Avoid leaving commented-out code in the codebase. Version control systems already track the history of changes, making commented-out code unnecessary. Removing unused commented code improves readability, reduces confusion, and keeps the codebase clean.

Example of code to avoid:
```yaml
builder-to-testers-map:
  ubuntu-20.04-x86_64:
    - ubuntu-16.04-x86_64
    - ubuntu-18.04-x86_64
    - ubuntu-20.04-x86_64
  # windows-2012r2-i386:
  #   - windows-2012r2-i386
```

Instead, simply remove the commented lines completely. If the code needs to be referenced later, it can be found in the commit history.
