<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Complete Coding</title>
	
	<link>http://kevinrodrigues.com/blog</link>
	<description>A blog about programming and software development</description>
	<lastBuildDate>Wed, 28 Jul 2010 16:08:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/completecoding1" /><feedburner:info uri="completecoding1" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-sa/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>completecoding1</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>How To Define Variables In Google Go</title>
		<link>http://feedproxy.google.com/~r/completecoding1/~3/h0ErrXQviqU/</link>
		<comments>http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 16:08:00 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Go Programming]]></category>
		<category><![CDATA[google go]]></category>

		<guid isPermaLink="false">http://kevinrodrigues.com/blog/?p=951</guid>
		<description><![CDATA[In the previous tutorial, we began by writing a Hello World program in Google Go. This tutorial will look into the available primitive data types and how to declare and define variables in Go programming. Basic Data Types The following are the basic data types that are available in the Google Go programming language. bool boolean truth [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/";
		var dzone_title = "How To Define Variables In Google Go";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-left: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F28%2Fhow-to-define-variables-in-google-go%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F28%2Fhow-to-define-variables-in-google-go%2F&amp;source=rodrigueskevin&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In the previous tutorial, we began by <a title="How To Write A Hello World Program In Google Go" href="http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/" target="_blank">writing a Hello World program in Google Go</a>. This tutorial will look into the available primitive data types and how to declare and define variables in Go programming.</p>
<p><strong>Basic Data Types</strong><br />
The following are the basic data types that are available in the Google Go programming language.</p>
<pre class="prettyprint">bool          boolean truth values of either true or false
uint8         the set of all unsigned  8-bit integers (0 to 255)
uint16       the set of all unsigned 16-bit integers (0 to 65535)
uint32       the set of all unsigned 32-bit integers (0 to 4294967295)
uint64       the set of all unsigned 64-bit integers (0 to 18446744073709551615)

int8          the set of all signed  8-bit integers (-128 to 127)
int16        the set of all signed 16-bit integers (-32768 to 32767)
int32        the set of all signed 32-bit integers (-2147483648 to 2147483647)
int64        the set of all signed 64-bit integers (-9223372036854775808 to 9223372036854775807)

float32     the set of all IEEE-754 32-bit floating-point numbers
float64     the set of all IEEE-754 64-bit floating-point numbers

complex64   the set of all complex numbers with float32 real and imaginary parts
complex128  the set of all complex numbers with float64 real and imaginary parts

byte        familiar alias for uint8

uint         either 32 or 64 bits
int          either 32 or 64 bits
float       either 32 or 64 bits

string      represents the set of string values</pre>
<p>To avoid portability issues all numeric types are distinct except byte, which is an alias for uint8. Conversions are required when different numeric types are mixed in an expression or assignment. For instance, int32 and int are not the same type even though they may have the same size on a particular architecture.</p>
<p><strong>Variables</strong></p>
<p>A computer variable can represent any kind of data that can be stored in a computer system.<br />
Variables in the Go programming language can be declared as,</p>
<pre class="prettyprint">    var s string = ""</pre>
<p>This is the <em>var</em> keyword, followed by the name of the variable, followed by its type, followed by an equals sign and an initial value for the variable.<br />
Go tries to be terse, and this declaration could be shortened. Since the string constant is of type string, we don&#8217;t have to tell the compiler that. We could write</p>
<pre class="prettyprint">    var s = ""</pre>
<p>or we could go even shorter and write the idiom</p>
<pre class="prettyprint">    s := ""</pre>
<p>Following are several example of declaring different types of variables in Go.</p>
<pre class="prettyprint">var i int
var U, V, W float
var k = 0
var x, y float = -1, -2
var (
        i int
        u, v, s = 2.0, 3.0, "bar"
)</pre>
<p>If no initial value is given to a variable, then that variable is initialized to it&#8217;s zero value. False for booleans, 0 for integers, 0.0 for floats, &#8220;&#8221; for strings, and nil for pointers, functions, interfaces, slices, channels, and maps.</p>
<p><strong>Type Conversions</strong><br />
Go does not support implicit type conversion. To convert a numeric value from one type to another is a conversion, with syntax like a function call:</p>
<pre class="prettyprint">  uint8(int_var)     // truncate to size
  int(float_var)     // truncate fraction
  float64(int_var) // convert to float</pre>
<p>Also some conversions to string:</p>
<pre class="prettyprint">  string(0x1234)            // == "\u1234"
  string(array_of_bytes)    // bytes -> bytes
  string(array_of_ints)     // ints -> Unicode/UTF-8</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/' title='How To Write A Hello World Program In Google Go'>How To Write A Hello World Program In Google Go</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/' title='How To Install Google&#8217;s Go Programming Language'>How To Install Google&#8217;s Go Programming Language</a></li>
</ul>
<div style="clear:both;">&nbsp;</div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;title=How+To+Define+Variables+In+Google+Go" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;t=How+To+Define+Variables+In+Google+Go" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=How+To+Define+Variables+In+Google+Go&amp;du=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;cn=In%20the%20previous%20tutorial%2C%20we%20began%20by%C2%A0writing%20a%20Hello%20World%20program%C2%A0in%20Google%20Go.%20This%20tutorial%20will%20look%20into%20the%20available%20primitive%20data%20types%20and%20how%20to%20declare%20and%20define%20variables%20in%20Go%20programming.%0D%0A%0D%0ABasic%20Data%20Types%0D%0AThe%20following%20are%20the%20basic%20data%20types%20that%20are%20available%20in%20the%20Google%20" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;title=How+To+Define+Variables+In+Google+Go" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;title=How+To+Define+Variables+In+Google+Go" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/&amp;title=How+To+Define+Variables+In+Google+Go&amp;description=In%20the%20previous%20tutorial%2C%20we%20began%20by%C2%A0writing%20a%20Hello%20World%20program%C2%A0in%20Google%20Go.%20This%20tutorial%20will%20look%20into%20the%20available%20primitive%20data%20types%20and%20how%20to%20declare%20and%20define%20variables%20in%20Go%20programming.%0D%0A%0D%0ABasic%20Data%20Types%0D%0AThe%20following%20are%20the%20basic%20data%20types%20that%20are%20available%20in%20the%20Google%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To+Define+Variables+In+Google+Go+-+http://b2l.me/adab2u&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>


<p><a href="http://feedads.g.doubleclick.net/~a/UUmN6ckEZn1IfptO2t2LdOI_1Fw/0/da"><img src="http://feedads.g.doubleclick.net/~a/UUmN6ckEZn1IfptO2t2LdOI_1Fw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/UUmN6ckEZn1IfptO2t2LdOI_1Fw/1/da"><img src="http://feedads.g.doubleclick.net/~a/UUmN6ckEZn1IfptO2t2LdOI_1Fw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/completecoding1/~4/h0ErrXQviqU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/</feedburner:origLink></item>
		<item>
		<title>How To Write A Hello World Program In Google Go</title>
		<link>http://feedproxy.google.com/~r/completecoding1/~3/GshJddTFQoA/</link>
		<comments>http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 17:14:06 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Go Programming]]></category>
		<category><![CDATA[google go]]></category>

		<guid isPermaLink="false">http://kevinrodrigues.com/blog/?p=943</guid>
		<description><![CDATA[In the previous post, we saw how to install Google&#8217;s Go programming language. Learning any programming language begins with the “Hello World” program. So keeping with the tradition and assuming that you have some programming background, here is the program written in the Google Go programming language. Open your favorite text editor and type the [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/";
		var dzone_title = "How To Write A Hello World Program In Google Go";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-left: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F26%2Fhow-to-write-a-hello-world-program-in-google-go%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F26%2Fhow-to-write-a-hello-world-program-in-google-go%2F&amp;source=rodrigueskevin&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In the previous post, we saw <a href="http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/">how to install Google&#8217;s Go programming language</a>.</p>
<p>Learning any programming language begins with the “Hello World” program. So keeping with the tradition and assuming that you have some programming background, here is the program written in the Google Go programming language.</p>
<p>Open your favorite text editor and type the following program in it.</p>
<pre class="prettyprint">package main

import "fmt"   //Package implementing formatted I/O

func main(){
   fmt.Printf("hello, world\n")
}</pre>
<p>Save the file as “hello.go”.</p>
<p>From the console, compile it using</p>
<pre class="prettyprint">$ 6g hello.go</pre>
<p>To link the file, use</p>
<pre class="prettyprint">$ 6l hello.6</pre>
<p>and to run it</p>
<pre class="prettyprint">$ ./6.out</pre>
<p>This will print,</p>
<pre class="prettyprint">hello, world</pre>
<p>The first line in the program</p>
<pre class="prettyprint">package main</pre>
<p>specifies the name of the package that the file “hello.go” belongs to. The package keyword is used to define the package.</p>
<p>This program imports the package &#8220;fmt&#8221; to gain access to fmt.Printf. We shall see more about packages in later tutorials.</p>
<pre class="prettyprint">import "fmt"</pre>
<p>Functions are introduced with the func keyword. The main package&#8217;s main function is where the program starts running (after any initialization). We shall learn more about functions in later tutorials.</p>
<pre class="prettyprint">func main()</pre>
<p>String constants can contain Unicode characters, encoded in UTF-8. The &#8216;\n&#8217; is the newline character as in C/C++.</p>
<p>The comment convention is the same as in C++:</p>
<pre class="prettyprint">/* ... */
// ...</pre>
<blockquote><p><strong>Did you find this tutorial on the Google Go programming language useful? Would you want more of such tutorials for learning about this great new programming language by Google?</strong></p></blockquote>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/' title='How To Define Variables In Google Go'>How To Define Variables In Google Go</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/' title='How To Install Google&#8217;s Go Programming Language'>How To Install Google&#8217;s Go Programming Language</a></li>
</ul>
<div style="clear:both;">&nbsp;</div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;title=How+To+Write+A+Hello+World+Program+In+Google+Go" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;t=How+To+Write+A+Hello+World+Program+In+Google+Go" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=How+To+Write+A+Hello+World+Program+In+Google+Go&amp;du=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;cn=In%20the%20previous%20post%2C%20we%20saw%20how%20to%20install%20Google%27s%20Go%20programming%20language.%0D%0A%0D%0ALearning%20any%20programming%20language%20begins%20with%20the%20%E2%80%9CHello%20World%E2%80%9D%20program.%20So%20keeping%20with%20the%20tradition%20and%20assuming%20that%20you%20have%20some%20programming%20background%2C%20here%20is%20the%20program%20written%20in%20the%20Google%20Go%20programming" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;title=How+To+Write+A+Hello+World+Program+In+Google+Go" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;title=How+To+Write+A+Hello+World+Program+In+Google+Go" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/&amp;title=How+To+Write+A+Hello+World+Program+In+Google+Go&amp;description=In%20the%20previous%20post%2C%20we%20saw%20how%20to%20install%20Google%27s%20Go%20programming%20language.%0D%0A%0D%0ALearning%20any%20programming%20language%20begins%20with%20the%20%E2%80%9CHello%20World%E2%80%9D%20program.%20So%20keeping%20with%20the%20tradition%20and%20assuming%20that%20you%20have%20some%20programming%20background%2C%20here%20is%20the%20program%20written%20in%20the%20Google%20Go%20programming" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To+Write+A+Hello+World+Program+In+Google+Go+-+http://b2l.me/acur8c&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>


<p><a href="http://feedads.g.doubleclick.net/~a/Jm9_ZI--ncGcgHMe03FsFcnL9Ig/0/da"><img src="http://feedads.g.doubleclick.net/~a/Jm9_ZI--ncGcgHMe03FsFcnL9Ig/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Jm9_ZI--ncGcgHMe03FsFcnL9Ig/1/da"><img src="http://feedads.g.doubleclick.net/~a/Jm9_ZI--ncGcgHMe03FsFcnL9Ig/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/completecoding1/~4/GshJddTFQoA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/</feedburner:origLink></item>
		<item>
		<title>How To Install Google’s Go Programming Language</title>
		<link>http://feedproxy.google.com/~r/completecoding1/~3/WIpgVvfuozQ/</link>
		<comments>http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 05:30:32 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Go Programming]]></category>
		<category><![CDATA[google go]]></category>

		<guid isPermaLink="false">http://kevinrodrigues.com/blog/?p=902</guid>
		<description><![CDATA[Introduction Go is a compiled, garbage-collected, concurrent programming language developed by Google. According to the Go website, Go is simple. Go is fast as typical builds take a fraction of a second and resulting programs run nearly as quickly as C or C++ code. Go is type safe and memory safe. Go promotes writing systems and servers as sets [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/";
		var dzone_title = "How To Install Google&#8217;s Go Programming Language";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-left: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F24%2Fhow-to-install-googles-go-programming-language%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F24%2Fhow-to-install-googles-go-programming-language%2F&amp;source=rodrigueskevin&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><!--OffDef--></p>
<h3>Introduction</h3>
<p><strong>Go</strong> is a compiled, garbage-collected, concurrent programming language developed by Google.</p>
<p>According to the <a title="Go Programming Language" href="http://golang.org/" target="_blank">Go website</a>,</p>
<ul>
<li>Go is simple.</li>
<li>Go is fast as typical builds take a fraction of a second and resulting programs run nearly as quickly as C or C++ code.</li>
<li>Go is type safe and memory safe.</li>
<li>Go promotes writing systems and servers as sets of lightweight communicating processes, called goroutines.</li>
<li>Go feels like a dynamic language but has the speed and safety of a static language.</li>
<li>Go is open source.</li>
</ul>
<p><a title="Go Language FAQ" href="http://golang.org/doc/go_faq.html#What_is_the_purpose_of_the_project" target="_blank">Google feels</a> that there is a need for another programming language because:</p>
<ul>
<li>Computers are enormously quicker but software development is not faster.</li>
<li>Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.</li>
<li>There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.</li>
<li>Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.</li>
<li>The emergence of multicore computers has generated worry and confusion.</li>
</ul>
<h3>Installation</h3>
<p>There are two Go compiler implementations, <code>6g</code> and friends, generically called <code>gc</code>, and <code>gccgo</code>. The <code>6g</code> (and <code>8g</code> and <code>5g</code>) compiler is named in the tradition of the Plan 9 C compilers, described in <a href="http://plan9.bell-labs.com/sys/doc/compiler.html">http://plan9.bell-labs.com/sys/doc/compiler.html</a>. <code>6</code> is the architecture letter for amd64 (or x86-64, if you prefer), while <code>g</code> stands for Go. gccgo is a more traditional compiler using the gcc back end.</p>
<p>Go implementations are currently available for the Linux and Mac OS X platforms. For Windows installation, you can try <a title="Go under MS Windows" href="http://code.google.com/p/go/wiki/WindowsPort" target="_blank">Go under MS Windows</a>.</p>
<p>This article focuses on installing the gc compiler for Ubuntu 10.04. However the steps should be similar for any Linux distribution.</p>
<p><strong>Installing the gc compiler:</strong></p>
<p><strong>1) Set up the environment variables</strong></p>
<p>Set these variables in your shell profile (<code>$HOME/.bashrc)</code></p>
<pre class="prettyprint">export GOROOT=$HOME/go #The root of the Go tree
export GOARCH=amd64 #The name of the target operating system (386, amd64, arm)
export GOOS=linux #The name of the compilation architecture (darwin, freebsd, linux, nacl)
export GOBIN=$HOME/go/bin #The location where binaries will be installed
export PATH=$PATH:$GOBIN</pre>
<p><strong>2) Install the C tools</strong></p>
<p>To build Go, you need to have GCC, the standard C libraries, the parser generator Bison, <tt>make</tt>, <tt>awk</tt>, and the text editor <tt>ed</tt> installed. On OS X, they can be installed as part of Xcode.</p>
<pre class="prettyprint">$ sudo apt-get install bison gcc libc6-dev ed gawk make</pre>
<p><strong>3) Fetch the repository</strong></p>
<p>You need Mercurial installed to get the Go repository. On Ubuntu, you can install this as:</p>
<pre class="prettyprint">$ sudo apt-get install mercurial</pre>
<p>Make sure the <code>$GOROOT</code> directory does not exist or is empty. Then check out the repository:</p>
<pre class="prettyprint">$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT</pre>
<p><!--Ads1--></p>
<p><strong>4) Install Go</strong></p>
<p>To build the Go distribution, run</p>
<pre class="prettyprint">$ cd $GOROOT/src
$ ./all.bash</pre>
<p>If all goes well, it will finish by printing</p>
<pre class="prettyprint">--- cd ../test
N known bugs; 0 unexpected bugs</pre>
<p>where <var>N</var> is a number that varies from release to release.</p>
<p><strong>5) Test the installation</strong></p>
<p>A sample program</p>
<pre class="prettyprint">package main

