Comment programming

Comment programming

Comment programming, also known as comment-driven development (CDD) is a software development technique that is based on the regular use of comment tags[1]. In comment programming the comment tags are not used to describe what a certain piece of code is doing, but rather to stop some parts of the code from being executed. The aim is to have the commented code at the developer's disposal at any time he might need it. This is especially useful when the requirements change rapidly. In this case they happen to revert to older versions of themselves, thus making the programmer either write the code again, or revert parts of the code from the versioning repository, which would be more time-consuming. With comment programming, when such a request for reverting to an old implementation arises, the developer just comments the current implementation and uncomments the previous. It is advisable to add short descriptive comments to blocks of commented code.

Practical uses

This programming process can be used for prototyping a new design pattern. This is done by creating a new structure of classes without any implementation, and then you can add the implementation later.

Pseudocode Example:

function onClick()
{
   // this is where we handle mouse click
   // the result of this function is that a button will be highlighted
}

As you can see in the example, there is a structure around a click event handler. However, comment programming is used instead of a real implementation. The idea is that many functions can be written like this, and then the design can be reworked and revisited without having to refactor a lot of source code.

Popular culture

MSDN Sweden produced a video for April 1st 2010, where they presented CDD as a serious methodology.[2]

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Comment (computer programming) — For comments in Wikipedia markup, see Help:Wiki markup#Character formatting and WP:COMMENT. An illustration of Java source code with prologue comments indicated in red and inline comments in green. Program code is in blue …   Wikipedia

  • Comment (computing) — In computing, a comment is information in a file that is primarily intended as an annotation. The structure, scope and processing applied to this information depends on the syntax and conventions used to describe the information contained in the… …   Wikipedia

  • Comment — For comments in Wikipedia markup, see Help:Wiki markup#Invisible text (comments) and WP:COMMENT. A comment is generally a verbal or written remark often related to an added piece of information, or an observation or statement. These are usually… …   Wikipedia

  • Comment out — In computer programming, source code may be disabled by commenting out any given section of the code. This method is available in programming languages, markup languages, configuration files and other media that support comments. The term is also …   Wikipedia

  • Comparison of programming languages (syntax) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • Comparison of programming languages (basic instructions) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • Event-driven programming — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computin …   Wikipedia

  • C Sharp (programming language) — The correct title of this article is C# (programming language). The substitution or omission of the # sign is because of technical restrictions. C# Paradigm(s) multi paradigm: structured, imperative …   Wikipedia

  • Curl (programming language) — Curl Paradigm(s) multi paradigm: object oriented, markup Appeared in 1998 Designed by Steve Ward, MIT Developer …   Wikipedia

  • Criticism of the APL programming language — The APL programming language has been used since the mid 1960s on mainframe computers and has itself evolved in step with computers and the computing market. APL is not widely used, but minimalistic and high level by design, at several points in… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”