Semicolons
If possible, avoid using semicolons. In a few cases, a semicolon is preferred:
When joining two closely related independent clauses where a period or a comma is not as
effective.
Recommended: You can easily test
compatibility by computing the centroid; if it is on the opposite side of the
planet, reverse the order of your vertices.
When preceding a conjunctive adverb (like therefore) or a phrase
(like that is) that joins two independent clauses.
Recommended: This setup places the
head-tracked node below the Main Camera; therefore, only the stereo cameras are
affected by the user's head motion.
Recommended: The URL from which a video
ad loads; that is, the URL to use to fetch that video ad.
When separating a series of long or complex items that contain their own punctuation.
Recommended: If you don't have time,
then focus on the improvements that will have the greatest benefit: what matters most
to your users; what is most important to fix; and what is easy or feasible to
fix in the available time.
Recommended: Review your document one
more time, checking for the following: present tense and active voice; typos,
punctuation, and grammar; and whether you can shorten anything.
Notice that in the final example, the second item in the list is itself a list.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-15 UTC.
[null,null,["Last updated 2024-10-15 UTC."],[[["Semicolons should primarily be used to connect two closely related independent clauses, serving as an alternative to a period or comma when they are less effective."],["They are also recommended before conjunctive adverbs or phrases that link two independent clauses, ensuring clarity and proper sentence structure."],["In cases where a series of long or complex items containing internal punctuation is present, semicolons act as separators for better readability and organization."]]],["Semicolons are useful for joining closely related independent clauses, especially when a period or comma is insufficient. They are also used before conjunctive adverbs or phrases connecting independent clauses. Semicolons separate long or complex items in a series containing internal punctuation. Examples show checking centroid location to determine vertex order, managing camera effects with a tracked node, identifying video ad URLs, or prioritizing user benefits and ease of implementation during a review.\n"]]