JavaScript Object Creation Patterns

These samples demonstrate four different patterns for creating objects in JavaScript.

These samples demonstrate four different ways of creating objects in JavaScript:
1. Object factory
2. Objects linking to other objects (OLOO)
3. Pseudo-classical object pattern
4. ES6 classes

Object Factory Pattern

OLOO Pattern

This example also shows the use of WeakMap in an IIFE to hold private instance data.

Pseudo-Classical Pattern

ES6 Class

Private constants are not directly supported by ES6 class syntax. The way to create a private constant is to create a private getter method and return the constant value, as shown here in #PWDERRMSG.

React/JavaScript: Tic-Tac-Toe Game (Play game)

This is a tic-tac-toe game, written in JavaScript and React.

This is a tic-tac-toe game, written in JavaScript and React. It uses create-react-app to create a React application. The listing below is App.js.

App.js

Ruby: Blackjack Game

This is a terminal-based version of Blackjack, written in Ruby.

This is a terminal-based version of Blackjack, written in Ruby.

Python: Blackjack Game

This is a terminal-based version of Blackjack, written in Python.

This is a port of the Ruby blackjack game to Python.

Web Technologies: HTML5, CSS, jQuery, PHP, MySQL

This code sample from the PPLS Tracking System application displays a modal dialog box. It handles the adding of parts to or removing of parts from a particular distributor in a vendor table. The context is editing a specific vendor record. The user may add or remove parts carried by the vendor. If adding, the user gets a list of all parts not currently carried by the vendor, checks the ones to add and saves. If removing, the user gets a list of all parts currently carried by the vendor, checks the ones to remove and saves.

The code also supports toggling of detail data for each record. The user clicks a button to the left of the row, and the detail is presented in a dropdown format underneath the row. Clicking again removes the detail.

This code sample from the PPLS Tracking System application displays a modal dialog box. It handles the adding of parts to or removing of parts from a particular distributor in a vendor table. The context is editing a specific vendor record. The user may add or remove parts carried by the vendor. If adding, the user gets a list of all parts not currently carried by the vendor, checks the ones to add and saves. If removing, the user gets a list of all parts currently carried by the vendor, checks the ones to remove and saves.

The code also supports toggling of detail data for each record. The user clicks a button to the left of the row, and the detail is presented in a dropdown format underneath the row. Clicking again removes the detail.

This is one of several modal dialogs of this type. Some of the code given here is reused for other editing contexts involving the adding or removing of child records.

The sample contains all the modules required for this particular dialog box, using a range of popular web technologies: JavaScript, jQuery, jQuery-UI, CSS, AJAX, JSON, PHP and MySQL. It also uses the jQuery DataTables plugin.

vdrmodal.php, the modal dialog page

dialog() function code, from viewvendor.php

cdchildren.php: adds and removes child records

AddChild, RemChild, GetChildren and rsToJSON, from phpHelpers.php

cdbconnector.php: defines the CDbConnector class, used to connect to the MySQL database

getPartDists: MySQL proc to get parts for one distributor

C#: Multithreading, Reflection and Dynamic Binding, Using a RESTful Service

This sample code demonstrates use of various features and techniques in C#. The code implements these technical requirements:

  1. Access data exposed as a web service, and export it to a local file.

  2. Both XML and JSON formats need to be supported by requirement 1.

  3. The export functionality must be a singleton instance, and must support multithreading.

  4. The thread, data access, and export functionality should be addressed as separate concerns.

  5. Provide a custom event that is raised when the export is finished, with two arguments: one to keep track of whether the export succeeded and one to provide a target file name for the exported data.

  6. Define all of the export class’s functionality in abstract terms, and have the class implement the abstractions.

This sample code demonstrates use of various features and techniques in C#. The code implements these technical requirements:

  1. Access data exposed as a web service, and export it to a local file.

  2. Both XML and JSON formats need to be supported by requirement 1.

  3. The export functionality must be a singleton instance, and must support multithreading.

  4. The thread, data access, and export functionality should be loosely coupled.

  5. Provide a custom event that is raised when the export is finished, with two arguments: one to keep track of whether the export succeeded and one to provide a target file name for the exported data.

  6. Define all of the export class’s functionality in abstract terms, and have the class implement the abstractions.

To accomplish this, we have three separate classes, one to retrieve data, one to export it, and a multithreaded client:

  1. The NorthwindDataRetrieve class uses Microsoft’s (abbreviated) Northwind database, which they expose as an OData service on Azure. The method has an overloaded GetData method that returns various generic List objects containing data.

  2. The DataExport class exposes a thread-safe singleton instance of itself, with a generic Export method that can accept any of the List objects returned by the NorthwindDataRetrieve.GetData method. This method also accepts an argument for whether the exported data are to be in XML or in JSON format. It also raises a custom event when finished.

    This event can’t quite be defined in fully abstract terms (i. e. in terms of interfaces), per requirement 6. Custom arguments for an event have to inherit the existing EventArgs class, and EventArgs doesn’t expose a public interface (e.g. “iEventArgs”). Therefore, it isn’t possible to define a class deriving from it as an interface (interfaces can’t inherit concrete classes; they have to inherit interfaces). The closest we can come to a fully abstract definition is to define an abstract class that inherits EventArgs and defines the custom event arguments as abstract, while defining everything else in terms of interfaces and delegates.

    (Microsoft’s position on why they don’t allow custom implementations of the EventArgs class itself seems reasonable: first, the process of passing arguments to event procedures is a specialization of the process of passing arguments to procedures in general, and procedure logic is already tightly coupled with the logic of passing arguments to them. Therefore, developers using the CLR are unlikely to derive significant advantage from being allowed to create custom implementations of the EventArgs class. Second, if Microsoft decide to change the implementation of EventArgs, they would run the risk of breaking custom implementations of the class if custom implementations were allowed. They don’t feel that the limited additional functionality justifies this risk.)

  3. The Program class is the client. The Main method instantiates some threads that call the DoWork method, passing arguments in a class called ThreadParams. This class has a target file name, a file type (JSON or XML), and an instance of a List object that will hold the retrieved data. DoWork calls GetData, passes the resulting List to the Export method, and calls the event handler once Export raises the ExportFinished event.

Program.cs

NorthWindDataRetrieve.cs

DataExport.cs

VB.Net: Multithreading, Using a RESTful Service

This code sample is the functional equivalent, written in VB, of the code in the preceding C# sample. The comments here are limited to those which do not apply to both samples. For full comments, please refer to the C# sample.

