← Notes

Bazel BUILD Style Guide

Official Bazel style guide recommending DAMP over DRY for BUILD files.

๐ŸŒณ Evergreen ๐Ÿ“š Source Jan 19, 2025 ยท 1 min read

Source Information

Key Content

DAMP over DRY for BUILD Files

Bazel’s style guide recommends preferring DAMP (Descriptive and Meaningful Phrases) over DRY (Don’t Repeat Yourself) for BUILD files.

Rationale: BUILD files aren’t code, they are configurations. They aren’t tested like code, but do need to be maintained by people and tools. That makes DAMP better for them than DRY.

The DRY principle encourages uniqueness by introducing abstractions such as variables and functions to avoid redundancy in code.

In contrast, the DAMP principle encourages readability over uniqueness to make files easier to understand and maintain.

Atomic Notes


Source: Bazel BUILD Style Guide