; (Semicolon) is ASCII code point 59 (0x3B), Unicode U+003B, and a printable punctuation character. It links two independent clauses that are too closely related to separate with a period but too distinct to join with a comma — a grammatical middle ground that many writers avoid simply because they're unsure when it's correct. In programming, the semicolon's role is blunter: it terminates statements. C, C++, Java, JavaScript, Rust, and C# all require it at the end of each statement, making it probably the most frequently typed punctuation character in a developer's career. CSS uses it to separate property declarations within a rule block. SQL ends every query with one. The character's most infamous behavior lives in JavaScript, where the language tries to be helpful through Automatic Semicolon Insertion — the parser silently adds semicolons where it thinks you forgot them. Writing return on one line and the value on the next causes ASI to insert a semicolon after return, and your function returns undefined instead of the object you carefully constructed below it. The code compiles, the tests might even pass for unrelated reasons, and the bug hides until production. The semicolon was invented by Italian printer Aldus Manutius around 1494, combining the comma's pause with the period's finality — a typographic innovation that has survived five centuries virtually unchanged. UTF-8 encodes it as a single byte 0x3B. Unicode classifies it as Po (Punctuation, Other) with the name SEMICOLON. The Greek question mark ; (U+037E) is a visually identical character that has become a legendary programmer prank — replacing ASCII semicolons with it produces code that looks correct but fails to compile, and the error message points at a line that appears perfectly fine.
const char *csv = "a;b;c";// Semicolon-delimited fieldsconst char *p = strchr(csv, ';');size_t first_len = (size_t)(p - csv);
Technically no — JavaScript has Automatic Semicolon Insertion (ASI). But ASI has edge cases that silently change behavior: a return followed by a newline returns undefined, not the next expression. Teams split on this: some use Prettier to add them everywhere, others rely on ASI with a linter to catch gotchas.
C-family languages (C, Java, C#) use ; to separate statements because they ignore whitespace. Python and Go use newlines instead, making ; optional/unnecessary. The trade-off: semicolons prevent ambiguity but add visual noise. Go solved it by having the compiler insert them automatically.
In Bash, ; separates commands on the same line (cd /tmp; ls). Unlike && (which stops on failure), ; always runs the next command regardless. This makes it useful for independent commands but dangerous for dependent ones — use && when the second command depends on the first succeeding.
In CSS, ; separates property declarations (color: red; font-size: 14px;). The last declaration in a block doesn't strictly need one, but always including it prevents bugs when adding new properties. CSS preprocessors (Sass, Less) follow the same convention.