<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Alexandre Martins &#187; Open-Source</title>
	<atom:link href="http://blog.m.artins.net/tag/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.m.artins.net</link>
	<description>On Agile Software Development</description>
	<lastBuildDate>Thu, 12 Aug 2010 20:09:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&#8230;From Musician to Software Developer&#8230;</title>
		<link>http://blog.m.artins.net/from-musician-to-software-developer/</link>
		<comments>http://blog.m.artins.net/from-musician-to-software-developer/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 07:01:14 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Career Development]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Open-Source]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=44</guid>
		<description><![CDATA[Before start working as a software developer on 2002, I spent three years being a musician. I played drums in a handful of bands from pop to contemporary jazz, and of course, also a lot of rock and roll! I had great time doing this, I met most of my friends during this period, and [...]]]></description>
			<content:encoded><![CDATA[<p>Before start working as a software developer on 2002, I spent three years being a musician. I played <a href="http://flickr.com/photos/alexmartins/186429434/">drums</a> in a handful of bands from pop to contemporary jazz, and of course, also a lot of rock and roll!<br />
I had great time doing this, I met most of my friends during this period, and it taught me quite a few lessons that I can use in other areas than music, especially in software development.  </p>
<p>Mastering music (drums), and software development require a lot of dedication, both on reading and practicing. </p>
<p>In music, the first thing I did when I decided to take it seriously was to look for a music school to learn how to read and interpret music. Then I read most of the books related to drum techniques and rhythms, attended workshops, spent nights and weekends practicing to improve my ability and velocity. Practicing is very important! It’s when you give yourself the chance to commit mistakes and to let all the ugliness to happen; after all, no one is watching you. The intention is not to sound good, but to stretch your limits, so that you can perform perfectly on the stage.</p>
<p>In software development, it’s pretty much the same, you have to read a lot (books, blogs, articles, magazines), learn programming languages (choose two or three to specialise, and get a higher overview of others), attend workshops, meet people, practice by trying and evaluating different technologies, creating a blog to post your experiences, <a href="http://opensource.thoughtworks.com/">joining open-source projects</a>, registering for <a href="http://code.google.com/codejam/">coding competitions</a>, solving some of the <a href="http://codekata.pragprog.com/">CodeKata</a> challenges, preferably <a href="http://c2.com/cgi/wiki?PairProgramming">pairing</a> with someone else, in summary, stretch your limits!!!! (Have you seen this before? ☺) Doing so will give you more self-confidence for you to perform well during your show, at client site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/from-musician-to-software-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Benefits of supporting tools</title>
		<link>http://blog.m.artins.net/benefits-of-supporting-tools/</link>
		<comments>http://blog.m.artins.net/benefits-of-supporting-tools/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 23:16:34 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=25</guid>
		<description><![CDATA[One of the deliverables to our current client is a project template, containing tools to guide them to build better software, ensuring lower bug occurrence and system integrity. One tool we are using is Findbugs. One day, when running it, we came across an interesting issue, Findbugs was complaining that a class in a project [...]]]></description>
			<content:encoded><![CDATA[<p>One of the deliverables to our current client is a project template, containing tools to guide them to build better software, ensuring lower bug occurrence and system integrity.<br />
One tool we are using is <a href="http://findbugs.sourceforge.net/">Findbugs</a>. One day, when running it, we came across an interesting issue, Findbugs was complaining that a class in a project was exposing its internal state, subjecting it to unexpected modifications. The class contained a single constructor with parameters setting its initial state and a set of getter methods. Any Java developer used to getters and setters pattern would say that the code below is valid. </p>
<pre name="code" class="java">
public class Person {

	private String name;
	private Date dateOfBirth;

	public Person(String name, Date dateOfBirth) {
		this.name = name;
		this.dateOfBirth = dateOfBirth;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}
	public String getName() {
		return name;
	}
}
</pre>
<p>What would happen if you create a Person instance passing as parameter, pre-defined name and dateOfBirth variables and then, perform operations over these variables, modifying its states? And what if you retrieve these attributes (through getter methods), assigning them to new variables and start performing operations over them? For the name attribute it wouldn't be a problem, since String objects are immutable, but certainly both cases would affect the dateOfBirth attribute, corrupting the state of the object.</p>
<p>One of the solutions to this problem would be to make getter methods always return a new object, copy of the original one and during object construction, initialize instance variables with new objects, copy from the original ones passed as constructor parameters.</p>
<pre name="code" class="java">
public class Person {
	...

	public Person(String name, Date dateOfBirth) {
		this.name = name;
		this.dateOfBirth = new Date(dateOfBirth.getTime());
	}

	public Date getDateOfBirth() {
		return new Date(dateOfBirth.getTime());
	}
	...
}
</pre>
<p>So, unless the objects you are implementing are <a href="http://docs.codehaus.org/display/PICO/Good+Citizen">good citizens</a> and contains <a href="http://safari.oreilly.com/0321125215/ch10lev1sec2">side-effect-free functions</a>, you should consider programming in a more defensive way, to avoid unexpected behaviors in your project and also make use of tools like Findbugs to turn the development easier. <a href="http://checkstyle.sourceforge.net/">Checkstyle</a> and <a href="http://cobertura.sourceforge.net/">Cobertura</a> are a good start.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/benefits-of-supporting-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
