A Brief History of the Semicolon in Programming (2024)

A Brief History of the Semicolon in Programming (3)

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.

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…

A Brief History of the Semicolon in Programming (2024)

FAQs

What is the history of the semicolon? ›

"The semicolon itself was a Renaissance invention. It first appeared in 1494, in a book published in Venice by Aldus Manutius. 'De Aetna,' Watson explains, was 'an essay, written in dialogue form,' about climbing Mt. Etna.

When was the semicolon first used in programming? ›

Statements in Fortran could only be written one per line, and the new line was the statement terminator. The first use of the semicolon in a modern programming language was with ALGOL 58. However, this version wasn't heavily implemented, and it quickly morphed into ALGOL 60.

Why is semicolon used in programming? ›

The Semicolon lets the compiler know that it's reached the end of a command. Semicolon is often used to delimit one bit of C++ source code, indicating it's intentionally separated from the respective code.

What is the semicolon (;) used for? ›

Use a semicolon to join two related independent clauses in place of a comma and a coordinating conjunction (and, but, or, nor, for, so, yet). Make sure when you use the semicolon that the connection between the two independent clauses is clear without the coordinating conjunction.

How was the semicolon invented? ›

The modern semicolon was invented in Venice, in 1494, by the printer and publisher Aldus Manutius, and, for much of history, it had no strictly defined function. It acted like a musical notation, allowing for a pause somewhere between the beat of a comma and a colon (hence its mongrel design).

Who started the semicolon project? ›

Project Semicolon was founded by Amy Bleuel in 2013, as a tribute to her father, who died by suicide in 2003.

When was the first use of programming? ›

1883: The first programming language was developed in 1883 when Ada Lovelace and Charles Babbage worked together on the Analytical Engine, which was a primitive mechanical computer. Lovelace was able to discern the importance of numbers, realizing that they could represent more than just numerical values of things.

What is the difference between a semicolon and a colon in programming? ›

A semicolon is used to separate two ideas (two independent clauses) that are closely related. They can also be used when listing complex ideas or phrases that use commas within them. Essentially, a semicolon is like a comma with more meaning or a colon with more flexibility.

Why doesn't Python use semicolons? ›

Unnecessary semicolons can clutter your code, making it harder to read. Python's philosophy encourages writing code that is self-explanatory and clear. Therefore, omitting semicolons unless absolutely necessary contributes to this goal.

Which programming language has no semicolons? ›

Haskell avoids semicolons only when using exclusively indentation-based layout, which is a common style. Python and BCPL are similar cases. Non-textual languages like Scratch or Piet naturally do not make use of semicolons.

Does Python accept semicolons? ›

Python does not usually use explicit line-ending characters; the parser can almost always figure out where a statement ends from the positioning of newlines. However, Python's syntax allows you to use a semicolon to end a statement instead, which allows you to place multiple statements on a single line.

What languages require semicolons? ›

However, despite the fact that in languages like C, C++, Java or C# all statements require semicolons at the end, blocks do not.

What is the most important semicolon rule? ›

Rule. Use a semicolon between closely related independent clauses which are not joined by a coordinating conjunction. This rule means that semicolons are used between two complete sentences which are not already linked by words like and, but, or, nor, for, so, yet.

What are the two dots called? ›

What is a colon? A colon is a punctuation mark consisting of two dots, one placed above the other. It looks like this : Colons are often used to introduce a list, but that's not all they can do!

What is an example of a semicolon? ›

Use the semicolon to separate the independent clauses, then slip in a transitional phrase and comma after the semicolon.
  • My dad's birthday is today; however, I haven't bought a present yet.
  • The project is due tomorrow; therefore, she has to work overtime.
Jul 18, 2023

How did the semicolon tattoo start? ›

Amy Bleuel started Project Semicolon in 2013 to raise awareness of suicide and mental health in honour of her father, who died by suicide. At the time, awareness was sorely needed. Suicide was, and remains, one of the biggest killers of young people, and you can't fix a problem you can't see.

What are some interesting facts about the semicolon? ›

1) The semicolon is a 500-year-old, loose lady of literature, born in Italy. The semicolon was first conceived of and used in 1494 by an Italian printer named Aldus Manutius. Manutius was born in a city not far from Rome, but then migrated to Venice and opened his print shop.

What is a fact about semicolon? ›

Semicolons (;) separate two complete statements that are closely related. As a general rule, if a period would not work, neither will a semicolon. Semicolons also separate items in a series or equal parts of a sentence. Note that semicolons cannot replace most commas, nor can they introduce lists or items.

What is the history of the colon punctuation? ›

The first usage of the colon dates back to the 1600s to denote a pause time greater than a comma but less than a full stop. The semicolon has a much earlier history with its first written use in 1494.

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 6170

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.