What is the problem with using natural language to represent algorithms?
What will be an ideal response?
Natural language can be extremely verbose, causing the resulting algorithms to be rambling, unstructured, and hard to follow. An unstructured, "free-flowing" writing style might be wonderful for novels and essays, but it is horrible for algorithms. The lack of structure makes it difficult for the reader to locate specific sections of the algorithm because they are buried inside the text. For example, without any clues to guide us, such as indentation, line numbering, or highlighting, locating the beginning of a loop can be a daunting and time-consuming task. A second problem is that natural language is too "rich" in interpretation and meaning. Natural language frequently relies on either context or a reader's experiences to give precise meaning to a word or phrase. This permits different readers to interpret the same sentence in totally different ways. This may be acceptable, even desirable, when writing poetry or fiction, but it is disastrous when creating algorithms that must always execute in the same way and produce identical results.
You might also like to view...
When an element is added to a queue, it is added to the rear. When an element is removed, it is removed from the
A) rear. B) middle. C) front. D) All of the above E) None of the above A
IntStream method ________ performs the count, min, max, sum and average operations in one pass of an IntStream’s elements and returns the results as an IntSummaryStatistics object (package java.util).
a. allStatistics. b. completeStatistics. c. entireStatistics. d. summaryStatistics
Conditional formatting is a selected format that is applied if a criterion is met
Indicate whether the statement is true or false
Character spacing is a font effect that ________
A) increases or decreases the spacing to the right or left of a line of text B) increases or decreases the distance between letters in a word C) increases or decreases the spacing above or below a line of text D) increases or decreases the height of characters