Documenting the Bad Code I Wrote
/ 1 min read /
#编码规范
Table of Contents 目录
Background
Record all the bad code I’ve written to warn myself to write better code—otherwise every sneeze is cursing the 💩 mountain I left behind.
Magic Numbers
“Magic numbers” (also called magic values, magic strings, magic literals, etc.) refer to numeric constants or strings that appear directly in code without a clear meaning, and usually lack any explanation or comment describing their purpose.
Such numbers or strings make the code hard to understand and maintain, because readers can’t immediately grasp what those numbers mean or what they do.