This code sample is the functional equivalent, written in VB, of the code in the C# sample. The comments here are limited to those which do not apply to both samples. For full comments, please refer to the C# sample.

Program.vb
NorthwindDataRetrieve.vb
DataExport.vb

T-SQL: Various Examples

T-SQL examples, including transactions, dynamic SQL and various utilities.

T-SQL examples, including transactions, dynamic SQL and various utilities.

List all the tables and columns in the current database.

Run a group of (parameterless) stored procedures one after the other (in this case, a series of daily merge procs).

Pull data from a list of by-the-minute inspection results, roll them up on a per-hour basis, and pivot the results based on inspection type.

Use a transaction and dynamic SQL to perform an atomic read/write operation

List all reports in SSRS database by path, name and schema

VB6: Using CBT Hooking to Change the Layout of the Native MsgBox Function

The Computer-Based Training, or CBT, API calls give the ability to automate screen functions in response to user actions, and in so doing create the ability for automated training modules to interact with students. Leveraging these functions allows a low-level event-based model, whereby a developer can use a hook to customize handling of screen-related activities.

This code allows font changes and various other format customizations of the standard VB6 MsgBox dialog box.

The Computer-Based Training, or CBT, API calls give the ability to automate screen functions in response to user actions, and in so doing create the ability for automated training modules to interact with students. Leveraging these functions allows a low-level event-based model, whereby a developer can use a hook to customize handling of screen-related activities.

This code allows font changes and various other format customizations of the standard VB6 MsgBox dialog box. It uses a CBT hook to intercept an internal window call, in this case, the window call generated by the MsgBox function. Upon intercepting the call it gets a handle to the MsgBox window as well as its various child windows (the label containing the message text, any buttons, and an icon if it exists). It then resizes the window to accommodate altered sizing, and repositions the icon and any command buttons. Finally, it positions the resized MsgBox window in the center of the screen.

VB6: Accessing the RichTextBox Control’s Underlying iRichTextOLE Interface

This code shows a way to work around the limitations of the VB6 RichTextBox control, accessing its underlying iRichTextOLE interface to implement support for later versions of the Text Object Model (TOM) than the one directly supported by the control.

This code shows a way to work around the limitations of the VB6 RichText control, accessing its underlying iRichTextOLE interface to implement support for later versions of the Text Object Model (TOM) than the one directly supported by the control.

The reason that the RichTextBox control doesn’t support much of the Rich Text specification is that it only directly supports RTF version 1.0, in part due to backward compatibility concerns. However, with a little sleight of hand, it is possible to get the RichTextBox control to use the latest RTF version (currently 4.1), thereby greatly expanding the usable feature set. You can do this by accessing the TOM interface directly.

First, along with the RichTextBox reference, we’ll need to add a reference to TOM (if not listed as an available reference — it usually isn’t — browse to riched20.dll and select it). Of course, we’ll also need a Form with a RichTextBox control on it (in this example, named rtcMyControl).

All this is necessary because the line Dim tomDoc as iRichEditOle fails to compile, even though iRichEditOle is a COM interface. The reason that it fails to compile is that iRichEditOLe doesn’t implement a dual interface, that is, it implements iUnknown as all COM classes do, but does not implement iDispatch.

VB’s direct support of COM is limited to those COM classes that implement both interfaces. VB directly supports only those interfaces that allow late binding, and late binding requires implementation of iDispatch. Nevertheless, as this example shows, VB can access any COM object through the use of API techniques similar to this one.

Blackjack Diagrams

This is a collection of diagrams that model different aspects of the Ruby Blackjack game.

This collection of diagrams models different aspects of the Blackjack game. There is a class diagram and three flowcharts: an overall flow model, a calculate hand subprocess and a calculate 21 subprocess.

Class Diagram

Main Flowchart

Subroutine: Calculate Hand Total

Subroutine: Check for Natural 21

Mixing BSCS: Preprocessing Logic

The Mixing Business Support Control System controls a rubber mixing machine that is part of an overall process of manufacturing tires. This diagram shows the preprocessing logic, which verifies that an authorized employee has selected one of two correct ingredient specifications for the mixing machine.

The Mixing Business Support Control System controls a rubber mixing machine that is part of an overall process of manufacturing tires. This diagram shows the preprocessing logic, which verifies that an authorized employee has selected one of two correct ingredient specifications for the mixing machine.

Mixing BSCS: Process Barcode Scan

The Mixing Business Support Control System controls a rubber mixing machine that is part of an overall process of manufacturing tires. This diagram shows all the checks that are made to a bale of rubber in the input queue before allowing it to be introduced into the mixer.

The Mixing Business Support Control System controls a rubber mixing machine that is part of an overall process of manufacturing tires. This diagram shows all the checks that are made to a bale of rubber in the input queue before allowing it to be introduced into the mixer.

PD Manager: Wireframe Sketch of Field Contact Entry Form

This is a wireframe sketch of a field contact report entry. A field contact is an interaction between a police officer and a citizen while on patrol, either because the circumstances appear suspicious, or because the officer is looking for information about a specifically identified situation.

This is a wireframe sketch of a field contact report entry. A field contact is an interaction between a police officer and a citizen while on patrol, either because the circumstances appear suspicious, or because the officer is looking for information about a specifically identified situation.

PPLS: Process Vendor RFQs

This diagram shows the flow of work for generating Vendor RFQs (Requests for Quote) for multiple open DIBBS (Defense Logistics Agency Internet Bulletin Board System) solicitations for a single NSN (National Stock Number). A Base RFQ joins a group of solicitations for one NSN to a group of vendor RFQs for parts conforming to that NSN; this diagram shows the process from the context of a single base RFQ/single NSN.

This diagram shows the flow of work for generating Vendor RFQs (Requests for Quote) for multiple open DIBBS (Defense Logistics Agency Internet Bulletin Board System) solicitations for a single NSN (National Stock Number). A Base RFQ joins a group of solicitations for one NSN to a group of vendor RFQs for parts conforming to that NSN; this diagram shows the process from the context of a single base RFQ/single NSN.

HealthCompare.com: Click-Through Commission Technical Design

This is a technical design document for an enhancement to an online enrollment system application. The enhancement enables the awarding of click-through commissions to linked websites.

This is a technical design document for an enhancement to an online enrollment system application. The enhancement enables the awarding of click-through commissions to linked websites.

UML: Documenting System Architecture and Behavior

This document contains a sampling of diagrams and other artifacts that document a software system. Taken together, the items illustrate an approach to documenting a problem domain, from a high-level overview down to details of architecture and behavior.

