Changes

Jump to: navigation, search

Commenting Objective-C Code

57 bytes added, 14:47, 12 November 2009
no edit summary
There is an old saying amongst veteran programmers that goes something like "Don't comment bad code, re-write it!". Before exploring what these seasoned programmers are really saying, it is important to understand what comments areand why we should use them== Why Comment your Code? ==
Comments in both programming and scripting languages provide a mechanism for the developer to write notes that are ignored by the compiler or interpreter. These notes are intended solely for either the developer or anyone else who may later need to modify the code. The main purpose of comments, therefore, is to allow the developer to make notes that help anyone who may read the code later to understand issues such as how a particular section of a program works, what a particular method does or what a variable is used to store. Commenting code is considered to be good practice. Rest assured that a section of Objective-C code that seems obvious when you write it will often be confusing when you return to it months, or even years later to modify it. By including explanatory comments alongside the code this becomes less of a problem.

Navigation menu