, (Comma) is ASCII code point 44 (0x2C), Unicode U+002C, and a printable punctuation character. It separates items in a list or introduces a brief pause in prose — the smallest speed bump in written language, guiding the reader's eye without bringing it to a full stop. Code uses commas constantly but rarely glamorously: they separate function arguments, array elements, variable declarations, and object properties. The comma operator in C and JavaScript is its strangest incarnation — (a = 1, b = 2, a + b) evaluates every expression left to right but returns only the last, a trick mostly seen in terse for loop headers and rarely anywhere else on purpose. Python gives trailing commas surprising importance: (42,) is a tuple, but (42) is just an integer in parentheses. CSV, the format named after this character, demonstrates its fragility at scale — a comma embedded inside a field value silently shifts every subsequent column rightward unless the field is properly quoted, and an entire pipeline can ingest months of subtly misaligned data before anyone notices the revenue column is full of zip codes. The comma descends from the virgula suspensiva, a diagonal slash medieval scribes placed at mid-height to mark short pauses. By the sixteenth century, Italian printers had lowered and curved it into the baseline mark we use today. UTF-8 encodes it as a single byte 0x2C. Unicode classifies it as Po (Punctuation, Other) with the name COMMA. The Arabic comma ، (U+060C) and the fullwidth , (U+FF0C) are the usual impostors — visually close enough to slip past code review but guaranteed to break any parser expecting the ASCII original.
char line[] = "a,b,c";// Split a simple comma-delimited stringchar *p = strtok(line, ",");// p iterates over tokens: a then b then c
Trailing commas (e.g., [1, 2, 3,]) reduce git diff noise — adding an item only changes one line instead of two. JavaScript, Python, and Rust allow them. JSON and older Java versions don't. ESLint and Prettier can enforce consistent trailing comma style.
The comma operator evaluates both operands and returns the last one: (a = 1, b = 2) returns 2. It's rarely used intentionally and often appears by accident — a misplaced comma can silently discard values. Most linters flag it as a code smell.
CSV uses commas as field delimiters, so a comma in the data (like 'New York, NY') breaks parsing. The fix is quoting: fields containing commas are wrapped in double quotes. This creates more edge cases (what if the data contains quotes?), which is why JSON and TSV are often better alternatives.
print(a, b) passes two separate arguments — most languages print them with a separator (space in Python). print(a + b) concatenates or adds first, then prints one value. In Python, print(1, 2) outputs '1 2' while print(1 + 2) outputs '3'. Subtle but important.