This document contains a sampling of diagrams and other artifacts that document a software system. Taken together, the items illustrate an approach to documenting a problem domain, from a high-level overview down to details of architecture and behavior.

AP Style Guide

A guide for writers and editors working with AP style to use as a reference.

A guide for writers and editors working with AP style to use as a reference.

AP Style and Punctuation Guide

Abbreviations
  1. Using periods in abbreviations
    1. Do not use periods in abbreviations of three or more words: NCAA, USC, UCLA.
      1. If the abbreviation would otherwise spell a word, then use periods: c.o.d..
    2. In general, use periods in abbreviations of two words: U.S., U.K., U.N. However, there are numerous exceptions such as AP, IT and GI. (When in doubt, use periods. If you see something all the time without periods, don’t use them.)
      1. A sportswriting exception: do not use periods in two-word abbreviations of universities: OU, ND.
  2. Dates
    1. Do not abbreviate days of the week.
    2. When a month is on its own or with just a year, don’t abbreviate it: My birthday is in September. I was born in September 1976.
    3. When a month is used with a specific day, abbreviate those with more than five letters (all months except March through July). Use the first three letters of the month to abbreviate: My birthday is on Sep. 15.
  3. Symbols
    1. Always spell out cents and percent (don’t use ¢ or %). Always use numerals (don’t write out the number) with cents and percent: 5 cents, 1 percent, 25 cents, 100 percent.
    2. Use $ if it accompanies a number: $5 (not $5.00),$49.95, $1 million.
    3. Use & (ampersand) only if it is part of an organization name: Texas A&M.
      1. In particular, avoid using & in titles for technical reasons: Google can interpret it as code. If you find that you have to use an ampersand in a title, such as with Texas A&M, take care that there is no space before or after it.
    4. Abbreviate “number” as No., and do not write out any numbers you use: No. 1, No. 84. (In case you were ever curious, this abbreviation comes from the French word for number, which is numéro.)
  4. Personal Titles
    1. For coaches, always use Coach as a title, if you use any title at all. Do not use HC, OC or DC. Those are job descriptions rather than titles, analogous to player positions such as QB and LB.
    2. Certain personal titles are abbreviated when given along with a person’s name: Dr. Marcus Welby, Gen. Robert E. Rodes. Certain are not: President Abraham Lincoln, Vice President Andrew Johnson. (For an exhaustive list of what titles to abbreviate and when, see http://writingexplained.org/ap-style/ap-style-titles, in particular the several links in the Additional Guidance section at the bottom.)
  5. Player and Coaching Positions
    1. Do not use HC, OC or DC as abbreviations for head coach, offensive coordinator and defensive coordinator, unless you are writing a coach’s opinion or analysis article and referring to the job description frequently. (In such a case, you may abbreviate any but the first use in your article.) Keep in mind that these are job descriptions rather than titles, and therefore are not to be capitalized when not abbreviated.
    2. Do not capitalize player positions such as quarterback.
    1. It is acceptable to use the standard one- or two-letter abbreviations for player positions, if you are using them frequently in an article. Write out the position on first use.
  1. Football plays
    1. When discussing a play in an analysis article, write it out the first time, then use common abbreviations in subsequent references if you prefer. Capitalize the abbreviations: RPO, QBS.
  2. Streets and Street Addresses
    1. If there is no street address, spell out the street name and direction (North, West, etc.): The city will close West Main Street.
      1. An exception is when the street name is a number. In this case, apply the rules for writing numbers: East 75th Street, Fifth Avenue.
    2. If using the entire street address, abbreviate everything you can, using periods in all cases: 5 W. 75th St., 846 Park Ave.
      1. However, do not abbreviate Circle, Court, Drive or Road.
  3. U.S. States
    1. Do not abbreviate states when they appear alone: The Ducks left for southern California yesterday.
    2. Do not abbreviate states with five or fewer letters: Idaho, Iowa, Maine, Ohio, Texas and Utah.
    3. Do not abbreviate Alaska or Hawaii.
    4. Abbreviate all other states when they appear in conjunction with the name of a city, town, village or military base: Eugene, Ore.., Fort Sill, Okla.
    5. When abbreviating, do not use the ZIP code two-letter abbreviations. Use the standard state abbreviations:
      Ala. Ariz. Ark. Calif. Colo. Conn.
      Del. Fla. Ga. Ill. Ind. Kan.
      Ky. La. Mass. Md. Mich. Minn.
      Miss. Mo. Mont. N.C. N.D.. N.H.
      N.J. N.M. N.Y. Neb. Nev. Okla.
      Ore. Pa. R.I. S.C. S.D.. Tenn.
      Vt. Va. W.Va. Wash. Wis. Wyo.
      Ala. Ariz. Ark. Calif.
      Colo. Conn. Del. Fla.
      Ga. Ill. Ind. Kan.
      Ky. La. Mass. Md.
      Mich. Minn. Miss. Mo.
      Mont. N.C. N.D.. N.H.
      N.J. N.M. N.Y. Neb.
      Nev. Okla. Ore. Pa.
      R.I. S.C. S.D.. Tenn.
      Vt. Va. W.Va. Wash.
      Wis. Wyo.
  4. U.S. Cities
    1. Do not abbreviate any part of U.S. city names, even if they contain words that are often abbreviated in street names: South Bend, Ind.; North Platte, Neb..
    2. The lone exception to this is always to abbreviate the word Saint: St. Louis, St. Paul, Minn..
    1. Include the state with the city, except with these major cities:
      Atlanta Baltimore Boston Chicago Cincinnati
      Cleveland Dallas Denver Detroit Honolulu
      Houston Indianapolis Las Vegas Los Angeles Miami
      Milwaukee Minneapolis New Orleans New York Oklahoma City
      Philadelphia Phoenix Pittsburgh St. Louis San Diego
      San Francisco Seattle Salt Lake City San Antonio Washington
      Atlanta Cleveland Houston
      Milwaukee Philadelphia San Antonio
      Baltimore Dallas Indianapolis
      Minneapolis Phoenix San Diego
      Boston Denver Las Vegas
      New Orleans Pittsburgh San Francisco
      Chicago Detroit Los Angeles
      New York St. Louis Seattle
      Cincinnati Honolulu Miami
      Oklahoma City Salt Lake City Washington
      Atlanta Cleveland
      Houston Milwaukee
      Philadelphia San Antonio
      Baltimore Dallas
      Indianapolis Minneapolis
      Phoenix San Diego
      Boston Denver
      Las Vegas New Orleans
      Pittsburgh San Francisco
      Chicago Detroit
      Los Angeles New York
      St. Louis Seattle
      Cincinnati Honolulu
      Miami Oklahoma City
      Salt Lake City Washington
Capitalization
  1. Always capitalize the first word of a sentence. This rule overrides all other capitalization rules.
  2. Capitalize proper nouns (names of specific persons, places or things): Notre Dame Fighting Irish, Marcus Freeman, Sacred Heart Basilica.
  3. There are a few exceptions, usually brand names such as eBay. (Avoid putting those exceptions at the beginning of a sentence, as you will have to capitalize them.)
  4. If a common noun is part of a name, do not capitalize it if it’s in plural form (when referring to more than one of the same type of thing): the Ohio and Mississippi rivers, lakes Erie and Ontario, Autzen and Reser stadiums. An exception to this is if a common noun is part of a nickname for a sports team: The Chicago Bears, The Oregon Ducks. In this case, capitalize the word even when using only the nickname: The Bears, The Ducks.
  5. For more capitalization rules for names of persons, see Names of Persons below.
  6. Sports Coaches, Players and Teams
    1. Do not capitalize head coach, offensive coordinator, defensive coordinator, etc. and do not use them as titles. Use Coach (capitalized) for the title of any coach: Coach Marcus Freeman rather than Head Coach Marcus Freeman. Head coach is a job description rather than a title: Notre Dame’s new head coach, Marcus Freeman, arrived in South Bend yesterday.
    2. Do not capitalize player positions such as quarterback.
    3. If you are using an abbreviation for a player or coach, capitalize it: HC, OC, DC, QB, LB, WR, etc.
    4. Do not capitalize a player’s academic year: senior quarterback Patrick Mahomes.
    5. Do not capitalize terms such as defensive line, red zone or offensive line.
    6. Do not capitalize names of plays: dive play, off tackle, run-pass option, quarterback sneak.
    7. For more information on AP style as specifically applied to football, see http://www.ap.org/press-releases/2012/ap-compiles-super-bowl-style-guide.
  7. Compass points
    1. Capitalize regions that use a compass point: The Southeast is a major recruiting area.
    2. Capitalize names of areas that are equivalent to proper names: London’s East End neighborhood.
    3. Do not capitalize directions that use a compass point: Tornadoes generally move northeast.
  8. Capitalize words that derive from a proper noun when the noun is part of the meaning: Shakespearean, Socratic. Do not capitalize words deriving from a proper noun if they no longer depend on the noun for their meaning: english (when referring to spin on a ball in billiards and pool), french fries, herculean.
  1. Capitalize awards and decorations: the Heisman Trophy, the National Championship Trophy, the Dick Butkus Award.
  2. Capitalize family words when they are used as a substitute for a person’s name: Mom and Dad came to visit the campus. Otherwise, do not capitalize them: My mother and father came to visit the campus.
  3. Capitalize names of specific animals: Bevo the steer, Uga the bulldog. Capitalize proper nouns in animal breeds: Uga is an English bulldog, Bevo is a Texas longhorn steer.
    1. However, Bevo is the Texas Longhorns’ steer is correct. Texas Longhorns is a proper name, therefore Longhorns is capitalized.
  4. Do not capitalize plant names unless they contain a proper noun: white pine, Sitka spruce, Douglas fir.
  5. Do not capitalize seasons unless they are part of a proper name: spring ball, the Oregon Spring Game.
Dates and Times
  1. Dates
    1. Use numbers for days: Jan. 1 rather than Jan. 1st.
    2. Write out days of the week in full.
    3. Capitalize months.
    4. When a month is on its own or with just a year, don’t abbreviate it: My birthday is in September. I was born in September 1976.
    5. When a phrase lists only a month and year, do not separate the month and the year with commas: February 1980 was his best month.
    6. When a month is used with a specific day, abbreviate those with more than five letters (all months except March through July). Use the first three letters of the month to abbreviate: My birthday is on Sep. 15.
    7. When a date has a month, day and year, set off the year with commas: Sep. 4, 2024, is a day we are all waiting for.
  2. Times
    1. Use numerals for all times, along with a.m. or p.m.: Our meeting was at 2:30 p.m. Do not use zeros with times that are on the hour: 2 p.m. rather than 2:00 p.m.
    2. Exceptions:
      1. Do not use 12 a.m. or 12 p.m., as these are inaccurate (a.m. and p.m. are abbreviations for the Latin ante meridiem and post meridiem, meaning before midday and after midday, respectively). Use noon and midnight (without using 12) instead. If you need to abbreviate them (for example, you have a table of hourly times), you may use 12 n. and 12 m.
      2. When using the word o’clock, standard rules for numbers apply: four o’clock, 10 o’clock.
    3. If the time includes minutes, separate the hour and minutes with a colon: 12:45 p.m.
    4. If the time includes seconds, separate them from the minutes with a colon as well: The current world record in the men’s marathon is 2:02:57. Neil Armstrong took his first step on the moon on July 21, 1969, at 10:56:12 p.m. EDT.
Italics
  1. Italicize the titles of complete works. The titles of comparatively short works — songs, short poems, essays, and episodes of TV programs — should be enclosed in quotation marks instead.

Some examples:

    1. Books: Catch-22, by Joseph Heller
    2. Magazines and journals: Time
    3. Newspapers: The Times
    4. Plays: A Raisin in the Sun, by Lorraine Hansberry
    5. Movies: The Godfather
    6. Television programs: Doctor Who
    7. Works of art: Nighthawks, by Edward Hopper
    8. Albums and CDs: OK Computer, by Radiohead
  1. Italicize the names of aircraft, ships and trains, foreign words used in an English sentence, and words and letters discussed as words and letters. For example:
    1. “These are the voyages of the starship Enterprise.” (Title sequence of the original Star Trek TV series)
    2. From 1925 to 1953, a passenger train named the Orange Blossom Special brought vacationers to sunny Florida from New York.
    3. “There is no danger that Titanic will sink. The boat is unsinkable and nothing but inconvenience will be suffered by the passengers.” (Phillip Franklin, Vice President of White Star Line)
    4. “Come kiss me, and say goodbye like a man. No, not good-bye, au revoir.” (William Graham, “Chats With Jane Clermont,” 1893)
    5. “Every word she writes is a lie, including and and the.” (Mary McCarthy on Lillian Hellman)
  2. Use italics to emphasize words and phrases:
    1. “I don’t even like old cars. I mean they don’t even interest me. I’d rather have a … horse. A horse is at least human, for God’s sake.” (J. D. Salinger, The Catcher in the Rye)
    2. However, it is wise to keep this in mind: “Think of italics as butterflies that might swoop across the page, allow them to flit about, land here and there, softly; gently; don’t treat them as a blanket that must spread itself across the entire page. The butterfly approach will bring a dash of color; the blanket approach will darken everything.” (William Noble, Noble’s Book of Writing Blunders (and How to Avoid Them), Writer’s Digest Books, 2006)
Names of Persons
  1. The first time you refer to a person in an article, use the person’s full name, as well as any appropriate title. Thereafter, use only the person’s last name.
    1. In particular, do not refer to a coach as Coach in any references but the first one (where it is optional), unless the reference is part of a quote. Again, just use the last name in references subsequent to the first one.
    2. However, you may use the first name (and any appropriate title) again as part of a summary paragraph at the end of the article.
  2. Do not use Mr., Mrs., Ms. or Miss with names, unless they are part of a quote.
  3. Do not precede Sr. or Jr. with a comma: Mike Sanford Sr., Mike Sanford Jr.
  4. It’s important to distinguish between a personal title and a job description. These are titles: Gen. Robert E. Rodes, Dr. Marcus Welby. If you are using the title as part of a job description, don’t abbreviate or capitalize it: Confederate general Robert E. Rodes, television doctor Marcus Welby.
Numbers

The cardinal numbers (one, two, three, etc.) zero through nine are written out, as are the ordinal numbers (first, second, third, etc.) first through ninth. and above are written as numerals: 10, 11, 12; 10th, 11th, 12th.

Some exceptions to these rules are:

  1. Write out a number when it begins a sentence: Twenty-four years ago, I bought my house. Two exceptions to this exception:
    1. When citing a year at the beginning of a sentence, use the numeral: 2016 is the first year that Washington has beaten Oregon since 2003.
    2. When citing a score at the beginning of a sentence, use the numeral: 24-22 was a much closer score than expected.
  2. When citing a score involving a number less than 10, use the numeral: Oregon beat Old Dominion by a score of 58-3. (Spell out a number less than 10 if you don’t use a hyphen: a score of 58 to three.)
  3. Always write an age as a number, when you are using just the number: Frank had two boys: Joe, 5 and James, 3.(However, Joe was five years old is correct.)
    1. If the age is less than one year, the normal rules for numbers apply: six months, 11 months.
  4. Write out numbers in proper names: Final Four.
  5. Use the numeral for all numbers except zero when writing a series of statistics: Freeman had 185 yards on 18 carries, 2 touchdowns and zero fumbles. (Of course, you could say no fumbles here if you prefer.)
  6. Use the numeral in most sports-specific expressions involving numbers: 4-star recruit, 3rd and 9, 4th down, 5-yard line, 3-point shot, par 4, 3-1 odds. However, when using ordinal numbers in a compound adjective (which is hyphenated) it is acceptable to write them out. For example, feel free to use fourth-down yardage instead of 4th-down yardage, if it looks better to you.
    1. When referring to weeks of a season use the numeral: week 1 rather than week one.
  7. Do not spell out monetary numbers, and do not add zeros for whole-dollar amounts: $6 rather than $6.00 or six dollars.
    1. An exception: write out expressions such as a dollar, a couple of dollars, two or three dollars. (Make a dollar or two would look very funny if written make $1 or $2.)
  8. Write out numbers contained in well-known expressions: a picture is worth a thousand words, if I had a million dollars, an eleventh-hour comeback, a high-five.

For a list of quite a few other exceptions, see http://writingexplained.org/ap-style/ap-style-numbers.

Punctuation
  1. Exclamation Point
    1. Be careful not to overuse exclamation points. Use them to indicate something surprising or something that stands out significantly from the surrounding context.
    2. Do not double exclamation points or combine them with other punctuation such as question marks.
    3. Use them only at the end of a complete sentence, unless they are part of a quotation (for more information on combining exclamation points and quotation marks, see the section on quotation marks).
    4. If you are using an informal tone, you may use one in parentheses (!) to indicate surprise or amusement at something that you are saying.
  2. Period
    1. A period ends a sentence, or indicates an abbreviation.
    2. For more information on how to combine periods and quotation marks, see the section on quotation marks.
  1. Question Mark
    1. Use a question mark only when the sentence asks a question.
      1. In particular, avoid using a question mark to indicate a “dramatic pause”: If you don’t submit your article on time? You will be beheaded.
    2. Use a question mark only at the end of a complete sentence, unless it is part of a quotation (for more information on combining question marks and quotation marks, see the section on quotation marks).
  2. Apostrophe

    Apostrophes are the cause of many spelling errors. It’s important to have a thorough understanding of how to use (and how not to use) them.

    1. Apostrophes are used in three situations:
      1. To indicate letters left out in a contraction: isn’t, you’re, we’d, etc.
      2. To indicate the possessive case with a common or proper noun, with s: Oregon’s team, the team’s players.
      3. To indicate the plural of a single letter, with s: mind your p’s and q’s, this sentence contains a total of six t’s.
    2. When using an apostrophe with the possessive case, these rules apply:
      1. Singular noun: add ’s to the word: Oregon’s schedule, the team’s schedule.
      2. Plural noun ending in s: add just an apostrophe to the word: the Ducks’ schedule, the Pac-12 teams’ schedules, girls’ basketball.
      3. Irregular plural noun not ending in s: same rule as a singular noun: women’s basketball, children’s music.
    3. The rules for singular nouns that end in s are a bit complicated. The Chicago Manual of Style suggests treating them the same as any other singular noun: the Jones’s car, the boss’s office. AP Style’s rules are more complicated, and not always adopted:
      1. If the noun is a proper noun, just add an apostrophe: the Jones’ car.
      2. If the noun is a common noun, add ’s: the boss’s office.
      3. In rare cases where the s isn’t pronounced in a common expression, omit it from the spelling: for goodness’ sake, but for completeness’s sake.
    4. Apostrophes are often misused. Here are some typical mistakes to avoid:
      1. Do not use an apostrophe in plurals of proper nouns ending in s: keeping up with the Joneses, not keeping up with the Jones’s (or Jones’). This is easy to confuse because of the Jones’s house (i.e. the house belonging to the Joneses, a possessive).
      2. Do not use an apostrophe to indicate the plural of an abbreviation: RBIs, INTs, CDs rather than RBI’s, INT’s, CD’s.
      3. Do use an apostrophe to indicate a plural reference to a letter: mind your p’s and q’s, dot all the i’s and cross all the t’s.
      1. Do not use apostrophes to indicate a decade: 1990s rather than 1990’s.
      2. However, ’90s is correct, because in this case you are using the apostrophe to indicate numbers left out. Either ’90s or 90s is acceptable.
      3. Do not confuse the plural of a regular common noun with the possessive of same. None of the apostrophes in this sentence are correct: Some writer’s have a nervous habit of using apostrophe’s to indicate plural’s of regular common noun’s. (To correct this sentence, simply remove all of the apostrophes.)
      4. Finally, do not confuse its and it’s. Its is a possessive pronoun, comparable to his, her, your and their. It’s is a contraction of the words it is, and the apostrophe indicates that the i in the word is is omitted.
  1. Comma
    1. When writing numerals, use a comma with a four-digit number: 1,025.
    2. Exceptions are years: 2017, street addresses: 15650 Arthur St. and page numbers.
    3. Set off degrees and certifications with a comma after a person’s name: John Jones, Ph.D. or Marcus Welby, M.D.
    4. Set off direct addresses of persons or groups with commas: Thank you, Mr. and Mrs. Jones, for your kind donation. Just think, fellow Scouts, what we will be able to do with these funds. Friends, we will be looking for your ideas in next week’s meeting.
    5. With dates, these rules apply:
      1. Separate day, date and year with commas: Saturday, Sep. 4, 2017.
      2. Omit the comma when only using month and year: September 2017. (Also, do not abbreviate the month in this case.)
    6. Separate geographic references with commas: The University of Oregon is in Eugene, Lane County, Ore.
    7. When listing a group of related items, list each one separated by a comma, except omit the comma after the second-to-last item: My siblings’ names are Anne, John, David, Peter, Paul and Mary.
      1. If the sentence is ambiguous without it, use the last comma: The meal consisted of steak, green beans, and macaroni and cheese.
    8. Separate multiple adjectives that modify the same noun with a comma: It was a windy, blustery day.
      1. Do not separate adjectives that are not really multiple modifications to the noun: bright green jerseys are not the same thing as bright, green jerseys.
    9. Set off non-essential information in a sentence with commas: Joe, who was in a hurry, left without his books. The main sentence is Joe left without his books. The fact that he was also in a hurry is additional information. Contrast this with The student who was in a hurry left without his books. In this sentence, there are other students who were not in a hurry and did not leave without their books, so who was in a hurry is essential to explaining who left without his books. (For more information, see the section on which vs. than in Common Errors and Points of Style.)
    10. Use a comma to join two complete sentences with a coordinating conjunction (and, but, for, or, nor, so, yet): The Ducks had a rough season last year, so they hired a new coach.
      1. In short sentences, you may omit the comma: I brought the hamburgers and Joe grilled them.
      2. Do not use a comma if one of the sentences is incoimplete: Joe is looking for four tickets but will settle for two. (Compare Joe is looking for four tickets, but he will settle for two.)
    11. If a dependent clause (a part of a sentence that can’t stand on its own, so it has to be part of another sentence) precedes an independent clause (a part of a sentence that is a complete sentence on its own), then separate it with a comma: If you don’t get in line soon, you won’t get a ticket. If the dependent clause follows the independent clause, do not use a comma: You won’t get a ticket if you don’t get in line soon. (Note that you won’t get a ticket is a complete sentence, and if you don’t get in line soon is not.)
  1. Semicolon
    1. A semicolon is used to join two complete and related sentences: Jim had 1,338 rushing yards last season; Joe, in three fewer games, had 1,268.
    2. You can also use semicolons to join complex lists when necessary: You have these choices available: green, red or blue; square, circle or triangle; and small, medium or large.
  2. Colon
    1. Use a colon to introduce a quote or example: This is a quote or example.
    2. Use a colon to introduce a list: Three coaching positions will report directly to the head coach: offensive coordinator, defensive coordinator and special teams coordinator.
    3. Use a colon to introduce a clarifying word or phrase at the end of a sentence: One thing more than any other is the source of improvement: showing up for practice.
    4. A colon should always follow an independent clause (a group of words that can stand on their own as a complete sentence).
      1. There are three open positions: left guard, center and free safety. (This is correct.)
      2. The three open positions are: left guard, center and free safety. (This is not correct, because The three open positions are is not a complete sentence. In this case, you could simply omit the colon: The three open positions are left guard, center and free safety.
    5. If a colon introduces more than one complete sentence, capitalize the word just after the colon: Willie Taggart has three rules: Make no excuses. Blame no one. Do something. If there is only one complete sentence, don’t capitalize it: Willie Taggart has one rule: do something.
    6. Colons are also used between the hours, minutes and seconds of a time: 3:35:07 p.m. None of the above rules apply in this situation.
  3. Hyphen

    The rules for the use of hyphens are fluid. They change fairly often, and there are many inconsistencies in the way that they are applied. For example, e-mail was common 20 years ago, and now it is almost entirely replaced with email. Online was on-line before the internet became ubiquitous. At the same time, many other less common “e” compounds still retain the hyphen, such as e-book and e-learning. For some common hyphenation errors, see Common Errors and Points of Style. For an exhaustive list of rules, see The Chicago Manual of Style’s 10-page online document on the subject. These rules also apply to AP Style.

  4. Dash
    1. Dashes give a sense of interrupting the flow of thought. Use a dash to set off part of a sentence more strongly that you would by using commas: Joe gained just 43 yards — a far cry from his usual total.
    2. In AP style, dashes are always em dashes (—). They are always preceded and followed by a space, except when they begin or end a sentence. At the beginning of a sentence, omit the leading space; at the end of a sentence, omit the trailing space.
  5. Ellipsis
    1. An ellipsis is written as space, three periods, space, so: “ … ” with two exceptions. If the ellipsis begins the first sentence in a paragraph, omit the first space; if it ends the last sentence, omit the last space. (These exceptions don’t come up very often.)
    1. Use an ellipsis to show parts of the middle of a quotation that you are leaving out. Suppose Joe says this: “We are fumbling too often. We have to be more careful to hold on to the ball. If we don’t, we’re going to have trouble winning games. Taking care of the ball wins games.” You can use an ellipsis to abbreviate this to Joe said “We have to be more careful to hold on to the ball … Taking care of the ball wins games.” Notice that you do not put an ellipsis at the beginning of the quote, even though you don’t start it at the beginning.
    2. Use an ellipsis to suggest a trailing off of thought: Perhaps we could take … well, perhaps not.
  1. Parentheses
    1. Parentheses (the plural of parenthesis) are always used in pairs. Use parentheses to set off “as an aside” statements from the main flow of the sentence: Oregon has won the conference championship six times (although they have yet to win a national championship).
    2. The closing parenthesis goes before the final punctuation (period, question mark or exclamation point) if it is part of a larger sentence (this is an example). If it is part of an entire sentence, the final punctuation goes inside the closing parenthesis. (This is an example.)
  2. Quotation Marks
    1. Periods and commas always go inside quotation marks: Joe said “I’ll be leaving now.” and “I’ll be leaving now,” Joe said.
    2. All other punctuation goes outside quotation marks: Did Jim say “I know”?
    3. The exception to this is if the punctuation is part of the quotation itself: “Who knows?” Jane asked. “Look out!” Joe cried.
  3. Angle Brackets
    1. Use angle brackets to add your own words to a quote, to make clarifications or comments to it. Suppose Joe says this: “We are fumbling too often. We have to be more careful to hold on to the ball. If we don’t, we’re going to have trouble winning games.” You could quote Joe this way: “We are fumbling too often … If we don’t [hold on to the ball], we’re going to have trouble winning games.”
    2. Use [sic] to show the reader that you are quoting something as written, when there are errors in the writing. Do not correct the original quote: According to Dan Dropout of Second-Rate Sports, “Oregon has to do better with there [sic] defensive line.”
Titles of Articles
  1. Most words in titles are capitalized.
  2. Always capitalize the first and last words of a title.
  3. Capitalize everything else except a, an, and, at, but, by, for, in, nor, of, on, or, out, so, the, to, up, and yet. Optional exceptions:
    1. This one gets tricky, so feel free not to use it. So, up and yet can also be used as adverbs. When they are, you may capitalize them if you think it looks better. Examples:
      1. Ducks Gain Only 75 Yards Rushing yet Still Win
      2. Ducks Have Yet to Lose
      3. Jones Misses Practice so He Can Rest Injured Pinky
      4. Why There Are So Many Injuries in Football
      5. Jones Walks up the Stairs
      6. Jones Looks Up an Old Friend
    1. The way to tell if the word is being used as an adverb is to see if it modifies a verb, an adjective or another adverb. In sentence ii above, the word yet modifies the verb have. In sentence iv, the word so modifies the adjective many. In sentence vi, the word up modifies the verb looks.
    2. To also functions as an adverb in a few idiomatic expressions: come to (regain consciousness), fall to (start in on something, as in We fell to with a will), pull to (close, as in pull a door to). In these cases, you may also capitalize to.
    3. Capitalize to in the expression to and fro if you think that The Ducks Ran to and Fro looks funny.
  1. In particular, be careful to capitalize forms of the verb to be: am, are, is, was and were, and forms of the verb to do: do, does and did.
  2. If you have a title and you’re unsure whether you’re capitalizing it correctly, https://capitalizemytitle.com/ is an excellent resource to check it.
AP Style Miscellanies
  1. In 2010, the AP style changed from Web site to website.
  2. In 2011, e-mail became email. However, other e-terms still retain the hyphen: e-book, e-commerce, e-business.
  3. In 2014, AP style determined that more than and over could be used interchangeably, when referring to an amount: over 200 yards rushing, more than 200 yards rushing — Mike Shor’s tweet “More than my dead body!” notwithstanding.
  4. In 2016, Internet became internet and Web became web.
Common Writing Errors

This document addresses a number of common mistakes that people make when writing: its vs. it’s, affect vs. effect, and so on.

This document addresses a number of common mistakes that people make when writing: its vs. it’s, affect vs. effect, and so on.

Common Writing Errors

This is a list of grammar, punctuation and spelling errors that are easy to get wrong in writing and/or editing.

  1. Like vs. such as: use like for comparisons and such as for inclusions. There are no teams like the New York Yankees. Teams that spend a lot of money, such as the New York Yankees, are perennial World Series contenders.

  2. A compound sentence joins two complete — often shorter — sentences into one, using a coordinating conjunction to join them. (There are seven coordinating conjunctions: and, but, or, for, nor, so and yet.) When writing a compound sentence, use a comma before the conjunction that joins the two sentences: I’m a fine writer, but I’m a controversial one as well. If you are not joining two complete sentences, omit the comma: I am a fine writer but a controversial one as well.

  3. Know the difference between then and than. First this, then that. I would rather be first than second. Then deals with time sequences. Than deals with comparisons and choices.

  4. Contractions and possessive nouns always have apostrophes, and possessive pronouns never do. If you remember this, you will not have trouble with your vs.you’re, their vs. they’re and especially its vs. it’s (its is probably the most often misspelled word in the English language).

    These are the possessive pronouns:

    1. hers

    2. his

    3. its

    4. mine

    5. ours

    6. theirs

    7. yours

    Note that none of them have an apostrophe.

  5. Which vs. that: Use which for non-restrictive clauses and that for restrictive clauses.

    A clause is group of related words containing a verb. A complete sentence, then, always has at least one clause. It will often have more than one. The words in a clause are not necessarily contiguous in a sentence.

    Here is a sentence with two clauses:

    Chairs that don’t have cushions are uncomfortable.

    The main clause (the complete sentence) is Chairs are uncomfortable. The additional clause in the first sentence is that don’t have cushions. We don’t want to say that all chairs are uncomfortable, so we add another clause to explain that only chairs without cushions are uncomfortable. In other words, we restrict the chairs we’re calling uncomfortable to those without cushions. So, that don’t have cushions is a restrictive clause.

    Now, let’s change the sentence, replacing that with which:

    Chairs, which don’t have cushions, are uncomfortable.

    Now, we’re not only saying that all chairs are uncomfortable, we’re saying that none of them have cushions, either! We are not restricting the type of chairs we’re talking about. So, which don’t have cushions is a non-restrictive clause.

  1. Notice also that which don’t have cushions is set off by commas, and that don’t have cushions is not. So, there is one more part to the rule: non-restrictive clauses are set off by commas, and restrictive clauses aren’t.

    Now that you know the difference between a restrictive and a non-restrictive clause, here is the whole rule:

    Use which with non-restrictive clauses, and set off the clause with commas. Use that with restrictive clauses, and do not set off the clause with commas.

  2. When using a or an with an initialism, use whichever you would use with the first letter alone: an HTML, an LCD, a CICS, an RGB, a UPS.

    Initialisms are often incorrectly called acronyms. If you pronounce the abbreviation as a word, it’s an acronym: ANSI, WYSIWYG, DOS, LAMP. If you don’t, it’s an initialism: API, PHP, SMTP.. This rule does not apply to acronyms.

    This can get a bit confusing. For example, it’s an SMTP server, but a SOAP message. The fact that the S in SMTP stands for simple has nothing to do with whether you use a or an in front of it. What matters is what you would use in front of the first letter S by itself.

  3. Avoid misplaced modifiers. For example, they nearly scored every time they had the ball has a very different meaning from they scored nearly every time they had the ball. Misplaced modifiers (nearly is the modifier in this example) don’t always change the meaning of the sentence this drastically, but they usually make the sentence harder to understand. For example, Joe read only 10 pages is preferable to Joe only read 10 pages, because the latter could be taken to mean that Joe did nothing but read 10 pages.

    As a rule, a modifier should immediately precede the word it modifies.

  4. Be careful with hyphenation rules for compound adjectives. A compound adjective is a combination of two or more words that function as a single adjective. The basic reason that we hyphenate them is to clarify meaning: 300-odd editors are (probably) not the same thing as 300 odd editors (credit to GrammarMonkeys for that one).

    Hyphenation rules for compound adjectives include:

    1. Hyphenate compound adjectives that precede the noun they modify: off-campus apartment, run-oriented offense, first-place finish.

      Note also that removing the hyphen from a compound adjective can create an alternate meaning: a small-state senator is senator in a state with a small population, while a small state senator is a state senator who is small. (Once you remove the hyphen, the two words are no longer a compound adjective, but two separate adjectives modifying the same noun.)

    2. Do not hyphenate compound adjectives that follow the noun they modify: he had an apartment off campus, the offense was run oriented, they finished in first place.

    3. Do not hyphenate a compound adjective that begins with an adverb ending in -ly: a carefully constructed play rather than a carefully-constructed play. (Technically, this isn’t really a compound adjective, but an adverb modifying an adjective that modifies a noun.)

      1. If the beginning word is an adverb that doesn’t end in -ly, the rules vary. For example, much-needed respite but least common multiple. And some adverbs can be hyphenated or not, depending on meaning: the most-satisfied customers are customers with the highest level of satisfaction, while the most satisifed customers is the largest number of satisfied customers.

    4. This is only a partial list. Hyphenation is complicated, and proofreaders often have to look up exactly how to hyphenate compounds. The Chicago Manual of Style’s Hyphenation Table is a comprehensive reference. All of the rules apply equally to AP Style, except CMS rules about when to use the slightly wider n-dash (–) can be ignored, as AP Style only uses hyphens. When in doubt, look it up!

  1. Be careful not to confuse words and phrases that sound similar. Your spell checker won’t help you with these! (For an amusing take on the limitations of the spell checker, see the satirical poem Ode to a Spell Checker.) This is a list of some commonly confused words, with some explanations of commonly mangled phrases. If you’re not sure of the difference between some of the listed words, please look them up in a dictionary. (Googling “definition [your word]” will give you a dictionary definition.)

    1. Affect, effect

      1. This one is particularly complicated, because each one can be either a noun or a verb, and they all have different meanings. For more information, see Affect vs. Effect and 34 Other Common Confusions.

    2. Allusion, illusion

    3. Allude, elude

    4. Assure, ensure, insure

    5. Bait, bate

      1. In particular: bated breath, not baited breath.

    6. Born, borne

    7. Breath, breathe

    8. Cache, cachet

    9. Capital, capitol

    10. Complement, compliment

    11. Core, corps

      1. A corps is a body of people. So press corps, not press core.

    12. Counsel, council

    13. Criterion, criteria

      1. Criterion is the singular form of criteria.

    14. Desert, dessert
      1. In particular: get one’s just deserts, not get one’s just desserts. (When desert is pronounced like dessert, it means something that is deserved.)

    15. Discreet, discrete

    16. Dew, do, due

      1. In particular: make do, not make due.

    17. Fewer than, less than
      1. For more information, see Less vs. Fewer.

    18. Gaff, gaffe

    19. Gibe, jibe

    20. Hoard, horde

    21. Home, hone

      1. In particular: home in on, not hone in on. Although the latter is finding its way into accepted usage, it isn’t considered correct. See Hone/Home for more information.

    22. Its, it’s

      1. Its is probably the most commonly misspelled word in English, probably at least in part because the apostrophe was dropped only about 200 years ago. For help on how to get it right, see When to Use It’s vs. Its.

    1. Lay, lie

    2. Lead, led

    3. Loath, loathe

    4. Loose, lose

      1. It has recently become fairly common to incorrectly use loose in place of lose: loose weight, loose my keys, etc. Lose is a verb whose basic meaning is “no longer have.” Loose is an adjective meaning “not confined.” Where the confusion arises is that loose also has a somewhat archaic function as a verb, with the meaning of “turn loose” or “set free.” Probably the best-known example of this usage is He hath loosed the fateful lightning of his terrible swift sword, from The Battle Hymn of the Republic.

    5. Moot, mute

      1. In particular: moot point, not mute point.

    6. Peak, peek, pique

      1. In particular: pique one’s interest, not peek or peak one’s interest.

    7. Phenomenon, phenomena

      1. Phenomenon is the singular form of phenomena.

    8. Pole, poll

      1. In particular: pole position, not poll position. In horse racing, distances of 1/16th of a mile are marked with a pole. Starting nearest the pole, or at the innermost position on the track, is considered an advantage. Auto racing borrowed the term to mean the first starting position. The term has since broadened, especially in slang, to mean any advantageous position.

    9. Principal, principle

    10. Rain, reign, rein

      1. In particular: free rein and take the reins, not free reign and take the reigns — a common error in our horse-deprived society.

    11. Rational, rationale

    12. Right, rite

      1. In particular: rite of passage, not right of passage. This is easy to get wrong, because a “right of passage” makes logical sense in the sense of being allowed to go somewhere. But the term actually comes from the many ceremonies around passage into adulthood.

    13. Sight, site

      1. In particular: onsite or on-site, not onsight or on-sight, to mean “at a

        particular place.”

    14. Straight, strait

      1. In particular: dire straits and strait jacket, not dire straights and straight jacket.

    15. Than, then

    16. There, their, they’re

    17. To, too, two

    18. Toe, tow

      1. In particular: toe the line, not tow the line.

    19. Waive, wave

    20. Wet, whet

      1. In particular: whet one’s appetite, not wet one’s appetite.

    21. Who’s, whose

    22. Your, you’re