cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
503 stars 82 forks source link

Typo in 4.4: The Slice Type #149

Closed acconway1 closed 5 months ago

acconway1 commented 6 months ago

The second paragraph begins: 'To motivate why slices are useful, let's work through a small programming problem: write a function that takes a string of words separated by spaces and returns the first word it finds in that string."

It should read: 'To illustrate why slices . . ."

willcrichton commented 5 months ago

I think motivate is an acceptable phrasing here, certainly not a typo.

acconway1 commented 5 months ago

I think motivate is an acceptable phrasing here, certainly not a typo.

I don't mean to be rude, but is English your second language? "Motivate" is a jarringly awkward word to use in that sentence. "Demonstrate" or "illustrate" would be clearer. I cannot find a dictionary definition of "motivate" that accords with your usage.

willcrichton commented 5 months ago

I'm a native English speaker. I have seen motivate used in this context dozens of times, and it makes intuitive sense to me — the motivation for a language feature is the purpose of the feature. You often see design documents with a section titled "Motivation".

acconway1 commented 5 months ago

Thank you for your response and for explaining your perspective on the use of "motivate."

The distinction here lies between the use of "motivation" as a noun (nominalization) and "to motivate" as a verb in the context you've presented. In design documents, as you rightly pointed out, sections titled "Motivation" are common. This nominalized form ("Motivation") serves as a label for a section where the purpose, rationale, or driving force behind a design decision is explained. It's a concise way to introduce the reasons why certain features or approaches were adopted.

However, in the sentence “To motivate why slices are useful, let's work through a small programming problem", the verb form "to motivate" is used differently. In standard usage, "to motivate" generally means "to provide with a motive," or "to incite to action." It implies an act of encouragement or stimulation. This usage does not align precisely with the intent in your sentence, which is more about demonstrating or exemplifying a concept rather than stimulating or encouraging it.

In the context of your sentence, verbs like "demonstrate" or "illustrate" are more apt because they directly refer to the act of making something clear by giving examples. "To demonstrate" means to show clearly and deliberately, and "to illustrate" means to make something clear by giving examples. Both verbs directly align with the action of using a programming problem to clarify why slices are useful.

While "motivate" in your sentence is not grammatically incorrect, it's a odd choice that will prompt readers (like myself) to pause and consider its meaning, potentially distracting from the clear conveyance of the technical concept. A lot of beginners struggle with 'slices' and the different types of strings in Rust . . . so clarity and ease of understanding are important, where the primary goal is to convey complex information in an accessible way. Opting for "demonstrate" or "illustrate" aligns more directly with this goal, ensuring that readers immediately grasp the intended action without needing to interpret an unconventional verb usage.