问题 单项选择题

下列关于源程序文档化的说法不适宜的是______。

A.变量的定义要有明确的意义

B.程序代码的注释可以随意放置

C.根据代码层次进行不同的缩进

D.序言性注释关注的问题比较全面

答案

参考答案:B

解析:[分析] 源程序文档化是改善程序设计风格的重要举措。它包括符号名的命名要含义明确;程序中要添加必要的注释;程序的代码要层次分明,清晰明了,满足视觉要求。注释一般分为序言性注释和功能性注释。序言性注释通常位于程序的开头部分,它给出程序的整体说明,主要描述内容可以包括:程序标题、程序功能说明、主要算法、接口说明、程序位置、开发简历、程序设计者、复审者、复审日期、修改日期等。功能性注释一般嵌在源程序体之中,主要描述其后的语句或程序的功能。

单项选择题

In the absence of optimism, we are left with nothing but critics, naysayers, and prophets of doom. When a nation expects the worst from its people and institutions, and its experts focus exclusively on faults, hope dies. Too many people spend too much tie looking down rather than up, finding fault with their country’s political institutions, economic system, educational establishment, religious organizations, and—worst of all—with each other.

Faultfinding expends so much negative energy that nothing is left over for positive action. It takes courage and strength to solve the genuine problems that afflict every society. Sure, there well always be things that need fixing. But the question is, do you want to spend your time and energy tearing things down or building them up

The staging of a Broadway show could illustrate my point. Let’s say a new production is about to open. A playwright has polished the script, investor have put up the money, and the theater has been rented. A director has been chosen, actors have been auditioned and selected, and the cast has been rehearsing for weeks. Set, lighting, and sound engineers have been hard at work. By the time opening night arrives, nearly a hundred people have labored tirelessly—all working long hours to make magic for their audience.

On opening night, four or five critics sit in the audience. If they pan it, the play will probably close in a matter of days or weeks. If they praise it, the production could go on for a long and successful run. In the end, success or failure might hinge on the opinion of a single person—someone who might be in a bad mood on opening night! What’s wrong with this scene In one sense, nothing. Critics have a legitimate role. The problem arises when we make critics our heroes or put them in control of our fate. When we empower the critic more than the playwright, something is wrong. It is much easier to criticize than to create. When we revere the critics of society, we eventually become a society of critics, and when that happens, there is no room left for constructive optimism.

Compared with the playwrights, the critics are, according to the author, ().

A. pretentious rather than honest

B. arrogant rather than modest

C. cruel rather than merciful

D. destructive rather than constructive

判断题