<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Veovis</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Veovis"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Veovis"/>
	<updated>2026-09-15T16:12:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26633</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26633"/>
		<updated>2009-11-11T00:53:55Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Whitespace Whitespace] ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names ''userIdentifcationValue'' and ''userID'' are both fairly descriptive but ''userID'' is shorter and easier to type and is just as clear as ''userIdentifcationValue''.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good [http://en.wikipedia.org/wiki/Object_oriented object oriented] design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the details of drawing lines.  The extra code makes it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and makes it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26632</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26632"/>
		<updated>2009-11-11T00:53:34Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Whitespace Whitespace] ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but ''userID'' is shorter and easier to type and is just as clear as ''userIdentifcationValue''.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good [http://en.wikipedia.org/wiki/Object_oriented object oriented] design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the details of drawing lines.  The extra code makes it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and makes it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26630</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26630"/>
		<updated>2009-11-11T00:52:36Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Code Structure and Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Whitespace Whitespace] ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good [http://en.wikipedia.org/wiki/Object_oriented object oriented] design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the details of drawing lines.  The extra code makes it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and makes it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26628</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26628"/>
		<updated>2009-11-11T00:50:55Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Whitespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Whitespace Whitespace] ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good [http://en.wikipedia.org/wiki/Object_oriented object oriented] design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26627</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26627"/>
		<updated>2009-11-11T00:50:17Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Code Structure and Comments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good [http://en.wikipedia.org/wiki/Object_oriented object oriented] design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26620</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26620"/>
		<updated>2009-11-11T00:41:57Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Conventions and Style Guides */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [http://www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26619</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26619"/>
		<updated>2009-11-11T00:41:37Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions and Style Guides ==&lt;br /&gt;
&lt;br /&gt;
''' C/C++ '''&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/aa260976(VS.60).aspx Hungarian Notation]&lt;br /&gt;
* [http://geosoft.no/development/cppstyle.html C++ Programming Style Guidelines]&lt;br /&gt;
&lt;br /&gt;
''' C# '''&lt;br /&gt;
* [www.sourceformat.com/pdf/cs-coding-standard-bellware.pdf C# Code Style Guide]&lt;br /&gt;
&lt;br /&gt;
''' Java '''&lt;br /&gt;
* [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html Code Conventions for the Java Programming Language]&lt;br /&gt;
&lt;br /&gt;
''' Perl '''&lt;br /&gt;
* [http://www.perl.com/doc/manual/html/pod/perlstyle.html Perl style guide ]&lt;br /&gt;
&lt;br /&gt;
''' PHP '''&lt;br /&gt;
* [http://wshell.wordpress.com/2009/10/02/ PHP Good Practices 1 – Naming Conventions]&lt;br /&gt;
&lt;br /&gt;
''' Ruby '''&lt;br /&gt;
* [http://www.caliban.org/ruby/rubyguide.shtml The Unofficial Ruby Usage Guide]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26614</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26614"/>
		<updated>2009-11-11T00:33:40Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g(m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex(m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26613</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26613"/>
		<updated>2009-11-11T00:32:43Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g( m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex( &lt;br /&gt;
				m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26612</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26612"/>
		<updated>2009-11-11T00:30:46Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Naming Convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void ML::d(const Canvas *vc,&lt;br /&gt;
					TS* ts, &lt;br /&gt;
					PointType tb,&lt;br /&gt;
					PointType to,&lt;br /&gt;
					RectangleType dr)&lt;br /&gt;
{&lt;br /&gt;
	Int16 sdx = dr.tl.x - to.x; &lt;br /&gt;
	Int16 sdy = dr.tl.y - to.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tb.x; x &amp;lt; m_ms.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tb.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			T* t = ts-&amp;gt;g( m_lb[(x * m_ms.y) + y]);&lt;br /&gt;
			if(t) &lt;br /&gt;
				t-&amp;gt;d(vc, sdx, sdy);&lt;br /&gt;
			&lt;br /&gt;
			sdy += ts-&amp;gt;gh();&lt;br /&gt;
			&lt;br /&gt;
			if(sdy &amp;gt;= dr.tl.y + dr.e.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		sdy = dr.tl.y - to.y;&lt;br /&gt;
		sdx += ts-&amp;gt;gw();&lt;br /&gt;
		&lt;br /&gt;
		if(sdx &amp;gt;= dr.tl.x + dr.e.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MapLayer::draw(const Canvas *viewportCanvas,&lt;br /&gt;
					TileSet* tset, &lt;br /&gt;
					PointType tileBegin,&lt;br /&gt;
					PointType tileOffset,&lt;br /&gt;
					RectangleType drawRect)&lt;br /&gt;
{&lt;br /&gt;
	Int16 screenDrawX = drawRect.topLeft.x - tileOffset.x; &lt;br /&gt;
	Int16 screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
&lt;br /&gt;
	for(UInt16 x = tileBegin.x; x &amp;lt; m_mapSize.x; x++)&lt;br /&gt;
	{&lt;br /&gt;
		for(UInt16 y = tileBegin.y; y &amp;lt; m_mapSize.y; y++)&lt;br /&gt;
		{&lt;br /&gt;
			Tile* tile = tset-&amp;gt;getTileAtIndex( m_layerBytes[(x * m_mapSize.y) + y]);&lt;br /&gt;
			if(tile) &lt;br /&gt;
				tile-&amp;gt;draw(viewportCanvas, screenDrawX, screenDrawY);&lt;br /&gt;
			&lt;br /&gt;
			screenDrawY += tset-&amp;gt;getTileHeight();&lt;br /&gt;
			&lt;br /&gt;
			if(screenDrawY &amp;gt;= drawRect.topLeft.y + drawRect.extent.y)&lt;br /&gt;
				break;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		screenDrawY = drawRect.topLeft.y - tileOffset.y;&lt;br /&gt;
		screenDrawX += tset-&amp;gt;getTileWidth();&lt;br /&gt;
		&lt;br /&gt;
		if(screenDrawX &amp;gt;= drawRect.topLeft.x + drawRect.extent.x)&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26609</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26609"/>
		<updated>2009-11-11T00:19:50Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Whitespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {return;}&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// only draw if we have good values&lt;br /&gt;
if (Double.isNaN(transX0) || Double.isNaN(transY0)&lt;br /&gt;
    || Double.isNaN(transX1) || Double.isNaN(transY1)) {&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// create a line to use to determine where the threshold is crossed&lt;br /&gt;
Line2D.Double tline = new Line2D.Double();&lt;br /&gt;
&lt;br /&gt;
if (orientation == PlotOrientation.HORIZONTAL)&lt;br /&gt;
    tline.setLine(threshY0,threshX0,threshY1,threshX1);&lt;br /&gt;
else if (orientation == PlotOrientation.VERTICAL)&lt;br /&gt;
    tline.setLine(threshX0,threshY0,threshX1,threshY1);&lt;br /&gt;
&lt;br /&gt;
// calculate the point where the threshold is crossed&lt;br /&gt;
Point2D.Double tintersect = lineIntersection(tline,state.workingLine);&lt;br /&gt;
if (tintersect == null)&lt;br /&gt;
    return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second example is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26608</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26608"/>
		<updated>2009-11-11T00:17:00Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD CODE EXAMPLE]&lt;br /&gt;
[GOOD CODE EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
Example B is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), &lt;br /&gt;
			tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), &lt;br /&gt;
			transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26607</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26607"/>
		<updated>2009-11-11T00:15:26Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD CODE EXAMPLE]&lt;br /&gt;
[GOOD CODE EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
Example B is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
''' Example 1 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), tintersect.getY());&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(thresholdPaint));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), transX1, transY1);&lt;br /&gt;
		g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
		g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
		g2.draw(shape);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' Example 2 '''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected void drawLine() {&lt;br /&gt;
	// ** SNIP **&lt;br /&gt;
&lt;br /&gt;
	// determine whether the line starts above or below the threshold&lt;br /&gt;
	if (y1&amp;gt;y0) {&lt;br /&gt;
		// line starts below the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		// line starts above the threshold&lt;br /&gt;
		state.workingLine.setLine(transX0, transY0, tintersect.getX(), tintersect.getY());&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, true);&lt;br /&gt;
&lt;br /&gt;
		state.workingLine.setLine(tintersect.getX(), tintersect.getY(), transX1, transY1);&lt;br /&gt;
		drawFirstPassShape(g2, pass, series, item, state.workingLine, false);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
protected void drawFirstPassShape(Graphics2D g2, int pass, int series,&lt;br /&gt;
                                  int item, Shape shape, boolean overthreshold) {&lt;br /&gt;
    g2.setStroke(getItemStroke(series, item));&lt;br /&gt;
    &lt;br /&gt;
    if (overthreshold==true)&lt;br /&gt;
        g2.setPaint(thresholdPaint);&lt;br /&gt;
    else&lt;br /&gt;
        g2.setPaint(getItemPaint(series, item));&lt;br /&gt;
        &lt;br /&gt;
    g2.draw(shape);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26606</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26606"/>
		<updated>2009-11-11T00:13:29Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Self-Documenting Code'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD CODE EXAMPLE]&lt;br /&gt;
[GOOD CODE EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
Example B is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26603</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 13 is</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_13_is&amp;diff=26603"/>
		<updated>2009-11-11T00:12:19Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Self-Documenting Code =&lt;br /&gt;
== Introduction ==&lt;br /&gt;
One of the characteristics of elegant, well-designed code is that it should be easy for someone to read the code and understand exactly what the code does.  It should be possible to understand the code by using the names and comments within the code without needing any additional documentation.  Source code that is easy to read and understand is known as self-documenting code.&lt;br /&gt;
&lt;br /&gt;
There are numerous advantages to self-documenting code.  One of the biggest advantages is the fact that it is often quite easy to maintain or extend code that is self-documenting.  Another advantage is the fact that it is not essential to have external sources of documentation to understand how the code works.  Self-documentation can also help prevent certain types of bugs or defects from being introduced in the code due to the fact that developers usually have a clearer understanding of what the code does.&lt;br /&gt;
&lt;br /&gt;
== Techniques ==&lt;br /&gt;
&lt;br /&gt;
By following a few simple techniques and guidelines developers can produce self-documenting code fairly easily.&lt;br /&gt;
&lt;br /&gt;
=== Whitespace ===&lt;br /&gt;
&lt;br /&gt;
Appropriate use of blank lines between and indentation can greatly improve the readability of source code.  Blank lines should be inserted between logical sections or blocks of code.  In most languages code contained within a block should be indented to make it clear that it is part of a block of code.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD CODE EXAMPLE]&lt;br /&gt;
[GOOD CODE EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
Example B is much easier to read because of the proper use of whitespace.  It is usually best to avoid putting more than one statement of code on a single line unless the statements are very short and very simple.  Long statements can (and should) be broken into multiple lines with indentation to indicate that the additional lines belong to the same statement.&lt;br /&gt;
&lt;br /&gt;
Some languages have style guidelines that describe where and when whitespace should be used, such has which lines of a method should be indented and where block identifiers such as { or } should be located.  Links to style guidelines for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Naming Convention ===&lt;br /&gt;
&lt;br /&gt;
Choosing good names is critical to writing self-documenting code.  In many languages objects, variables, and methods are identified by their name.  Good code uses names that are clear and descriptive.  Descriptive names do not have to be long or verbose and it is often better to use shorter names with logical abbreviations instead of a really long name.  For instance, the variable names “userIdentifcationValue” and “userID” are both fairly descriptive but “userID” is shorter and easier to type and is just as clear as “userIdentifcationValue”.  Bad code uses names that are generic or that provide no indication what the item is used for such as i, j, n, num, r, x, or cv.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
It is very difficult to figure out what the first code section does because none of the variables, objects, or methods have descriptive names.  The second code section uses descriptive names and is much easier to read and understand.&lt;br /&gt;
&lt;br /&gt;
Many programming languages have established naming conventions that are used to distinguish a variable from an object or a method.  It is important for a programmer to follow the established naming convention for the language that he or she is writing in.  Links to naming conventions for various languages are included below.&lt;br /&gt;
&lt;br /&gt;
=== Code Structure and Comments ===&lt;br /&gt;
&lt;br /&gt;
There are often many different ways of writing code to accomplishing a particular task.  Generally a simple approach to a problem produces code that is more readable and easier to understand than a complex solution.  &lt;br /&gt;
&lt;br /&gt;
Some complex algorithms can be greatly simplified by moving pieces of code into separate methods or functions.  Code that has well defined methods generally exhibits good object oriented design in addition to being easier to understand and maintain.  Consider the following examples:&lt;br /&gt;
&lt;br /&gt;
[BAD EXAMPLE]&lt;br /&gt;
[GOOD EXAMPLE]&lt;br /&gt;
&lt;br /&gt;
The first example has a lot of code to handle the process of drawing lines making it harder to understand what else the code is doing.  The second example moves the task of drawing the lines to a separate drawing method which helps simplify the code and make it easier to follow.&lt;br /&gt;
&lt;br /&gt;
Generally the simpler the code is, the easier it is to understand it.  When given the choice between a simple implementation and a complex one the simpler implementation will almost always be easier to debug and maintain.&lt;br /&gt;
&lt;br /&gt;
Some coding problems are very difficult to solve in a straightforward, easy to understand manner.  In these situations it is important to thoroughly document the code with comments that explain exactly what is being done and how.  In some cases it is also a good idea to include comments that describe why the section was implemented the way it is.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22541</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 7 ov</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22541"/>
		<updated>2009-10-07T13:36:59Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Ruby - Mixins and Modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Survey of Language Features for Code Reuse'''&lt;br /&gt;
&lt;br /&gt;
== Direct inclusion ==&lt;br /&gt;
Code can be reused by simply storing it in a defined location and allowing a compiler or preprocessor to insert a copy of the code whenever it is referenced.  This is the simplest form of code reuse and is present in many languages.&lt;br /&gt;
&lt;br /&gt;
=== Assembly Language - Macros ===&lt;br /&gt;
&lt;br /&gt;
Many assemblers have support for macros.  A macro is a block of code that can be called from any location in the program.  A macro can contain any number of instructions and is given a unique name.  Some assemblers also support passing various parameters to a macro which can be inserted into the code block contained in the macro.&lt;br /&gt;
&lt;br /&gt;
Within a program the assembler replaces all references to the macro's name with the block of code that the macro represents.  Essentially macros allow the programmer to give a chunk of code a name and then use it multiple times within a program or even in many programs.&lt;br /&gt;
&lt;br /&gt;
=== C/C++ - Includes ===&lt;br /&gt;
&lt;br /&gt;
The languages C and C++ had a directive named #include which instructs the compiler to insert the contents of a file into the current source file.  Typically a program will use this feature to allow certain functions and macros to be used within multiple source files or in multiple programs.&lt;br /&gt;
&lt;br /&gt;
Used in this way, the [http://en.wikipedia.org/wiki/Function_prototype prototype] for a function would be placed in a file and the file that includes the source code to the function and any file that contains source code using the function will use #include to reference the file containing the function prototype.  This allows the compiler to reference the source code to the function wherever it happens to be called.&lt;br /&gt;
&lt;br /&gt;
=== Ruby - Mixins and Modules ===&lt;br /&gt;
&lt;br /&gt;
Ruby has several different features that can be used individually or together to allow a programmer to reuse sections of code.  One such feature is known as a module.  A module contains a block of code and places it underneath a defined name (or namespace).  Variables, classes, and functions within a module can be used by referencing the module name followed by a . and then the name of the item in the module.&lt;br /&gt;
&lt;br /&gt;
For instance, if there is a module named Square which contains a function called draw it can be called by writing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Square.draw()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If a module is referenced within a class definition that module is often referred to as a mixin.  Any functions or variables that are defined in the module can be used within the class just as if it was defined directly within the class.  For instance a module may define methods that are used in several different classes.  Each class that needs one of the methods in the module can include the module as a mixin.&lt;br /&gt;
&lt;br /&gt;
A module can be referenced in a class or program by using either the load or require statements.  If the load statement is used the module will be coped into the location of the statement much like an Assembly language macro or a C or C++ include.  &lt;br /&gt;
&lt;br /&gt;
If the require statement is used then only one copy of the module is loaded into memory.  If the module is changed during runtime all parts of the program using that module see the change immediately since they are all using the same chunk of code in memory.&lt;br /&gt;
&lt;br /&gt;
Because of this property modules in Ruby can act like a direct inclusion or a collection of classes.&lt;br /&gt;
&lt;br /&gt;
== Collections of Classes ==&lt;br /&gt;
In some object oriented languages code can be reused by grouping certain classes together under a single name.  These collections are known by different names in different languages but they all typically provide a way to reference a particular class within a collection even if a class with the same name may be found in a different collection.&lt;br /&gt;
&lt;br /&gt;
=== Java - Packages ===&lt;br /&gt;
&lt;br /&gt;
Java allows [http://en.wikipedia.org/wiki/Class_(computer_science) classes] to be grouped into a collection known as a package.  A program can then reference the package and use the classes defined within it or reference a particular class in a package.&lt;br /&gt;
&lt;br /&gt;
Each package is given a unique name and each class in a package can be referenced by giving the name of the package followed by the name of the class like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
java.util.Date somedate = new java.util.Date();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== .NET - Components and Namespaces ===&lt;br /&gt;
&lt;br /&gt;
Microsoft's .NET family of languages allows a class or a group of classes to be compiled into a component.  Components typically need to be compiled into a binary [http://en.wikipedia.org/wiki/Dynamic-link_library DLL] containing [http://en.wikipedia.org/wiki/Common_Language_Runtime CLR] code.&lt;br /&gt;
&lt;br /&gt;
Programs can use a component by adding a reference the DLL containing the component's code .  Classes contained within a component can then be used just as if the classes were defined directly in the program.&lt;br /&gt;
&lt;br /&gt;
The .NET languages also support a feature called [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespaces] which allows classes to be referenced by a fully qualified name much like Ruby's modules or Java packages. For more complicated designs, a namespace can be nested within another namespace like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namespace Shape&lt;br /&gt;
{&lt;br /&gt;
	namespace TwoDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Square&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public class Circle&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	namespace ThreeDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Cube&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the class Circle could be referenced from another program by placing the Shape namespace into a component and calling:&lt;br /&gt;
&lt;br /&gt;
Shape.TwoDimensional.Circle myCircle = new Shape.TwoDimensional.Circle();&lt;br /&gt;
&lt;br /&gt;
== Comparison == &lt;br /&gt;
&lt;br /&gt;
Languages that use a form of direct inclusion often make it very easy to reuse any particular block of code in multiple applications or even within the same application.  The principal is a very simple one and is usually quite easy to implement in any given language.  However, most forms of direct inclusion do not provide a way to avoid conflicts when multiple variables, functions, routines, classes, or methods share the same name.&lt;br /&gt;
&lt;br /&gt;
Languages that group classes into self-contained collections provide a fairly elegant way to avoid name collisions because each class can be referenced using a fully qualified name that includes the name of the collection it is in.  They may not be quite as simple or as easy to use as most forms of direct inclusion but the ability to avoid namespace collisions is often worth it.  It is also often easier to determine which collection/package/component a class belongs to than it is to determine which included file contains the class in a direct inclusion system which can aid in debugging and troubleshooting problems.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Assembly_language#Macros Assembly language]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Header_file Header file]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx The #include Directive]&lt;br /&gt;
&lt;br /&gt;
* [http://www.rubycentral.com/pickaxe/tut_modules.html Programming Ruby Modules and Mixins]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Java_package Java package]&lt;br /&gt;
&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ms973807.aspx Creating Components in .NET]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespace (C# Reference)]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22540</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 7 ov</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22540"/>
		<updated>2009-10-07T13:36:48Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Java - Packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Survey of Language Features for Code Reuse'''&lt;br /&gt;
&lt;br /&gt;
== Direct inclusion ==&lt;br /&gt;
Code can be reused by simply storing it in a defined location and allowing a compiler or preprocessor to insert a copy of the code whenever it is referenced.  This is the simplest form of code reuse and is present in many languages.&lt;br /&gt;
&lt;br /&gt;
=== Assembly Language - Macros ===&lt;br /&gt;
&lt;br /&gt;
Many assemblers have support for macros.  A macro is a block of code that can be called from any location in the program.  A macro can contain any number of instructions and is given a unique name.  Some assemblers also support passing various parameters to a macro which can be inserted into the code block contained in the macro.&lt;br /&gt;
&lt;br /&gt;
Within a program the assembler replaces all references to the macro's name with the block of code that the macro represents.  Essentially macros allow the programmer to give a chunk of code a name and then use it multiple times within a program or even in many programs.&lt;br /&gt;
&lt;br /&gt;
=== C/C++ - Includes ===&lt;br /&gt;
&lt;br /&gt;
The languages C and C++ had a directive named #include which instructs the compiler to insert the contents of a file into the current source file.  Typically a program will use this feature to allow certain functions and macros to be used within multiple source files or in multiple programs.&lt;br /&gt;
&lt;br /&gt;
Used in this way, the [http://en.wikipedia.org/wiki/Function_prototype prototype] for a function would be placed in a file and the file that includes the source code to the function and any file that contains source code using the function will use #include to reference the file containing the function prototype.  This allows the compiler to reference the source code to the function wherever it happens to be called.&lt;br /&gt;
&lt;br /&gt;
=== Ruby - Mixins and Modules ===&lt;br /&gt;
&lt;br /&gt;
Ruby has several different features that can be used individually or together to allow a programmer to reuse sections of code.  One such feature is known as a module.  A module contains a block of code and places it underneath a defined name (or namespace).  Variables, classes, and functions within a module can be used by referencing the module name followed by a . and then the name of the item in the module.&lt;br /&gt;
&lt;br /&gt;
For instance, if there is a module named Square which contains a function called draw it can be called by writing:&lt;br /&gt;
&lt;br /&gt;
Square.draw()&lt;br /&gt;
&lt;br /&gt;
If a module is referenced within a class definition that module is often referred to as a mixin.  Any functions or variables that are defined in the module can be used within the class just as if it was defined directly within the class.  For instance a module may define methods that are used in several different classes.  Each class that needs one of the methods in the module can include the module as a mixin.&lt;br /&gt;
&lt;br /&gt;
A module can be referenced in a class or program by using either the load or require statements.  If the load statement is used the module will be coped into the location of the statement much like an Assembly language macro or a C or C++ include.  &lt;br /&gt;
&lt;br /&gt;
If the require statement is used then only one copy of the module is loaded into memory.  If the module is changed during runtime all parts of the program using that module see the change immediately since they are all using the same chunk of code in memory.&lt;br /&gt;
&lt;br /&gt;
Because of this property modules in Ruby can act like a direct inclusion or a collection of classes.&lt;br /&gt;
&lt;br /&gt;
== Collections of Classes ==&lt;br /&gt;
In some object oriented languages code can be reused by grouping certain classes together under a single name.  These collections are known by different names in different languages but they all typically provide a way to reference a particular class within a collection even if a class with the same name may be found in a different collection.&lt;br /&gt;
&lt;br /&gt;
=== Java - Packages ===&lt;br /&gt;
&lt;br /&gt;
Java allows [http://en.wikipedia.org/wiki/Class_(computer_science) classes] to be grouped into a collection known as a package.  A program can then reference the package and use the classes defined within it or reference a particular class in a package.&lt;br /&gt;
&lt;br /&gt;
Each package is given a unique name and each class in a package can be referenced by giving the name of the package followed by the name of the class like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
java.util.Date somedate = new java.util.Date();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== .NET - Components and Namespaces ===&lt;br /&gt;
&lt;br /&gt;
Microsoft's .NET family of languages allows a class or a group of classes to be compiled into a component.  Components typically need to be compiled into a binary [http://en.wikipedia.org/wiki/Dynamic-link_library DLL] containing [http://en.wikipedia.org/wiki/Common_Language_Runtime CLR] code.&lt;br /&gt;
&lt;br /&gt;
Programs can use a component by adding a reference the DLL containing the component's code .  Classes contained within a component can then be used just as if the classes were defined directly in the program.&lt;br /&gt;
&lt;br /&gt;
The .NET languages also support a feature called [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespaces] which allows classes to be referenced by a fully qualified name much like Ruby's modules or Java packages. For more complicated designs, a namespace can be nested within another namespace like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namespace Shape&lt;br /&gt;
{&lt;br /&gt;
	namespace TwoDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Square&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public class Circle&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	namespace ThreeDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Cube&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the class Circle could be referenced from another program by placing the Shape namespace into a component and calling:&lt;br /&gt;
&lt;br /&gt;
Shape.TwoDimensional.Circle myCircle = new Shape.TwoDimensional.Circle();&lt;br /&gt;
&lt;br /&gt;
== Comparison == &lt;br /&gt;
&lt;br /&gt;
Languages that use a form of direct inclusion often make it very easy to reuse any particular block of code in multiple applications or even within the same application.  The principal is a very simple one and is usually quite easy to implement in any given language.  However, most forms of direct inclusion do not provide a way to avoid conflicts when multiple variables, functions, routines, classes, or methods share the same name.&lt;br /&gt;
&lt;br /&gt;
Languages that group classes into self-contained collections provide a fairly elegant way to avoid name collisions because each class can be referenced using a fully qualified name that includes the name of the collection it is in.  They may not be quite as simple or as easy to use as most forms of direct inclusion but the ability to avoid namespace collisions is often worth it.  It is also often easier to determine which collection/package/component a class belongs to than it is to determine which included file contains the class in a direct inclusion system which can aid in debugging and troubleshooting problems.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Assembly_language#Macros Assembly language]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Header_file Header file]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx The #include Directive]&lt;br /&gt;
&lt;br /&gt;
* [http://www.rubycentral.com/pickaxe/tut_modules.html Programming Ruby Modules and Mixins]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Java_package Java package]&lt;br /&gt;
&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ms973807.aspx Creating Components in .NET]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespace (C# Reference)]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22539</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 7 ov</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22539"/>
		<updated>2009-10-07T13:36:35Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* .NET - Components and Namespaces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Survey of Language Features for Code Reuse'''&lt;br /&gt;
&lt;br /&gt;
== Direct inclusion ==&lt;br /&gt;
Code can be reused by simply storing it in a defined location and allowing a compiler or preprocessor to insert a copy of the code whenever it is referenced.  This is the simplest form of code reuse and is present in many languages.&lt;br /&gt;
&lt;br /&gt;
=== Assembly Language - Macros ===&lt;br /&gt;
&lt;br /&gt;
Many assemblers have support for macros.  A macro is a block of code that can be called from any location in the program.  A macro can contain any number of instructions and is given a unique name.  Some assemblers also support passing various parameters to a macro which can be inserted into the code block contained in the macro.&lt;br /&gt;
&lt;br /&gt;
Within a program the assembler replaces all references to the macro's name with the block of code that the macro represents.  Essentially macros allow the programmer to give a chunk of code a name and then use it multiple times within a program or even in many programs.&lt;br /&gt;
&lt;br /&gt;
=== C/C++ - Includes ===&lt;br /&gt;
&lt;br /&gt;
The languages C and C++ had a directive named #include which instructs the compiler to insert the contents of a file into the current source file.  Typically a program will use this feature to allow certain functions and macros to be used within multiple source files or in multiple programs.&lt;br /&gt;
&lt;br /&gt;
Used in this way, the [http://en.wikipedia.org/wiki/Function_prototype prototype] for a function would be placed in a file and the file that includes the source code to the function and any file that contains source code using the function will use #include to reference the file containing the function prototype.  This allows the compiler to reference the source code to the function wherever it happens to be called.&lt;br /&gt;
&lt;br /&gt;
=== Ruby - Mixins and Modules ===&lt;br /&gt;
&lt;br /&gt;
Ruby has several different features that can be used individually or together to allow a programmer to reuse sections of code.  One such feature is known as a module.  A module contains a block of code and places it underneath a defined name (or namespace).  Variables, classes, and functions within a module can be used by referencing the module name followed by a . and then the name of the item in the module.&lt;br /&gt;
&lt;br /&gt;
For instance, if there is a module named Square which contains a function called draw it can be called by writing:&lt;br /&gt;
&lt;br /&gt;
Square.draw()&lt;br /&gt;
&lt;br /&gt;
If a module is referenced within a class definition that module is often referred to as a mixin.  Any functions or variables that are defined in the module can be used within the class just as if it was defined directly within the class.  For instance a module may define methods that are used in several different classes.  Each class that needs one of the methods in the module can include the module as a mixin.&lt;br /&gt;
&lt;br /&gt;
A module can be referenced in a class or program by using either the load or require statements.  If the load statement is used the module will be coped into the location of the statement much like an Assembly language macro or a C or C++ include.  &lt;br /&gt;
&lt;br /&gt;
If the require statement is used then only one copy of the module is loaded into memory.  If the module is changed during runtime all parts of the program using that module see the change immediately since they are all using the same chunk of code in memory.&lt;br /&gt;
&lt;br /&gt;
Because of this property modules in Ruby can act like a direct inclusion or a collection of classes.&lt;br /&gt;
&lt;br /&gt;
== Collections of Classes ==&lt;br /&gt;
In some object oriented languages code can be reused by grouping certain classes together under a single name.  These collections are known by different names in different languages but they all typically provide a way to reference a particular class within a collection even if a class with the same name may be found in a different collection.&lt;br /&gt;
&lt;br /&gt;
=== Java - Packages ===&lt;br /&gt;
&lt;br /&gt;
Java allows [http://en.wikipedia.org/wiki/Class_(computer_science) classes] to be grouped into a collection known as a package.  A program can then reference the package and use the classes defined within it or reference a particular class in a package.&lt;br /&gt;
&lt;br /&gt;
Each package is given a unique name and each class in a package can be referenced by giving the name of the package followed by the name of the class like this:&lt;br /&gt;
&lt;br /&gt;
java.util.Date somedate = new java.util.Date();&lt;br /&gt;
&lt;br /&gt;
=== .NET - Components and Namespaces ===&lt;br /&gt;
&lt;br /&gt;
Microsoft's .NET family of languages allows a class or a group of classes to be compiled into a component.  Components typically need to be compiled into a binary [http://en.wikipedia.org/wiki/Dynamic-link_library DLL] containing [http://en.wikipedia.org/wiki/Common_Language_Runtime CLR] code.&lt;br /&gt;
&lt;br /&gt;
Programs can use a component by adding a reference the DLL containing the component's code .  Classes contained within a component can then be used just as if the classes were defined directly in the program.&lt;br /&gt;
&lt;br /&gt;
The .NET languages also support a feature called [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespaces] which allows classes to be referenced by a fully qualified name much like Ruby's modules or Java packages. For more complicated designs, a namespace can be nested within another namespace like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namespace Shape&lt;br /&gt;
{&lt;br /&gt;
	namespace TwoDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Square&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public class Circle&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	namespace ThreeDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Cube&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case the class Circle could be referenced from another program by placing the Shape namespace into a component and calling:&lt;br /&gt;
&lt;br /&gt;
Shape.TwoDimensional.Circle myCircle = new Shape.TwoDimensional.Circle();&lt;br /&gt;
&lt;br /&gt;
== Comparison == &lt;br /&gt;
&lt;br /&gt;
Languages that use a form of direct inclusion often make it very easy to reuse any particular block of code in multiple applications or even within the same application.  The principal is a very simple one and is usually quite easy to implement in any given language.  However, most forms of direct inclusion do not provide a way to avoid conflicts when multiple variables, functions, routines, classes, or methods share the same name.&lt;br /&gt;
&lt;br /&gt;
Languages that group classes into self-contained collections provide a fairly elegant way to avoid name collisions because each class can be referenced using a fully qualified name that includes the name of the collection it is in.  They may not be quite as simple or as easy to use as most forms of direct inclusion but the ability to avoid namespace collisions is often worth it.  It is also often easier to determine which collection/package/component a class belongs to than it is to determine which included file contains the class in a direct inclusion system which can aid in debugging and troubleshooting problems.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Assembly_language#Macros Assembly language]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Header_file Header file]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx The #include Directive]&lt;br /&gt;
&lt;br /&gt;
* [http://www.rubycentral.com/pickaxe/tut_modules.html Programming Ruby Modules and Mixins]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Java_package Java package]&lt;br /&gt;
&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ms973807.aspx Creating Components in .NET]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespace (C# Reference)]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22538</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 7 ov</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22538"/>
		<updated>2009-10-07T13:30:15Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Collections of Classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Survey of Language Features for Code Reuse'''&lt;br /&gt;
&lt;br /&gt;
== Direct inclusion ==&lt;br /&gt;
Code can be reused by simply storing it in a defined location and allowing a compiler or preprocessor to insert a copy of the code whenever it is referenced.  This is the simplest form of code reuse and is present in many languages.&lt;br /&gt;
&lt;br /&gt;
=== Assembly Language - Macros ===&lt;br /&gt;
&lt;br /&gt;
Many assemblers have support for macros.  A macro is a block of code that can be called from any location in the program.  A macro can contain any number of instructions and is given a unique name.  Some assemblers also support passing various parameters to a macro which can be inserted into the code block contained in the macro.&lt;br /&gt;
&lt;br /&gt;
Within a program the assembler replaces all references to the macro's name with the block of code that the macro represents.  Essentially macros allow the programmer to give a chunk of code a name and then use it multiple times within a program or even in many programs.&lt;br /&gt;
&lt;br /&gt;
=== C/C++ - Includes ===&lt;br /&gt;
&lt;br /&gt;
The languages C and C++ had a directive named #include which instructs the compiler to insert the contents of a file into the current source file.  Typically a program will use this feature to allow certain functions and macros to be used within multiple source files or in multiple programs.&lt;br /&gt;
&lt;br /&gt;
Used in this way, the [http://en.wikipedia.org/wiki/Function_prototype prototype] for a function would be placed in a file and the file that includes the source code to the function and any file that contains source code using the function will use #include to reference the file containing the function prototype.  This allows the compiler to reference the source code to the function wherever it happens to be called.&lt;br /&gt;
&lt;br /&gt;
=== Ruby - Mixins and Modules ===&lt;br /&gt;
&lt;br /&gt;
Ruby has several different features that can be used individually or together to allow a programmer to reuse sections of code.  One such feature is known as a module.  A module contains a block of code and places it underneath a defined name (or namespace).  Variables, classes, and functions within a module can be used by referencing the module name followed by a . and then the name of the item in the module.&lt;br /&gt;
&lt;br /&gt;
For instance, if there is a module named Square which contains a function called draw it can be called by writing:&lt;br /&gt;
&lt;br /&gt;
Square.draw()&lt;br /&gt;
&lt;br /&gt;
If a module is referenced within a class definition that module is often referred to as a mixin.  Any functions or variables that are defined in the module can be used within the class just as if it was defined directly within the class.  For instance a module may define methods that are used in several different classes.  Each class that needs one of the methods in the module can include the module as a mixin.&lt;br /&gt;
&lt;br /&gt;
A module can be referenced in a class or program by using either the load or require statements.  If the load statement is used the module will be coped into the location of the statement much like an Assembly language macro or a C or C++ include.  &lt;br /&gt;
&lt;br /&gt;
If the require statement is used then only one copy of the module is loaded into memory.  If the module is changed during runtime all parts of the program using that module see the change immediately since they are all using the same chunk of code in memory.&lt;br /&gt;
&lt;br /&gt;
Because of this property modules in Ruby can act like a direct inclusion or a collection of classes.&lt;br /&gt;
&lt;br /&gt;
== Collections of Classes ==&lt;br /&gt;
In some object oriented languages code can be reused by grouping certain classes together under a single name.  These collections are known by different names in different languages but they all typically provide a way to reference a particular class within a collection even if a class with the same name may be found in a different collection.&lt;br /&gt;
&lt;br /&gt;
=== Java - Packages ===&lt;br /&gt;
&lt;br /&gt;
Java allows [http://en.wikipedia.org/wiki/Class_(computer_science) classes] to be grouped into a collection known as a package.  A program can then reference the package and use the classes defined within it or reference a particular class in a package.&lt;br /&gt;
&lt;br /&gt;
Each package is given a unique name and each class in a package can be referenced by giving the name of the package followed by the name of the class like this:&lt;br /&gt;
&lt;br /&gt;
java.util.Date somedate = new java.util.Date();&lt;br /&gt;
&lt;br /&gt;
=== .NET - Components and Namespaces ===&lt;br /&gt;
&lt;br /&gt;
Microsoft's .NET family of languages allows a class or a group of classes to be compiled into a component.  Components typically need to be compiled into a binary [http://en.wikipedia.org/wiki/Dynamic-link_library DLL] containing [http://en.wikipedia.org/wiki/Common_Language_Runtime CLR] code.&lt;br /&gt;
&lt;br /&gt;
Programs can use a component by adding a reference the DLL containing the component's code .  Classes contained within a component can then be used just as if the classes were defined directly in the program.&lt;br /&gt;
&lt;br /&gt;
The .NET languages also support a feature called [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespaces] which allows classes to be referenced by a fully qualified name much like Ruby's modules or Java packages. For more complicated designs, a namespace can be nested within another namespace like this:&lt;br /&gt;
&lt;br /&gt;
namespace Shape&lt;br /&gt;
{&lt;br /&gt;
	namespace TwoDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Square&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public class Circle&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	namespace ThreeDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Cube&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In this case the class Circle could be referenced from another program by placing the Shape namespace into a component and calling:&lt;br /&gt;
&lt;br /&gt;
Shape.TwoDimensional.Circle myCircle = new Shape.TwoDimensional.Circle();&lt;br /&gt;
&lt;br /&gt;
== Comparison == &lt;br /&gt;
&lt;br /&gt;
Languages that use a form of direct inclusion often make it very easy to reuse any particular block of code in multiple applications or even within the same application.  The principal is a very simple one and is usually quite easy to implement in any given language.  However, most forms of direct inclusion do not provide a way to avoid conflicts when multiple variables, functions, routines, classes, or methods share the same name.&lt;br /&gt;
&lt;br /&gt;
Languages that group classes into self-contained collections provide a fairly elegant way to avoid name collisions because each class can be referenced using a fully qualified name that includes the name of the collection it is in.  They may not be quite as simple or as easy to use as most forms of direct inclusion but the ability to avoid namespace collisions is often worth it.  It is also often easier to determine which collection/package/component a class belongs to than it is to determine which included file contains the class in a direct inclusion system which can aid in debugging and troubleshooting problems.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Assembly_language#Macros Assembly language]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Header_file Header file]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx The #include Directive]&lt;br /&gt;
&lt;br /&gt;
* [http://www.rubycentral.com/pickaxe/tut_modules.html Programming Ruby Modules and Mixins]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Java_package Java package]&lt;br /&gt;
&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ms973807.aspx Creating Components in .NET]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespace (C# Reference)]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22537</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 7 ov</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_7_ov&amp;diff=22537"/>
		<updated>2009-10-07T13:29:53Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Survey of Language Features for Code Reuse'''&lt;br /&gt;
&lt;br /&gt;
== Direct inclusion ==&lt;br /&gt;
Code can be reused by simply storing it in a defined location and allowing a compiler or preprocessor to insert a copy of the code whenever it is referenced.  This is the simplest form of code reuse and is present in many languages.&lt;br /&gt;
&lt;br /&gt;
=== Assembly Language - Macros ===&lt;br /&gt;
&lt;br /&gt;
Many assemblers have support for macros.  A macro is a block of code that can be called from any location in the program.  A macro can contain any number of instructions and is given a unique name.  Some assemblers also support passing various parameters to a macro which can be inserted into the code block contained in the macro.&lt;br /&gt;
&lt;br /&gt;
Within a program the assembler replaces all references to the macro's name with the block of code that the macro represents.  Essentially macros allow the programmer to give a chunk of code a name and then use it multiple times within a program or even in many programs.&lt;br /&gt;
&lt;br /&gt;
=== C/C++ - Includes ===&lt;br /&gt;
&lt;br /&gt;
The languages C and C++ had a directive named #include which instructs the compiler to insert the contents of a file into the current source file.  Typically a program will use this feature to allow certain functions and macros to be used within multiple source files or in multiple programs.&lt;br /&gt;
&lt;br /&gt;
Used in this way, the [http://en.wikipedia.org/wiki/Function_prototype prototype] for a function would be placed in a file and the file that includes the source code to the function and any file that contains source code using the function will use #include to reference the file containing the function prototype.  This allows the compiler to reference the source code to the function wherever it happens to be called.&lt;br /&gt;
&lt;br /&gt;
=== Ruby - Mixins and Modules ===&lt;br /&gt;
&lt;br /&gt;
Ruby has several different features that can be used individually or together to allow a programmer to reuse sections of code.  One such feature is known as a module.  A module contains a block of code and places it underneath a defined name (or namespace).  Variables, classes, and functions within a module can be used by referencing the module name followed by a . and then the name of the item in the module.&lt;br /&gt;
&lt;br /&gt;
For instance, if there is a module named Square which contains a function called draw it can be called by writing:&lt;br /&gt;
&lt;br /&gt;
Square.draw()&lt;br /&gt;
&lt;br /&gt;
If a module is referenced within a class definition that module is often referred to as a mixin.  Any functions or variables that are defined in the module can be used within the class just as if it was defined directly within the class.  For instance a module may define methods that are used in several different classes.  Each class that needs one of the methods in the module can include the module as a mixin.&lt;br /&gt;
&lt;br /&gt;
A module can be referenced in a class or program by using either the load or require statements.  If the load statement is used the module will be coped into the location of the statement much like an Assembly language macro or a C or C++ include.  &lt;br /&gt;
&lt;br /&gt;
If the require statement is used then only one copy of the module is loaded into memory.  If the module is changed during runtime all parts of the program using that module see the change immediately since they are all using the same chunk of code in memory.&lt;br /&gt;
&lt;br /&gt;
Because of this property modules in Ruby can act like a direct inclusion or a collection of classes.&lt;br /&gt;
&lt;br /&gt;
== Collections of Classes ==&lt;br /&gt;
In some object oriented languages code can be reused by grouping certain classes together under a single name.  These collections are known by different names in different languages but they all typically provide a way to reference a particular class within a collection even if a class with the same name may be found in a different collection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Java - Packages ===&lt;br /&gt;
&lt;br /&gt;
Java allows [http://en.wikipedia.org/wiki/Class_(computer_science) classes] to be grouped into a collection known as a package.  A program can then reference the package and use the classes defined within it or reference a particular class in a package.&lt;br /&gt;
&lt;br /&gt;
Each package is given a unique name and each class in a package can be referenced by giving the name of the package followed by the name of the class like this:&lt;br /&gt;
&lt;br /&gt;
java.util.Date somedate = new java.util.Date();&lt;br /&gt;
&lt;br /&gt;
=== .NET - Components and Namespaces ===&lt;br /&gt;
&lt;br /&gt;
Microsoft's .NET family of languages allows a class or a group of classes to be compiled into a component.  Components typically need to be compiled into a binary [http://en.wikipedia.org/wiki/Dynamic-link_library DLL] containing [http://en.wikipedia.org/wiki/Common_Language_Runtime CLR] code.&lt;br /&gt;
&lt;br /&gt;
Programs can use a component by adding a reference the DLL containing the component's code .  Classes contained within a component can then be used just as if the classes were defined directly in the program.&lt;br /&gt;
&lt;br /&gt;
The .NET languages also support a feature called [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespaces] which allows classes to be referenced by a fully qualified name much like Ruby's modules or Java packages. For more complicated designs, a namespace can be nested within another namespace like this:&lt;br /&gt;
&lt;br /&gt;
namespace Shape&lt;br /&gt;
{&lt;br /&gt;
	namespace TwoDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Square&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public class Circle&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	namespace ThreeDimensional&lt;br /&gt;
	{&lt;br /&gt;
		public class Cube&lt;br /&gt;
		{&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In this case the class Circle could be referenced from another program by placing the Shape namespace into a component and calling:&lt;br /&gt;
&lt;br /&gt;
Shape.TwoDimensional.Circle myCircle = new Shape.TwoDimensional.Circle();&lt;br /&gt;
&lt;br /&gt;
== Comparison == &lt;br /&gt;
&lt;br /&gt;
Languages that use a form of direct inclusion often make it very easy to reuse any particular block of code in multiple applications or even within the same application.  The principal is a very simple one and is usually quite easy to implement in any given language.  However, most forms of direct inclusion do not provide a way to avoid conflicts when multiple variables, functions, routines, classes, or methods share the same name.&lt;br /&gt;
&lt;br /&gt;
Languages that group classes into self-contained collections provide a fairly elegant way to avoid name collisions because each class can be referenced using a fully qualified name that includes the name of the collection it is in.  They may not be quite as simple or as easy to use as most forms of direct inclusion but the ability to avoid namespace collisions is often worth it.  It is also often easier to determine which collection/package/component a class belongs to than it is to determine which included file contains the class in a direct inclusion system which can aid in debugging and troubleshooting problems.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Assembly_language#Macros Assembly language]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Header_file Header file]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx The #include Directive]&lt;br /&gt;
&lt;br /&gt;
* [http://www.rubycentral.com/pickaxe/tut_modules.html Programming Ruby Modules and Mixins]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Java_package Java package]&lt;br /&gt;
&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ms973807.aspx Creating Components in .NET]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/z2kcy19k(VS.80).aspx namespace (C# Reference)]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17313</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17313"/>
		<updated>2009-09-04T17:15:45Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Centralized Version Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ Subversion] have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository; so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system, the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may simply require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining some of the advantages of a distributed system such as being able to work while disconnected from the repository; and being able to preserve change history even when a large group of changes is checked in all at once to a central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access certain areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  &lt;br /&gt;
&lt;br /&gt;
Some may see distributed version control systems as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented. Proper planning and communication can go a long way to prevent this from happening in a project.&lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/software/gnu-arch/ GNU arch]&lt;br /&gt;
* [http://monotone.ca/ Monotone]&lt;br /&gt;
* [http://darcs.net/ Darcs]&lt;br /&gt;
* [http://bazaar-vcs.org/ Bazaar]&lt;br /&gt;
* [http://mercurial.selenic.com/wiki/ Mercurial]&lt;br /&gt;
* [http://git-scm.com/ Git]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17312</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17312"/>
		<updated>2009-09-04T17:13:35Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Common Distributed Version Control Systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository; so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system, the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may simply require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining some of the advantages of a distributed system such as being able to work while disconnected from the repository; and being able to preserve change history even when a large group of changes is checked in all at once to a central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access certain areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  &lt;br /&gt;
&lt;br /&gt;
Some may see distributed version control systems as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented. Proper planning and communication can go a long way to prevent this from happening in a project.&lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/software/gnu-arch/ GNU arch]&lt;br /&gt;
* [http://monotone.ca/ Monotone]&lt;br /&gt;
* [http://darcs.net/ Darcs]&lt;br /&gt;
* [http://bazaar-vcs.org/ Bazaar]&lt;br /&gt;
* [http://mercurial.selenic.com/wiki/ Mercurial]&lt;br /&gt;
* [http://git-scm.com/ Git]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17310</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17310"/>
		<updated>2009-09-04T17:09:59Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository; so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system, the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may simply require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining some of the advantages of a distributed system such as being able to work while disconnected from the repository; and being able to preserve change history even when a large group of changes is checked in all at once to a central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access certain areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  &lt;br /&gt;
&lt;br /&gt;
Some may see distributed version control systems as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented. Proper planning and communication can go a long way to prevent this from happening in a project.&lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17309</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17309"/>
		<updated>2009-09-04T17:03:00Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Architectural Awareness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository; so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system, the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may simply require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17308</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17308"/>
		<updated>2009-09-04T15:58:47Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Conflict Resolution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository; so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17307</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17307"/>
		<updated>2009-09-04T15:57:23Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* No single point of failure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the server with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, they can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17306</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17306"/>
		<updated>2009-09-04T15:55:24Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* No network connectivity required */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection and access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17305</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17305"/>
		<updated>2009-09-04T15:53:30Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Centralized Version Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added, the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file, he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository.  This records the changes that were made and makes them available to the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection to access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17304</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17304"/>
		<updated>2009-09-04T15:51:35Z</updated>

		<summary type="html">&lt;p&gt;Veovis: /* Centralized Version Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to each file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository to record the changes and make them available to other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection to access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17303</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17303"/>
		<updated>2009-09-04T15:48:55Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Strengths and Weaknesses of Distributed Version Control'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to the file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository to record the changes and make them available to other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection to access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17302</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17302"/>
		<updated>2009-09-04T15:47:02Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Strengths and Weaknesses of Distributed Version Control&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to the file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository to record the changes and make them available to other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection to access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17301</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17301"/>
		<updated>2009-09-04T15:45:17Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Distributed Version Control =&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A version control system is a software package that allows developers to record and track how the source code for a project changes over time.  Typically each change is recorded in some form of database along with who made the change and perhaps a description of what the change was or why it was made.&lt;br /&gt;
&lt;br /&gt;
Because each change is recorded it is easy to compare the current version of a particular source file with any older version.  It is also possible to restore any source file to the state it was at a particular time in the past which can be useful if a change in a particular file breaks part of the project and needs to be undone.&lt;br /&gt;
&lt;br /&gt;
=== Centralized Version Control ===&lt;br /&gt;
&lt;br /&gt;
Traditionally version control systems have relied on each developer having access to a central server that holds the source code repository for the project.  The repository contains a complete copy of all of the files in the project along with all of the changes that have been made to the file since it was first added to the project. &lt;br /&gt;
 &lt;br /&gt;
When a new file needs to be added the developer connects to the server with the repository and checks in the new file.  When a developer wants to make a change to a file he or she is usually expected to connect to the server and retrieve the current version of the file.  The developer then makes the changes and checks in the file to the repository to record the changes and make them available to other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Distributed Version Control ===&lt;br /&gt;
&lt;br /&gt;
A new type of version control system called distributed version control has become popular in recent years.  Distributed version control systems do not require a central server to maintain the repository for a project.  Instead each developer working on the project has his or her own repository located on their workstation.  &lt;br /&gt;
&lt;br /&gt;
Any changes a developer makes to a file are tracked in the developer’s own repository.  Each change is given a unique identifier.  When the developer A wants to share his or her changes with other developers they can either push the changes directly to the other developer’s repository or they can ask the other developers to retrieve the changes directly from developer A’s repository.&lt;br /&gt;
&lt;br /&gt;
== Advantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== No network connectivity required ===&lt;br /&gt;
&lt;br /&gt;
One of the more obvious advantages of a distributed system is the fact that developers do not need a network connection to access to a central repository while they are working on a project.  Since each developer has his or her own repository they can work on changes without any form of connectivity.  All changes are committed to the developer’s local repository and can be shared later whenever the developer has a connection to other developers.&lt;br /&gt;
&lt;br /&gt;
=== Changes can be kept private while preserving change history ===&lt;br /&gt;
&lt;br /&gt;
Developers often want to keep their changes private until they are done working on them and are ready to share them.  In a traditional centralized version control system this can result in a developer checking in a large number of changes as a single revision rather than doing incremental check ins for each change.  This results in much of the change history being completely lost.&lt;br /&gt;
&lt;br /&gt;
In a distributed system the entire change history is stored in the developer’s local repository.  When the developer shares his or her changes with other developers they also have access to the history for those files that are involved in the change.  This allows the complete change history to be preserved for each file in the project while still giving the developer control over when they share their changes. &lt;br /&gt;
&lt;br /&gt;
=== Project managers do not need to grant permission to developers ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system the project managers often have to grant each developer access to the repository before they can begin to make changes.  In a distributed system this is not necessary because a new developer only needs a reasonably current copy of the source code of a project to begin to make changes.  Once the developer is ready to share his or her changes they can send them to other developers who can then choose to either accept the changes into their own repositories or reject them.&lt;br /&gt;
&lt;br /&gt;
=== No single point of failure ===&lt;br /&gt;
&lt;br /&gt;
In a centralized version control system if the system with the repository fails or becomes unavailable then developers can not check in new changes or retrieve the change history of anything in the project.  In a distributed system if a repository goes down everyone can continue to work without any problems because everything is stored in their local repository.  If their local repository becomes corrupted or destroyed, then can simply get a new copy of the repository (perhaps from another developer) and continue working.&lt;br /&gt;
&lt;br /&gt;
== Disadvantages of Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to be able to prevent certain developers from accessing certain sections of a project, particularly in a commercial development project. In a centralized system this can be accomplished by having the server only allow access to those parts of the project that the project managers have defined for each developer.  In a distributed version control system it is very hard to do this because developers can share changes with each other and there is no easy  way to determine  what sections of a project a developer may have in his or her repository. &lt;br /&gt;
&lt;br /&gt;
=== Conflict Resolution ===&lt;br /&gt;
&lt;br /&gt;
In any version control system there will be the need for conflict resolution.  If more than one developer makes changes to a single file in a project at approximately the same time a conflict can occur.  Someone must compare the various versions of the file and merge the changes into a single new version before it can be checked in.&lt;br /&gt;
&lt;br /&gt;
In a distributed version control system each developer is working from their own repository so conflicts are somewhat more likely to occur than in a centralized system.  Fortunately, most distributed version control systems are capable of automatically resolving the conflict when a change is shared.  When a conflict must be resolved manually, the resulting merged changes can then be easily shared with the other developers working on the project.&lt;br /&gt;
&lt;br /&gt;
=== Architectural Awareness ===&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems allow for great flexibility when choosing how changes should be shared.  A distributed version control system can be completely decentralized and changes shared in a pear-to-pear fashion or it can resemble a centralized system, or a mixture of the two.&lt;br /&gt;
&lt;br /&gt;
Different developers will have different changes in their repositories and it may be necessary to connect to the repositories of multiple developers to retrieve the latest version of each file.  This can make retrieving a current copy of the source files for a project a bit more difficult especially if the files are being collected to make a release build for the project. &lt;br /&gt;
&lt;br /&gt;
However, it is possible to set up a central repository that developers can send their changes to when they are ready to share them.  This allows developers to take advantage of being able to work “offline” from the central repository and share changes directly with other developers while still maintaining a central location where changes can be checked in once the developer is happy with them.&lt;br /&gt;
&lt;br /&gt;
Yet another possibility is for project leaders to set up a central repository but only allow project leaders to send changes to it.  In this architecture the project leaders receive changes from the developers and choose whether or not to send them on to the central repository.&lt;br /&gt;
&lt;br /&gt;
In a centralized system the developer knows that all changes are checked in to a single repository and the latest files are always in the repository.  When using a distributed version control system, developers must be aware of the overall architecture used by the project to ensure they share their changes in the expected way.  A developer must learn whether he or she is expected to send changes to a central repository or if they must be sent to someone else for approval.  Some projects may not use a central repository at all and may just require each developer to send changes to all of the other developers in the project.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Distributed version control systems are becoming very popular among development teams and I believe the primary reason for this is the fact that a distributed system can be set up to resemble virtually any architecture imaginable.  Development teams can even set them up to act much like a centralized system while still retaining the advantages of being able to work while disconnected from the repository and being able to preserve change history even when a large group of changes is checked in all at once to the central repository (as long as the developer checked in each change incrementally to his or her own repository.)  &lt;br /&gt;
&lt;br /&gt;
Unless a project needs to have tight control over which developers can access which areas of the project there is little reason for a development team to use a centralized version control system instead of a distributed version control system.  However, cooperation between developers is essential for any project.  Some may see a distributed version control system as encouraging developers to work alone with little contact with other team members and only share their changes when they are finished.  This can cause problems if the other team members disagree with the changes or how they were implemented.    Proper planning and communication can go a long way to prevent this from happening in a project. &lt;br /&gt;
&lt;br /&gt;
== Common Distributed Version Control Systems ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://portal.acm.org.www.lib.ncsu.edu:2048/citation.cfm?id=1572211 Why Are Software Projects Moving From Centralized to Decentralized Version Control Systems?]&lt;br /&gt;
&lt;br /&gt;
* [http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ Intro to Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.red-bean.com/sussman/?p=20 The Risks of Distributed Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://blog.ianbicking.org/distributed-vs-centralized-scm.html Distributed vs. Centralized Version Control]&lt;br /&gt;
&lt;br /&gt;
* [http://arstechnica.com/staff/cohortes-vigilum/2009/03/distributed-version-control-to-the-rescue.ars Distributed version control to the rescue!]&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17300</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17300"/>
		<updated>2009-09-04T15:44:01Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Distributed Version Control =&lt;br /&gt;
&lt;br /&gt;
Distributed version control is taking root in industry, as an alternative to client-server version control (e.g., CVS, Subversion).  Explore the reasons for this, and analyze the strengths of distributed version-control systems such as Mercurial, Git, and Bazaar.&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17299</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17299"/>
		<updated>2009-09-04T15:43:47Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Distributed Version Control =&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distributed version control is taking root in industry, as an alternative to client-server version control (e.g., CVS, Subversion).  Explore the reasons for this, and analyze the strengths of distributed version-control systems such as Mercurial, Git, and Bazaar.&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17284</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17284"/>
		<updated>2009-09-04T12:34:50Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Distributed Version Control&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distributed version control is taking root in industry, as an alternative to client-server version control (e.g., CVS, Subversion).  Explore the reasons for this, and analyze the strengths of distributed version-control systems such as Mercurial, Git, and Bazaar.&lt;br /&gt;
&lt;br /&gt;
[[User:Veovis|Veovis]]&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17283</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 3 ve</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_3_ve&amp;diff=17283"/>
		<updated>2009-09-04T12:34:41Z</updated>

		<summary type="html">&lt;p&gt;Veovis: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Distributed Version Control&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distributed version control is taking root in industry, as an alternative to client-server version control (e.g., CVS, Subversion).  Explore the reasons for this, and analyze the strengths of distributed version-control systems such as Mercurial, Git, and Bazaar.&lt;/div&gt;</summary>
		<author><name>Veovis</name></author>
	</entry>
</feed>