Just enough grammar (optional)

This unit provides just enough grammar to understand the remainder of the course. If you already know some grammar, move on to Words . Otherwise, read on.

For simplicity's sake, this unit takes a few shortcuts; grammatical topics are actually wildly more complicated than this unit suggests.

Grammarians don't all agree on the number or types of parts of speech. The following table focuses on the parts of speech relevant to this course:

Part of Speech Definition Example
Noun
A person, place, concept, or thing Sam runs races .
Pronoun
A noun that replaces another noun (or larger structure) Sam runs races. He likes to compete.
Adjective
A word or phrase that modifies a noun Sam wears blue shoes.
Verb
An action word or phrase Sam runs races.
Adverb
A word or phrase that modifies a verb, an adjective, or another adverb Sam runs slowly .
Preposition
A word or phrase specifying the positional relationship of two nouns Sam's sneakers are seldom on his shelf.
Conjunction
A word that connects two nouns or phrases Sam's trophies and ribbons live only in his imagination.
Transition
A word or phrase that connects two sentences Sam runs races weekly. However , he finishes races weakly.

Nouns

Nouns represent people, places, or things. Judy, Antarctica, and hammersare all nouns, but so are intangible concepts like robustnessand perfection. In the following example passage, we've formatted the nouns in bold:

In the framework, an objectmust copy any underlying valuesthat the objectwants to change. The protocol buffersin the codebaseare huge, so copying the protocol buffersis unacceptably expensive.

In programming, you might think of classes and variables as your program's nouns.

Exercise

Identify the six nouns in the following passage:

C enables programmers to control pointers and memory. Great power brings great responsibility.

Pronouns

Pronouns are an indirection layer—pointers to or substitutions for other nouns or sentences. For example, consider the following two sentences:

Janet writes great code. Sheis a senior staff engineer.

In the preceding example, the first sentence establishes Janetas a noun. The second sentence replaces the noun Janetwith the pronoun She.

In the following example, the pronoun Thisreplaces an entire sentence:

Most applications aren't sufficiently tested. Thisis poor engineering.

Exercise

Identify the three pronouns in the following passage:

The cafeteria featured peanut butter and plum jam on rye toast. Employees found it awesome and wished they could eat this every day.

Verbs

A verb is an action word or phrase. When you want to represent the relationship between two nouns (an actor and a target), the verb does the work. A verb identifies what the actor does to the target.

Each sentence must contain at least one verb. For example, each of the following sentences contains a single verb:

  • Sakai preferspasta.
  • Rick likesthe ocean.
  • Smurfs areblue.
  • Jess suffersfrom allergies.

Some sentences, such as the following, contain multiple verbs:

  • Nala suffersfrom allergies and sneezesconstantly.
  • The program runsslowly but failsquickly.

Depending on the tense and the conjugation, a verb could consist of one word or multiple words. For example:

  • Tina was eatingbreakfast a few hours ago.
  • Tina is eatinglunch right now.
  • Tina will eatdinner tonight at 7:00.

Exercise

Identify the verbs in the following passage:

Samantha is coding Operation Bullwinkle in C++. This project currently consumes over 80,000 lines of code. She previously used Python, but recently gravitated to C++. Samantha leads a team of four software engineers, which will grow to six software engineers next quarter.

Adjectives and adverbs

Adjectives modify nouns. For example, in the following passage, notice how the adjectives modify the subsequent noun:

  • Tom likes redballoons. He prepares deliciousfood. He fixed eightbugs at work.

Most adverbs modify verbs. For example, notice how the adverb ( efficiently) in the following sentence modifies the verb ( fixes):

  • Jane efficientlyfixes bugs.

Adverbs are not necessarily right next to their verb. For example, in the following sentence, the adverb ( efficiently) is two words away from the verb ( fixes):

  • Jane fixes bugs efficiently.

Adverbs can also modify adjectives or other adverbs.

Exercise

Identify the four adjectives in the following passage:

Engineering is a great career for a brilliant mind. I know a clever engineer who could excel at any intellectual task.

Prepositions

Prepositions specify the relationship between two things. Some prepositions answer the question, " Where is this thing relative to that other thing?" For example:

  • The submenu lies underthe menu.
  • The definition appears next tothe term.
  • The print function falls withinthe main routine.

Other prepositions answer the question, " When is this event relative to that other event?" For example:

  • The program evaluates the addition operation beforeevaluating the subtraction operation.
  • The cron daemon executes the script every Tuesday atnoon.

A few prepositions (for example, byand of) answer other kinds of questions about relationships. For example, the following sentence uses byto relate a book to its authors:

  • The C Programming Language byKernighan and Richie remains popular.

Exercise

Identify the two prepositions in the following passage:

Parameters may optionally appear within a URL, after the path.

Conjunctions and transitions

Conjunctions connect phrases or nouns within a sentence; transitions connect sentences themselves.

The most important conjunctions are as follows:

  • And
  • But
  • Or

For example, in the following sentence, andconnects "code" with "documentation," while butconnects the first half of the sentence with the second.

Olivia writes great internal code anddocumentation butseldom works on open-source projects.

The most important transitions in technical writing are as follows:

  • However
  • Therefore
  • For example

For example, in the following passage, notice how the transitions connect and contextualize the sentences:

Juan is a wonderful coder. However, he rarely writes sufficient tests. For example, Juan coded a 5,000 line FFT package that contained only a single 10-line unit test.

Exercise

Fill in the most appropriate transition:

Barbara typically studies problems for a long time before writing the first line of code. _____________, she spontaneously coded a method the other day when she was suddenly inspired.


Next unit: Words

Create a Mobile Website
View Site in Mobile | Classic
Share by: