c# upc-a C++ Example of Differentiating Between Major and Minor Comments with Underlines Not Recommended in C#

Create UPC - 13 in C# C++ Example of Differentiating Between Major and Minor Comments with Underlines Not Recommended

C++ Example of Differentiating Between Major and Minor Comments with Underlines Not Recommended
Generate EAN-13 In Visual C#.NET
Using Barcode creator for .NET Control to generate, create European Article Number 13 image in .NET applications.
www.OnBarcode.com
EAN13 Recognizer In Visual C#
Using Barcode decoder for VS .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
// copy the string portion of the table, along the way omitting // strings that are to be deleted //-------------------------------------------------------------------------// determine number of strings in the table
Barcode Creator In Visual C#.NET
Using Barcode printer for VS .NET Control to generate, create bar code image in VS .NET applications.
www.OnBarcode.com
Bar Code Recognizer In C#.NET
Using Barcode scanner for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
8 The major comment is underlined. A minor comment that is part major comment isn t underlined here...
Painting UPC - 13 In .NET
Using Barcode creator for ASP.NET Control to generate, create EAN 13 image in ASP.NET applications.
www.OnBarcode.com
Generating UPC - 13 In .NET Framework
Using Barcode encoder for .NET framework Control to generate, create European Article Number 13 image in Visual Studio .NET applications.
www.OnBarcode.com
2 of the action described by the
EAN13 Encoder In VB.NET
Using Barcode printer for Visual Studio .NET Control to generate, create EAN 13 image in Visual Studio .NET applications.
www.OnBarcode.com
Making Barcode In Visual C#
Using Barcode generation for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
www.OnBarcode.com
// mark the strings to be deleted
Create Matrix Barcode In Visual C#
Using Barcode generator for Visual Studio .NET Control to generate, create Matrix 2D Barcode image in .NET applications.
www.OnBarcode.com
UPC-A Supplement 2 Encoder In Visual C#
Using Barcode encoder for .NET framework Control to generate, create UPC A image in .NET framework applications.
www.OnBarcode.com
6 ...or here.
Generating Code 3/9 In C#.NET
Using Barcode creation for VS .NET Control to generate, create Code 3/9 image in Visual Studio .NET applications.
www.OnBarcode.com
Drawing Code11 In Visual C#
Using Barcode maker for VS .NET Control to generate, create USD - 8 image in VS .NET applications.
www.OnBarcode.com
de Complete
Drawing Bar Code In Objective-C
Using Barcode drawer for iPhone Control to generate, create barcode image in iPhone applications.
www.OnBarcode.com
Generating GS1-128 In None
Using Barcode maker for Software Control to generate, create GS1 128 image in Software applications.
www.OnBarcode.com
32. Self-Documenting Code
Barcode Drawer In None
Using Barcode generator for Excel Control to generate, create barcode image in Office Excel applications.
www.OnBarcode.com
Making Quick Response Code In None
Using Barcode printer for Online Control to generate, create QR Code 2d barcode image in Online applications.
www.OnBarcode.com
Page 25
Creating PDF-417 2d Barcode In VB.NET
Using Barcode drawer for .NET framework Control to generate, create PDF 417 image in .NET framework applications.
www.OnBarcode.com
Draw Denso QR Bar Code In .NET
Using Barcode drawer for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
www.OnBarcode.com
The weakness of this approach is that it forces you to underline more comments than you d really like to. If you underline a comment, it s assumed that all the nonunderlined comments that follow it are subordinate to it. Consequently, when you write the first comment that isn t subordinate to the underlined comment, it too must be underlined and the cycle starts all over. The result is too much underlining, or inconsistently underlining in some places and not underlining in others. This theme has several variations that all have the same problem. If you put the major comment in all caps and the minor comments in lowercase, you substitute the problem of too many all-caps comments for the problem of too many underlined comments. Some programmers use an initial cap on major statements and no initial cap on minor ones, but that s a subtle visual cue that s too easily overlooked. A better approach is to use ellipses in front of the minor comments. Here s an example:
Painting Code 39 In VB.NET
Using Barcode generation for VS .NET Control to generate, create Code 3/9 image in .NET framework applications.
www.OnBarcode.com
Barcode Maker In Java
Using Barcode encoder for Android Control to generate, create barcode image in Android applications.
www.OnBarcode.com
C++ Example of Differentiating Between Major and Minor Comments with Ellipses
The major comment is formatted normally. A minor comment that is part major comment is preceded by an ellipsis here...
... // copy the string portion of the table, along the way omitting // strings that are to be deleted // ... determine number of strings in the table
2 of the action described by the
// ... mark the strings to be deleted
6 ...and here.
Another approach that s often best is to put the major-comment operation into its own routine. Routines should be logically flat, with all their activities on about the same logical level. If your code differentiates between major and minor activities within a routine, the routine isn t flat. Putting the complicated group of activities into its own routine makes for two logically flat routines instead of one logically lumpy one. This discussion of major and minor comments doesn t apply to indented code within loops and conditionals. In such cases, you ll often have a broad comment at the top of the loop and more detailed comments about the operations within the indented code. In those cases, the indentation provides the clue to the logical
de Complete
32. Self-Documenting Code
Page 26
organization of the comments. This discussion applies only to sequential paragraphs of code in which several paragraphs make up a complete operation and some paragraphs are subordinate to others.
Comment anything that gets around an error or an undocumented feature in a language or an environment If it s an error, it probably isn t documented. Even if it s documented somewhere, it doesn t hurt to document it again in your code. If it s an undocumented feature, by definition it isn t documented elsewhere, and it should be documented in your code.
Suppose you find that the library routine WriteData( data, numItems, blockSize ) works properly except when blockSize equals 500. It works fine for 499, 501, and every other value you ve ever tried, but you have found that the routine has a defect that appears only when blockSize equals 500. In code that uses WriteData(), document why you re making a special case when blockSize is 500. Here s an example of how it could look:
Java Example of Documenting the Workaround for an Error
blockSize = optimalBlockSize( numItems, sizePerItem ); /* The following code is necessary to work around an error in WriteData() that appears only when the third parameter equals 500. '500' has been replaced with a named constant for clarity. */ if ( blockSize == WRITEDATA_BROKEN_SIZE ) { blockSize = WRITEDATA_WORKAROUND_SIZE; } WriteData ( file, data, blockSize );
Justify violations of good programming style If you ve had to violate good programming style, explain why. That will prevent a well-intentioned programmer from changing the code to a better style, possibly breaking your code. The explanation will make it clear that you knew what you were doing and weren t just sloppy give yourself credit where credit is due! Don t comment tricky code Here s a comment from a project I worked on:
Copyright © OnBarcode.com . All rights reserved.