5 exercises — punctuation that matters for IT professionals: commit messages, colons and semicolons in docs, the em dash vs. hyphen, and inline code formatting.
Quick punctuation reference for IT writing
Colon (:) — introduces a list or explanation; what comes before must be a complete clause
Semicolon (;) — joins two independent clauses; also separates items in a list that contain commas
Em dash (—) — strong pause or parenthetical aside; no spaces in most style guides
En dash (–) — ranges: "v1–v3", "5–10 ms", "Monday–Friday"
Hyphen (-) — compound words and modifiers: "read-only", "client-server", "two-factor"
A developer writes a commit message: "Fix login bug update session token and log the error" Which version uses correct punctuation and structure for a commit message?
Option D follows the Conventional Commits format: type(scope): short description. Breaking it down: fix = commit type (fix, feat, docs, refactor, test, chore); (auth) = optional scope; the message is specific and uses the em dash (—) to separate the primary fix from the secondary action. Rules for commit messages: (1) Use imperative mood ("add", "fix", "remove" — not "added", "fixing"); (2) Keep under 72 characters in the subject line; (3) No trailing period; (4) Be specific about what changed and why. The Oxford comma ("token, and log" in C) is correct English but a commit message should be even more concise. Option D wins because it's typed, scoped, and specific.
2 / 15
In a technical documentation sentence, which punctuation mark correctly separates two related independent clauses?
When however is used as a conjunctive adverb (connecting two independent clauses), the correct punctuation is: semicolon before, comma after — "; however,". The semicolon joins the two independent clauses; the comma after "however" separates it from the rest of the clause. Option A (comma before "however") creates a comma splice — a common error. Option C uses a colon incorrectly (colons introduce lists or explanations, not contrasts). Option D (em dash) is acceptable in informal writing but less standard in technical documentation. Other conjunctive adverbs that follow the same pattern: therefore, consequently, nevertheless, meanwhile, furthermore, moreover. Example: "The tests passed; however, we still need manual verification."
3 / 15
Choose the correct punctuation for this documentation sentence: "The API accepts three parameters___name (string), age (integer), and active (boolean)."
A colon is used to introduce a list, explanation, or elaboration that follows a complete clause. "The API accepts three parameters" is a complete clause, and the list that follows directly explains what those parameters are — a perfect use case for a colon. Rule: what comes before the colon must be a complete sentence on its own. ✅ "The following fields are required: name, email, password." ❌ "The required fields are: name, email, password." (the clause before the colon is incomplete). In technical documentation, colons are common before: lists of parameters, enumerations, definitions, examples, and code blocks. Em dash (option C) could work for emphasis, but a colon is the standard choice here. The Oxford comma before "and active" is correct and mandatory in formal technical writing.
4 / 15
Which sentence correctly uses an em dash (—) in technical writing?
Option B correctly uses paired em dashes to set off a parenthetical phrase ("auth, payments, and notifications") in the middle of a sentence — similar to parentheses but more emphatic. Em dash rules in tech writing: (1) Paired em dashes for interruptions or asides — used without spaces in most style guides; (2) Single trailing em dash to introduce an explanation or afterthought: "The endpoint was deprecated — it had been replaced in v2." Common confusions: hyphen (-) joins compound words or splits multi-part terms ("client-server", "read-only", "45-second build"); en dash (–) shows ranges ("v1–v3", "Monday–Friday", "5–10 requests"); em dash (—) is a strong pause or parenthetical. Option A incorrectly hyphens a time value (no hyphen needed: "took 45 seconds"). Option C incorrectly follows a semicolon with an em dash.
5 / 15
In a code comment or documentation, how should you refer to a UI element, filename, or terminal command inline within prose?
In technical documentation, backtick code formatting (inline code) is the standard for: terminal commands (npm install, git commit), file names and paths (config.yml, src/index.ts), environment variables (NODE_ENV), function or method names (handleClick()), and code values (null, true, 404). This formatting makes it unambiguous that the text is a literal value or command — the reader should type it exactly. Convention by context: UI elements (button labels, menu items) often use bold or quotation marks in UX writing — "Click Save" or 'Click "Save"'. But for anything typed in a terminal or used in code, backtick formatting is universal. In Markdown documentation (README, GitHub, Notion): surround with backticks `like this`. In Word/Google Docs: use a monospace font. In JIRA/Confluence: use inline code blocks.
6 / 15
Sarah from the DevOps team Slack channel posted: 'We're experiencing high latency on the database server. Investigate!'. Which of the following options best demonstrates correct punctuation and formatting for this message? Consider clarity and professional communication.
The correct option uses a single exclamation mark to emphasize Sarah's urgency. Using multiple exclamation marks is generally considered informal and can appear overly dramatic in professional communication. The other options either omit punctuation or use incorrect formatting for a Slack message. It's important to balance enthusiasm with professionalism.
7 / 15
Mark is writing documentation for a new API endpoint: 'The endpoint returns data in JSON format including user ID and timestamp. The timestamp is always in UTC.' Which punctuation mark would be most appropriate to use to separate these two related independent clauses within the sentence? Consider clarity of information.
A period (.) correctly separates two complete sentences or independent clauses. Using a semicolon (;) would create an overly complex and potentially confusing sentence structure in this context. A comma is too weak to adequately separate the two distinct pieces of information and a question mark doesn't fit the factual description. Clarity is key when documenting technical details.
8 / 15
David needs to update the PR description for his code changes: 'Implement user authentication using OAuth 2.0. Ensure proper error handling and logging.' Which punctuation mark is most suitable to correctly separate these two distinct instructions within the description? Consider conciseness.
A semicolon (;) is the best choice here because it clearly separates two independent clauses while maintaining a relatively concise PR description. An em dash (—) is generally used for parenthetical information and doesn't fit this scenario. A comma would be too weak, and a colon suggests an explanation of the preceding statement which isn't present.
9 / 15
Emily is writing a technical blog post about containerization. Which sentence best demonstrates the correct use of an em dash (—) to set off a parenthetical phrase that adds extra information? Focus on clarity and style.
An em dash (—) is ideal for setting off a parenthetical phrase that adds extra information. Using it correctly creates a smoother flow than commas or parentheses. The other options are grammatically incorrect or stylistically awkward. It's important to use em dashes sparingly and only when needed for emphasis.
10 / 15
Ben is documenting a command-line tool: 'Use the migrate command to update the database schema. The syntax is migrate --version 2.0'. Which of the following options correctly illustrates how to include inline information within prose while maintaining proper punctuation and formatting? Consider readability.
Enclosing the command name in backticks (`migrate`) and using single quotes around the entire command string ensures that it's correctly interpreted as a code element within the text. This is standard practice when documenting commands or scripts. The other options either omit necessary formatting or incorrectly use punctuation.
11 / 15
Sarah from the DevOps team Slack channel posted: 'We're experiencing high latency on the database server. Investigate!'. Which of the following options best demonstrates correct punctuation and formatting for this message? Consider clarity and professional communication.
The correct option uses a single exclamation mark to emphasize Sarah's urgency. Using multiple exclamation marks is generally considered informal and can appear overly dramatic in professional communication. The other options either omit punctuation or use incorrect formatting for a Slack message. It's important to balance enthusiasm with professionalism.
12 / 15
Mark is writing documentation for a new API endpoint: 'The endpoint returns data in JSON format including user ID and timestamp. The timestamp is always in UTC.' Which punctuation mark would be most appropriate to use to separate these two related independent clauses within the sentence? Consider clarity of information.
A period (.) correctly separates two complete sentences or independent clauses. Using a semicolon (;) would create an overly complex and potentially confusing sentence structure in this context. A comma is too weak to adequately separate the two distinct pieces of information and a question mark doesn't fit the factual description. Clarity is key when documenting technical details.
13 / 15
David needs to update the PR description for his code changes: 'Implement user authentication using OAuth 2.0. Ensure proper error handling and logging.' Which punctuation mark is most suitable to correctly separate these two distinct instructions within the description? Consider conciseness.
A semicolon (;) is the best choice here because it clearly separates two independent clauses while maintaining a relatively concise PR description. An em dash (—) is generally used for parenthetical information and doesn't fit this scenario. A comma would be too weak, and a colon suggests an explanation of the preceding statement which isn't present.
14 / 15
Emily is writing a technical blog post about containerization. Which sentence best demonstrates the correct use of an em dash (—) to set off a parenthetical phrase that adds extra information? Focus on clarity and style.
An em dash (—) is ideal for setting off a parenthetical phrase that adds extra information. Using it correctly creates a smoother flow than commas or parentheses. The other options are grammatically incorrect or stylistically awkward. It's important to use em dashes sparingly and only when needed for emphasis.
15 / 15
Ben is documenting a command-line tool: 'Use the migrate command to update the database schema. The syntax is migrate --version 2.0'. Which of the following options correctly illustrates how to include inline information within prose while maintaining proper punctuation and formatting? Consider readability.
Enclosing the command name in backticks (`migrate`) and using single quotes around the entire command string ensures that it's correctly interpreted as a code element within the text. This is standard practice when documenting commands or scripts. The other options either omit necessary formatting or incorrectly use punctuation.
What will I practise in "Punctuation in Technical Writing — IT English Grammar Exercise"?
Practice punctuation in technical writing: commit messages, semicolons, colons, em dashes, and inline code formatting. 5 exercises with IT-specific examples.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the grammar rule and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more Grammar exercises?
Browse the full Grammar hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain grammar rules in prose; this exercise tests and reinforces those rules through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.