import "fmt"

func main()
{
   fmt.Printf("hello, world\n")
}</pre>
<p>Compile it using</p>
<pre class="prettyprint">$ 6g hello.go</pre>
<p>To link the file, use</p>
<pre class="prettyprint">$ 6l hello.6</pre>
<p>and to run it</p>
<pre class="prettyprint">$ ./6.out</pre>
<p>Now you should be able to compile and run programs written in the Go Programming language.</p>
<p><strong>6) Keeping up with releases</strong></p>
<p>New releases are announced on the <a href="http://groups.google.com/group/golang-nuts">Go Nuts</a> mailing list. To update an existing tree to the latest release, you can run:</p>
<pre class="prettyprint">$ cd $GOROOT/src
$ hg pull
$ hg update release
$ ./all.bash</pre>
<p>You can get more details about installing the Go gc compiler <a title="Installing Go gc" href="http://golang.org/doc/install.html" target="_blank">here</a>.</p>
<p><strong>Installing the gccgo compiler:</strong></p>
<p>You can get more details about installing the Go gccgo compiler <a title="Installing gccgo" href="http://golang.org/doc/gccgo_install.html" target="_blank">here</a>.</p>
<p><!--Ads4--><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://kevinrodrigues.com/blog/2010/07/28/how-to-define-variables-in-google-go/' title='How To Define Variables In Google Go'>How To Define Variables In Google Go</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/26/how-to-write-a-hello-world-program-in-google-go/' title='How To Write A Hello World Program In Google Go'>How To Write A Hello World Program In Google Go</a></li>
</ul>
<div style="clear:both;">&nbsp;</div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;title=How+To+Install+Google%27s+Go+Programming+Language" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;t=How+To+Install+Google%27s+Go+Programming+Language" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=How+To+Install+Google%27s+Go+Programming+Language&amp;du=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;cn=%0D%0AIntroduction%0D%0AGo%20is%20a%C2%A0compiled%2C%C2%A0garbage-collected%2C%C2%A0concurrent%20programming%20language%20developed%20by%C2%A0Google.%0D%0A%0D%0AAccording%20to%20the%20Go%20website%2C%0D%0A%0D%0A%09Go%20is%20simple.%0D%0A%09Go%20is%20fast%20as%20typical%20builds%20take%20a%20fraction%20of%20a%20second%20and%20resulting%20programs%20run%20nearly%20as%20quickly%20as%20C%20or%20C%2B%2B%20code.%0D%0A%09Go%20is%20type%20safe%20" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;title=How+To+Install+Google%27s+Go+Programming+Language" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;title=How+To+Install+Google%27s+Go+Programming+Language" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/&amp;title=How+To+Install+Google%27s+Go+Programming+Language&amp;description=%0D%0AIntroduction%0D%0AGo%20is%20a%C2%A0compiled%2C%C2%A0garbage-collected%2C%C2%A0concurrent%20programming%20language%20developed%20by%C2%A0Google.%0D%0A%0D%0AAccording%20to%20the%20Go%20website%2C%0D%0A%0D%0A%09Go%20is%20simple.%0D%0A%09Go%20is%20fast%20as%20typical%20builds%20take%20a%20fraction%20of%20a%20second%20and%20resulting%20programs%20run%20nearly%20as%20quickly%20as%20C%20or%20C%2B%2B%20code.%0D%0A%09Go%20is%20type%20safe%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To+Install+Google%27s+Go+Programming+Language+-+http://b2l.me/acabq5&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>


