Better Programming

Advice for programmers.

Follow publication

Member-only story

A Brief History of the Semicolon in Programming

Mike McMillan
Better Programming
Published in
6 min readMar 24, 2020
Photo by ActionVance on Unsplash

In this article, I’m going to provide a brief history of the use of the semicolon (the bane of many an introductory computer science student) in computer programming languages. We’ll see semicolons have two uses: as statement separators and as statement terminators, and we’ll see how the use of semicolons has changed over the past 60 years or so of programming language history.

Before I start, though, let me attribute the quote that makes up the subtitle of this article. This quote is attributed to one of the true pioneers of computer science, Alan Perlis. I found this quote in one of the great computer science textbooks of all times, “The Structure and Interpretation of Computer Programs,” by Hal Abelson and Gerald Jay Sussman.

The quote is found in a footnote on page 11 of the book. In the footnote, the authors are discussing the lack of special syntactic forms found in many programming languages but not found in Lisp-like languages, such as Scheme (the target language of the book).

The term syntactic sugar was originally coined by Peter Landin to refer to convenient syntactic features that can be written in more uniform ways, such as the use of parentheses in Lisp rather than all the different syntactic features of a language, such as C and other C-like languages, which have curly braces, square brackets, semicolons, colons, and so on.

Why Programming Languages Use Semicolons

Semicolons are used in programming languages for two things: statement separators and statement terminators. When a language uses semicolons as statement separators, this allows you to write more than one statement on the same line, with the semicolon used to mark the separation of the statements so the compiler or interpreter can figure out where one statement ends and another statement begins.

In a language where the semicolon is a separator, semicolons are treated as optional and are usually not written when just a line of code consists of just one statement.

Semicolons as statement terminators aren’t optional and are used to definitively mark the end of a statement. Programming languages…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Mike McMillan
Mike McMillan

Written by Mike McMillan

Mike McMillan writes about computer programming and running. See more of his writing and courses at https://mmcmillan.gumroad.com.

Responses (2)

Write a response