正在加载图片...
26 A sense of style mplementing the object-oriented method requires paying attention to many details of style,which a less ambitious approach might consider trifles. 26.1 COSMETICS MATTERS! Although the rules appearing hereafter are not as fundamental as the principles of object- oriented software construction covered in earlier chapters,it would be foolish to dismiss them as just"cosmetics".Good software is good in the large and in the small,in its high- level architecture and in its low-level details.True,quality in the details does not guarantee quality of the whole;but sloppiness in the details usually indicates that something more serious is wrong too.(If you cannot get the cosmetics right,why should your customers believe that you can master the truly difficult aspects?)A serious engineering process requires doing everything right:the grandiose and the mundane So you should not neglect the relevance of such seemingly humble details as text layout and choice of names.True,it may seem surprising to move on,without lowering our level of attention,from the mathematical notion of sufficient completeness in formal specifications (in the chapter on abstract data types)to whether a semicolon should be preceded by a space (in the present chapter).The explanation is simply that both issues deserve our care,in the same way that when you write quality O-O software both the design and the realization will require your attention. We can take a cue from the notion of style in its literary sense.Although the first determinant of good writing is the author's basic ability to tell a story and devise a coherent structure,no text is successful until everything works:every paragraph,every sentence and every word. Applying the rules in practice Some of the rules of this chapter can be checked or,better yet,enforced from the start by software tools.Tools will not do everything,however,and there is no substitute for care in writing every piece of the software.26 A sense of style Implementing the object-oriented method requires paying attention to many details of style, which a less ambitious approach might consider trifles. 26.1 COSMETICS MATTERS! Although the rules appearing hereafter are not as fundamental as the principles of object￾oriented software construction covered in earlier chapters, it would be foolish to dismiss them as just “cosmetics”. Good software is good in the large and in the small, in its high￾level architecture and in its low-level details. True, quality in the details does not guarantee quality of the whole; but sloppiness in the details usually indicates that something more serious is wrong too. (If you cannot get the cosmetics right, why should your customers believe that you can master the truly difficult aspects?) A serious engineering process requires doing everything right: the grandiose and the mundane. So you should not neglect the relevance of such seemingly humble details as text layout and choice of names. True, it may seem surprising to move on, without lowering our level of attention, from the mathematical notion of sufficient completeness in formal specifications (in the chapter on abstract data types) to whether a semicolon should be preceded by a space (in the present chapter). The explanation is simply that both issues deserve our care, in the same way that when you write quality O-O software both the design and the realization will require your attention. We can take a cue from the notion of style in its literary sense. Although the first determinant of good writing is the author’s basic ability to tell a story and devise a coherent structure, no text is successful until everything works: every paragraph, every sentence and every word. Applying the rules in practice Some of the rules of this chapter can be checked or, better yet, enforced from the start by software tools. Tools will not do everything, however, and there is no substitute for care in writing every piece of the software
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有