<p><a href="http://feedads.g.doubleclick.net/~a/XYFE1kp9SErongnegONFs7KxI1k/0/da"><img src="http://feedads.g.doubleclick.net/~a/XYFE1kp9SErongnegONFs7KxI1k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XYFE1kp9SErongnegONFs7KxI1k/1/da"><img src="http://feedads.g.doubleclick.net/~a/XYFE1kp9SErongnegONFs7KxI1k/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/completecoding1/~4/WIpgVvfuozQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/</feedburner:origLink></item>
		<item>
		<title>The Ten Commandments for C++ Programmers</title>
		<link>http://feedproxy.google.com/~r/completecoding1/~3/SI1KsPOOHwE/</link>
		<comments>http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 14:40:25 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://kevinrodrigues.com/blog/?p=899</guid>
		<description><![CDATA[From the book &#8220;Practical C++ Programming&#8221; by Steve Oualline, The Ten Commandments for C++ Programmers written by Phin Straite. 1. Thou shalt not rely on the compiler default methods for construction, destruction, copy construction, or assignment for any but the simplest of classes. Thou shalt forget these &#8220;big four&#8221; methods for any nontrivial class. 2. [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/";
		var dzone_title = "The Ten Commandments for C++ Programmers";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-left: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F22%2Fthe-ten-commandments-for-c-programmers%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F22%2Fthe-ten-commandments-for-c-programmers%2F&amp;source=rodrigueskevin&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>From the book &#8220;Practical C++ Programming&#8221; by Steve Oualline, The Ten Commandments for C++ Programmers written by Phin Straite.</p>
<p>1. Thou shalt not rely on the compiler default methods for construction, destruction, copy construction, or assignment for any but the simplest of classes. Thou shalt forget these &#8220;big four&#8221; methods for any nontrivial class.</p>
<p>2. Thou shalt declare and define thy destructor as virtual such that others may become heir to the fruits of your labors.</p>
<p>3. Thou shalt not violate the &#8220;is-a&#8221; rule by abusing the inheritance mechanism for thine own twisted perversions.</p>
<p>4. Thou shalt not rely on any implementation-dependent behavior of a compiler, operating system, or hardware environment, lest thy code be forever caged within that dungeon.</p>
<p>5. Thou shalt not augment the interface of a class at the lowest level without most prudent deliberation. Such ill-begotten practices imprison thy clients unjustly into thy classes and create unrest when code maintenance and extension are required.</p>
<p>6. Thou shalt restrict thy friendship to truly worthy contemporaries. Beware, for thou art exposing thyself rudely as from a trenchcoat.</p>
<p>7. Thou shalt not abuse thy implementation data by making it public or static except in the rarest of circumstances. Thy data are thine own; share it not with others.</p>
<p>8. Thou shalt not suffer dangling pointers or references to be harbored within thy objects. They are nefarious and precarious agents of random and wanton destruction.</p>
<p>9. Thou shalt make use of available class libraries as conscientiously as possible. Code reuse, not just thine own but that of thy clients as well, is the Holy Grail of OO.</p>
<p>10. Thou shalt forever forswear the use of the vile printf/scanf, rather favoring the flowing streams. Cast off thy vile C cloak and partake of the wondrous fruit of flexible and extensible I/O.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://kevinrodrigues.com/blog/2010/07/24/how-to-install-googles-go-programming-language/' title='How To Install Google&#8217;s Go Programming Language'>How To Install Google&#8217;s Go Programming Language</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/18/the-history-of-line-feed/' title='The History Of Carriage Return Line Feed'>The History Of Carriage Return Line Feed</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/11/c-pitfall-beware-of-dangling-references/' title='C++ Pitfall: Beware of Dangling References'>C++ Pitfall: Beware of Dangling References</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/02/28/five-websites-to-download-open-source-software/' title='Five Websites to Download Open Source Software'>Five Websites to Download Open Source Software</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/02/21/three-pitfalls-to-avoid-when-using-dynamically-allocated-memory/' title='Three Pitfalls To Avoid When Using Dynamically Allocated Memory'>Three Pitfalls To Avoid When Using Dynamically Allocated Memory</a></li>
</ul>
<div style="clear:both;">&nbsp;</div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;title=The+Ten+Commandments+for+C%2B%2B+Programmers" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;t=The+Ten+Commandments+for+C%2B%2B+Programmers" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=The+Ten+Commandments+for+C%2B%2B+Programmers&amp;du=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;cn=From%20the%20book%20%22Practical%20C%2B%2B%20Programming%22%20by%20Steve%20Oualline%2C%20The%20Ten%20Commandments%20for%20C%2B%2B%20Programmers%20written%20by%20Phin%20Straite.%0D%0A%0D%0A1.%20Thou%20shalt%20not%20rely%20on%20the%20compiler%20default%20methods%20for%20construction%2C%20destruction%2C%20copy%20construction%2C%20or%20assignment%20for%20any%20but%20the%20simplest%20of%20classes.%20Thou%20shalt%20for" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;title=The+Ten+Commandments+for+C%2B%2B+Programmers" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;title=The+Ten+Commandments+for+C%2B%2B+Programmers" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/&amp;title=The+Ten+Commandments+for+C%2B%2B+Programmers&amp;description=From%20the%20book%20%22Practical%20C%2B%2B%20Programming%22%20by%20Steve%20Oualline%2C%20The%20Ten%20Commandments%20for%20C%2B%2B%20Programmers%20written%20by%20Phin%20Straite.%0D%0A%0D%0A1.%20Thou%20shalt%20not%20rely%20on%20the%20compiler%20default%20methods%20for%20construction%2C%20destruction%2C%20copy%20construction%2C%20or%20assignment%20for%20any%20but%20the%20simplest%20of%20classes.%20Thou%20shalt%20for" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=The+Ten+Commandments+for+C%2B%2B+Programmers+-+http://b2l.me/abu64z&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>


<p><a href="http://feedads.g.doubleclick.net/~a/Iz1th2Y3_R_KGxRq_-itc8DuD_k/0/da"><img src="http://feedads.g.doubleclick.net/~a/Iz1th2Y3_R_KGxRq_-itc8DuD_k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Iz1th2Y3_R_KGxRq_-itc8DuD_k/1/da"><img src="http://feedads.g.doubleclick.net/~a/Iz1th2Y3_R_KGxRq_-itc8DuD_k/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/completecoding1/~4/SI1KsPOOHwE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://kevinrodrigues.com/blog/2010/07/22/the-ten-commandments-for-c-programmers/</feedburner:origLink></item>
		<item>
		<title>Today’s Read: Four Ways To A Practical Code Review</title>
		<link>http://feedproxy.google.com/~r/completecoding1/~3/U_jfbD2e8FY/</link>
		<comments>http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:57:40 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://kevinrodrigues.com/blog/?p=894</guid>
		<description><![CDATA[As per the definition of Wikipedia, Code review is systematic examination (often as peer review) of computer source code intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers&#8217; skills. In this article, Jason Cohen mentions that there exists a formalized system of [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/";
		var dzone_title = "Today&#8217;s Read: Four Ways To A Practical Code Review";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-left: 5px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F20%2Ftodays-read-four-ways-to-a-practical-code-review%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fkevinrodrigues.com%2Fblog%2F2010%2F07%2F20%2Ftodays-read-four-ways-to-a-practical-code-review%2F&amp;source=rodrigueskevin&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As per the definition of Wikipedia,</p>
<blockquote><p>Code review is systematic examination (often as peer review) of computer source code intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers&#8217; skills.</p></blockquote>
<p>In this article, Jason Cohen mentions that there exists a formalized system of code review developed by Micheal Fagan at IBM in the mid-1970s. However he points out that the software development process has come a long way since then and we can have process and metrics and measurement and improvement and happy developers all at the same time. The way to achieve this is by using a lightweight code review.</p>
<p>There are four types of lightweight code review techniques:</p>
<p><strong>1) Over-the-shoulder:</strong> One developer looks over the author&#8217;s shoulder as the latter walks through the code.<br />
This is the code review technique that we use in our organization and that I am familiar with. Once the implementation has reached a level of completion, we initiate such an over-the-shoulder code review process. One of the experienced peers working on the project acts as the reviewer and sits alongside the developer. The developer walksthrough the code implementation explaining why and how the implementation has been done. The reviewer can interrupt the review process to ask any queries and point out discrepancies in the implementation. Small changes can be fixed by the developer during the review process. Larger changes can be taken offline. Once the code review is complete, the developer can check in the changes to the SCM system.</p>
<p><strong>2) Email pass-around:</strong> The author (or SCM system) emails code to reviewers.<br />
This is the second-most common form of lightweight code review, and the technique preferred by most open-source projects. Here, whole files or changes are packaged up by the author and sent to reviewers via email. Reviewers examine the files, ask questions and discuss with the author and other developers, and suggest changes.</p>
<p><strong>3) Pair Programming:</strong> Two authors develop code together at the same workstation.<br />
Pair-programming is two developers writing code at a single workstation with only one developer typing at a time and continuous free-form discussion and review.</p>
<p>4<strong>) Tool-assisted:</strong> Authors and reviewers use specialized tools designed for peer code review.<br />
This refers to any process where specialized tools are used in all aspects of the review: collecting files, transmitting and displaying files, commentary, and defects among all participants, collecting metrics, and giving product managers and administrators some control over the workflow.</p>
<p>The complete article by Jason Cohen can be found at: <a href="http://www.methodsandtools.com/archive/archive.php?id=66">Four ways to a Practical Code Review</a>.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://kevinrodrigues.com/blog/2010/07/08/dont-be-a-hotshot-programmer-be-a-boring-programmer/' title='Don&#8217;t Be A Hotshot Programmer, Be A Boring Programmer'>Don&#8217;t Be A Hotshot Programmer, Be A Boring Programmer</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/05/how-to-avoid-bugs-by-not-writing-code-at-least-not-too-much/' title='How To Avoid Bugs By Not Writing Code (At-least Not Too Much)'>How To Avoid Bugs By Not Writing Code (At-least Not Too Much)</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/04/painless-software-development-part-4/' title='Painless Software Development Part 4'>Painless Software Development Part 4</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/03/painless-software-development-part-3/' title='Painless Software Development Part 3'>Painless Software Development Part 3</a></li>
<li><a href='http://kevinrodrigues.com/blog/2010/07/01/painless-software-development-part-2/' title='Painless Software Development Part 2'>Painless Software Development Part 2</a></li>
</ul>
<div style="clear:both;">&nbsp;</div>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;title=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;t=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review&amp;du=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;cn=As%20per%20the%20definition%20of%20Wikipedia%2C%0D%0ACode%20review%20is%20systematic%20examination%20%28often%20as%20peer%20review%29%20of%20computer%20source%20code%20intended%20to%20find%20and%20fix%20mistakes%20overlooked%20in%20the%20initial%20development%20phase%2C%20improving%20both%20the%20overall%20quality%20of%20software%20and%20the%20developers%27%20skills.%0D%0AIn%20this%20article%2C%20Jason%20" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;title=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;title=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/&amp;title=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review&amp;description=As%20per%20the%20definition%20of%20Wikipedia%2C%0D%0ACode%20review%20is%20systematic%20examination%20%28often%20as%20peer%20review%29%20of%20computer%20source%20code%20intended%20to%20find%20and%20fix%20mistakes%20overlooked%20in%20the%20initial%20development%20phase%2C%20improving%20both%20the%20overall%20quality%20of%20software%20and%20the%20developers%27%20skills.%0D%0AIn%20this%20article%2C%20Jason%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Today%27s+Read%3A+Four+Ways+To+A+Practical+Code+Review+-+File: /data/app/webapp/functions.php<br />Line: 43<br />Message: Table 'b2l_shrinker.phurl_urls' doesn't exist&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>


<p><a href="http://feedads.g.doubleclick.net/~a/QKmpxjgkb1DSRF0Sa5Nli42Xosk/0/da"><img src="http://feedads.g.doubleclick.net/~a/QKmpxjgkb1DSRF0Sa5Nli42Xosk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QKmpxjgkb1DSRF0Sa5Nli42Xosk/1/da"><img src="http://feedads.g.doubleclick.net/~a/QKmpxjgkb1DSRF0Sa5Nli42Xosk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/completecoding1/~4/U_jfbD2e8FY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kevinrodrigues.com/blog/2010/07/20/todays-read-four-ways-to-a-practical-code-review/</feedburner:origLink></item>
	</channel>
</rss>
