<?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>Alex Ruiz&#039;s Blog</title>
	<atom:link href="http://alexruiz.developerblogs.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://alexruiz.developerblogs.com</link>
	<description>Having Fun with Java!</description>
	<lastBuildDate>Fri, 17 May 2013 04:58:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Android Studio: our new, shiny Android IDE</title>
		<link>http://alexruiz.developerblogs.com/?p=2700</link>
		<comments>http://alexruiz.developerblogs.com/?p=2700#comments</comments>
		<pubDate>Fri, 17 May 2013 00:58:39 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2700</guid>
		<description><![CDATA[The cat is out of the bag: yesterday, during Google I/O&#8216;s keynote, we announced our new IntelliJ IDEA-based Android IDE, Android Studio. This is what my team has been working on for the past months. From what I read on the web, Android Studio has been pretty well received. I personally heard nice comments about [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://alexruiz.developerblogs.com/files/2013/05/512_512-300x300.png" alt="" width="300" height="300" class="aligncenter size-medium wp-image-2701" /></p>
<p>The cat is out of the bag: yesterday, during <a href="https://developers.google.com/events/io/" target="_blank">Google I/O</a>&#8216;s keynote, we announced our new <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a>-based Android IDE, <a href="http://developer.android.com/sdk/installing/studio.html" target="_blank">Android Studio</a>. This is what my team has been working on for the past months.</p>
<p>From what I read on the web, Android Studio has been pretty well received. I personally heard nice comments about it, from &#8220;awesome!&#8221; to &#8220;fantastic!&#8221; and &#8220;really cool.&#8221;</p>
<p>Here are some highlights about Android Studio. I&#8217;ll be writing more detailed blogs about our IDE soon. Before I continue, let me make this clear: </p>
<blockquote><p>This is a personal blog. The opinions expressed here represent my own and not those of my employer, Google.</p></blockquote>
<p>With that out of the way, here we go:</p>
<h3>Our goal is to be Gradle-centric</h3>
<p>We are working closely with the <a href="http://www.gradle.org/gradleware">Gradleware</a> folks on a new <a href="http://www.gradle.org/">Gradle</a>-based <a href="http://tools.android.com/tech-docs/new-build-system/user-guide">build system</a>. Right now, with Android Studio, you can create new Gradle-based Android projects or import existing ones. When you build your project in Android Studio, we disable the default IDEA Java builders and delegate the build to Gradle. You get the same output from building within Android Studio or from the command line. Our goal is to have Gradle build files as the only source of truth.</p>
<h3>This is an early access preview</h3>
<p>Even though it is possible to create applications with Android Studio, there are still rough corners, bugs and features that we have not implemented yet.  It would be great to get as many bug reports and feature requests from early adopters. Here is the list of <a href="http://tools.android.com/knownissues" target="_blank">known issues</a>.</p>
<h3>We still support Eclipse</h3>
<p>We will be supporting <a href="http://developer.android.com/tools/sdk/eclipse-adt.html" target="_blank">Eclipse ADT</a> as well. In fact, we plan to add similar Gradle support to ADT. The catch here is that given limitations in Eclipse, especially JDT, we cannot guarantee a development experience as smooth as Android Studio. You can, however, export your Eclipse-based Android project as a Gradle project, and then import it into Android Studio.</p>
<h3>This is not a fork of IntelliJ IDEA</h3>
<p>We have been working, and continue to work, really close with <a href="http://www.jetbrains.com/" target="_blank">JetBrains</a>, the folks behind the best Java IDE, IDEA. They implemented the changes we needed in their platform in order to develop Android Studio. Eventually, you will be able drop Android Studio as a plug-in into your copy of IDEA.</p>
<p>That&#8217;s it for now. Stay tuned for more Android Studio posts :)</p>
<p><strong>Update:</strong> <a href="https://plus.google.com/+XavierDucrohet/posts" target="_blank">Xav</a>&#8216;s and <a href="https://plus.google.com/+TorNorbye/posts" target="_blank">Tor</a>&#8216;s Google I/O talk &#8220;What&#8217;s New in Android Developer Tools&#8221; is on <a href="https://www.youtube.com/watch?v=lmv1dTnhLH4" target="_blank">YouTube</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2700</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Joining the Android project at Google</title>
		<link>http://alexruiz.developerblogs.com/?p=2682</link>
		<comments>http://alexruiz.developerblogs.com/?p=2682#comments</comments>
		<pubDate>Mon, 25 Feb 2013 13:20:05 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Career]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2682</guid>
		<description><![CDATA[I&#8217;m most excited to announce my new adventure! Today is my first day as part of the Android project at Google. In particular, I&#8217;ll be working on tooling for Android. For the past 2 years I worked in the Eclipse tooling team (also at Google.) I had the privilege to work with an amazing group [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://alexruiz.developerblogs.com/files/2013/02/android-300x199.jpg" alt="" width="300" height="199" class="aligncenter size-medium wp-image-2683" /></p>
<p>I&#8217;m most excited to announce my new adventure! Today is my first day as part of the <a href="http://www.android.com/" target="_blank">Android</a> project at Google. In particular, I&#8217;ll be working on tooling for Android.</p>
<p>For the past 2 years I worked in the Eclipse tooling team (also at Google.) I had the privilege to work with an amazing group of people. Thank you, guys, for the best years of my career!</p>
<div style="font-size: xx-small">
(Image taken from <a href="http://www.flickr.com/photos/pizzagirl/" target="_blank">jainaj stream</a> under the creative commons license)
</div>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2682</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Interviewing with Google? Read this!</title>
		<link>http://alexruiz.developerblogs.com/?p=2628</link>
		<comments>http://alexruiz.developerblogs.com/?p=2628#comments</comments>
		<pubDate>Mon, 19 Nov 2012 14:57:29 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Interviewing]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2628</guid>
		<description><![CDATA[In response to my post, &#8220;My team at Google is hiring,&#8221; I got a lot more résumés than I expected. This is absolutely great! Many thanks to all the folks interested in working in my team! While chatting with a few of the potential candidates, I offered some advice on interviewing with Google. This is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://alexruiz.developerblogs.com/files/2012/11/nervous2-300x300.jpeg" alt="" width="300" height="300" class="aligncenter size-medium wp-image-2660" /></p>
<p>In response to my post, &#8220;<a href="http://alexruiz.developerblogs.com/?p=2557" title="My team at Google is hiring">My team at Google is hiring</a>,&#8221; I got a lot more résumés than I expected. This is absolutely great! Many thanks to all the folks interested in working in my team!</p>
<p>While chatting with a few of the potential candidates, I offered some advice on interviewing with Google. This is advice that was passed to me when I interviewed a couple of years ago. Even though these tips are nothing out of ordinary, they are, however, practical and useful. Since I found myself repeating them over an over, I thought it may be a good idea to write them down. </p>
<p>Here we go.</p>
<h3>1. Listen to your best friend: the (Google) recruiter</h3>
<p>Is the recruiter&#8217;s job to get you an offer from Google. He or she will do everything in their control to help you. As part of their job, they will tell you what you need to study for the interview. It is a lot of material, but it is absolutely worth the effort. Needless to say, <a href="http://alexruiz.developerblogs.com/?p=1921" title="What I am doing at Google">Google is awesome</a>.</p>
<h3>2. <em>You</em> decide <em>when</em> to interview</h3>
<p>It is your decision when to interview. Take all the time you need to prepare and don&#8217;t let anybody push you. Knowing when you are ready is difficult though. Studying all the material is pretty much impossible. Instead, you need to set a realistic goal. In my case, since I was terrified by the interview process, my goal was to cover the basic algorithms and data structures, and study until I feel calm and confident.</p>
<h3>3. Practice, practice, practice&#8230;and get a whiteboard</h3>
<p>It does not matter if your solution is wonderful, you are in trouble if the interviewer cannot understand it. While preparing for the interview, solve problems on a whiteboard. Learn how to express your ideas and write code (yes, write code on a whiteboard) in a clear, neat and organized way. You want interviewers to understand your solutions.</p>
<h3>4. Let all your friends at Google know that you are interviewing</h3>
<p>The more Googlers that can say something good about you, the better. You <em>may</em> be able to skip the phone interview (it is <em>not</em> a promise though.) I personally hate technical phone interviews.</p>
<h3>5. $hit can happen</h3>
<p>Preparing for the interview does not guarantee you will pass it. There are many factors that can work either in your favor or against you. Plus, there is no such a thing as a perfect interview process. $hit out of your control can happen. Don&#8217;t feel too bad if, for whatever reason, you fail the interview. It happens more often than you think. Seriously. Just learn from the experience and apply again in six months. Like I mentioned earlier, working for Google is worth the effort.</p>
<p>That&#8217;s pretty much it. Good luck! :)</p>
<div style="font-size: xx-small">
(Image taken from <a href="http://www.flickr.com/photos/andresthor/" target="_blank">andres.thor&#8217;s stream</a> under the creative commons license)
</div>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2628</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Weekend Project: Thread Dump Viewer for Eclipse</title>
		<link>http://alexruiz.developerblogs.com/?p=2601</link>
		<comments>http://alexruiz.developerblogs.com/?p=2601#comments</comments>
		<pubDate>Mon, 05 Nov 2012 13:28:37 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Xtext]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2601</guid>
		<description><![CDATA[A couple of weeks ago, one of our users reported that Eclipse consistently froze when executing some action. I was hoping that Eclipse would have an editor where I can open the thread dump I got and navigate, through hyperlinks, from stack traces to source code. The closest thing I found was the &#8220;Java Stack [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A couple of weeks ago, one of our users reported that Eclipse consistently froze when executing some action. I was hoping that Eclipse would have an editor where I can open the thread dump I got and navigate, through hyperlinks, from stack traces to source code. The closest thing I found was the &#8220;Java Stack Trace Console,&#8221; which provides hyperlinking to source code. It would have been nice if there is a specialized editor that provides the following features, besides code navigation:</p>
<ul>
<li>an Outline View that shows the threads by name (with icons representing their state) and any deadlocks found</li>
<li>some basic syntax highlighting to make reading easier</li>
<li>ability to collapse blocks (e.g. a thread or stack trace) to minimize noise</li>
<li>navigation to thread definitions from references (e.g. a deadlock)</li>
</ul>
<p>BTW, IntelliJ IDEA provides something somehow close to what I&#8217;m asking for since <a href="http://blogs.jetbrains.com/idea/2008/05/analyzing-external-thread-dump/" target="_blank">2008</a>! 2008!</p>
<p>In addition, I didn&#8217;t want a tool that analises a thread dump for me (e.g. <a href="http://java.net/projects/tda" target="_blank">TDA</a> or the <a href="https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c" target="_blank">IBM one</a>.) So far, I haven&#8217;t seen a thread dump that is that hard to read.</p>
<p>Of course I had to scratch my own itch! This past weekend I finally had time to write my own &#8220;Thread Dump Viewer.&#8221; It is an editor that provides everything I described. I was able to write a working editor in a matter of hours, using <a href="http://xtext.org" target="_blank">Xtext</a>. The key was getting the grammar right. I spent an additional couple of hours making it &#8220;prettier.&#8221;</p>
<p>Here is a screenshot of the editor (click to enlarge.)</p>
<p><a href="http://alexruiz.developerblogs.com/files/2012/11/edtv.png"><img src="http://alexruiz.developerblogs.com/files/2012/11/edtv-300x190.png" alt="" width="300" height="190" class="aligncenter size-medium wp-image-2606" /></a></p>
<p>Here is a demo showing off the features of the &#8220;Thread Dump Viewer.&#8221; </p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/wlMah94Rbbw?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>I created this tool for my own use. I haven&#8217;t open-sourced the code or made the plug-in publicly available simply because I don&#8217;t know if anybody else would find this tool useful. If you do, please leave a comment.</p>
<p><strong>(10/07/12) Update:</strong> I&#8217;m in the process of open sourcing this plug-in. I need to do some cleanup (code formatting, add copyright headers, etc.) first. I expect the first version of the plug-in to be what I have now. Right after that, I&#8217;ll be implementing the features mentioned in the comments:</p>
<ul>
<li>detection of multiple threads locking on the same object</li>
<li>compare multiple thread dumps with each other</li>
</ul>
<p>Many thanks to everyone that left a comment! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2601</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Fluent interfaces: don&#8217;t chain for the sake of chaining</title>
		<link>http://alexruiz.developerblogs.com/?p=2568</link>
		<comments>http://alexruiz.developerblogs.com/?p=2568#comments</comments>
		<pubDate>Tue, 18 Sep 2012 08:17:21 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FEST]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2568</guid>
		<description><![CDATA[One of the goals of FEST-Assert 2.0 is to learn from the mistakes we made in the 1.x releases, even if that means not being backwards-compatible. Not fully understanding the semantics of the API we were building, is, IMHO, one of the biggest mistakes we made in FEST 1.x. We were not able to see [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://alexruiz.developerblogs.com/files/2012/09/2731710806_41fc7d9415.jpg" alt="" width="300" height="400" class="aligncenter size-full wp-image-2574" /></p>
<p>One of the goals of <a href="https://github.com/alexruiz/fest-assert-2.x" target="_blank">FEST-Assert 2.0</a> is to learn from the mistakes we made in the <a href="https://github.com/alexruiz/fest-assert-1.x" target="_blank">1.x</a> releases, even if that means not being backwards-compatible.</p>
<p>Not fully understanding the semantics of the API we were building, is, IMHO, one of the biggest mistakes we made in FEST 1.x. We were not able to see that each assertion in the method chain should be an independent unit.</p>
<p>To better explain my point of view, consider this snippet using <a href="http://fest.easytesting.org/" target="_blank">FEST-Reflect</a>&#8216;s API:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Person person <span style="color: #339933;">=</span> constructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">withParameterTypes</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
                             .<span style="color: #006633;">in</span><span style="color: #009900;">&#40;</span>Person.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
                             .<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Yoda&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In this example, each chained method in the fluent interface serve a common purpose: instantiate a new <code>Person</code> (similar to the builder pattern.)</p>
<p>On the other hand, in FEST-Assert, each method in the fluent interface has its own, individual purpose. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isInstanceOf</span><span style="color: #009900;">&#40;</span>Jedi.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isEqualTo</span><span style="color: #009900;">&#40;</span>foundJedi<span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isNotEqualTo</span><span style="color: #009900;">&#40;</span>foundSith<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The purpose of <code>isInstanceOf</code> is different than the one from <code>isNotEqualTo</code>. We can even call them individually:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isInstanceOf</span><span style="color: #009900;">&#40;</span>Jedi.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isEqualTo</span><span style="color: #009900;">&#40;</span>foundJedi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isNotEqualTo</span><span style="color: #009900;">&#40;</span>foundSith<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In FEST 1.x I broke this assumption by introducing <code>overridingErrorMessage</code> as a way to override FEST&#8217;s default error message in case an assertion fails. Let&#8217;s take a look at this example:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">overridingErrorMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Yoda is a Jedi, dammit!&quot;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isInstanceOf</span><span style="color: #009900;">&#40;</span>Jedi.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isEqualTo</span><span style="color: #009900;">&#40;</span>foundJedi<span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isNotEqualTo</span><span style="color: #009900;">&#40;</span>foundSith<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is when it gets confusing. Now a method in the chain affects the behavior of the next one. It is hard to tell if <code>overridingErrorMessage</code> only applies to <code>isInstanceOf</code>, or to all the methods in the chain. It is so confusing that I cannot remember what were the semantics of <code>overridingErrorMessage</code>!</p>
<p>This is a potential fix:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">assertThat<span style="color: #009900;">&#40;</span>yoda<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isInstanceOf</span><span style="color: #009900;">&#40;</span>Jedi.<span style="color: #000000; font-weight: bold;">class</span>, overridingErrorMessage<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Yoda is a Jedi, dammit!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isEqualTo</span><span style="color: #009900;">&#40;</span>foundJedi<span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">isNotEqualTo</span><span style="color: #009900;">&#40;</span>foundSith<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now it is easier to understand that <code>overridingErrorMessage</code> only affects <code>isInstanceOf</code>.</p>
<p>Looking back, I can see that I introduced <code>overridingErrorMessage</code> the way I did because I naively thought that method chaining makes it easier to write and read code. It surely makes it easier to write code (just press &#8220;.&#8221; and your IDE&#8217;s content assist will show you all the available methods) but I showed you that chaining methods does not always produce a readable API. </p>
<p>In short: I abused method chaining.</p>
<h2>Conclusion</h2>
<p>When creating a fluent interface using method chaining, step back and think what are you trying to achieve. Do the methods in the chain share a common purpose? Are you chaining a bunch or independent methods? Regardless of the style you choose, be consistent and try not to mix them. That will make the code written with your API readable.</p>
<p>Oh BTW, we made the same mistake (again) in FEST-Assert 2.x. Luckily, there is still time to fix it :)</p>
<div style="font-size: xx-small">
(Image taken from <a href="http://www.flickr.com/photos/borismitendorfer/" target="_blank">Boris Mitendorfer Photography stream</a> under the creative commons license)
</div>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2568</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My team at Google is hiring</title>
		<link>http://alexruiz.developerblogs.com/?p=2557</link>
		<comments>http://alexruiz.developerblogs.com/?p=2557#comments</comments>
		<pubDate>Thu, 13 Sep 2012 07:01:43 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2557</guid>
		<description><![CDATA[This is a follow up for a tweet I sent this morning. I&#8217;m sharing some more details to save everybody&#8217;s time. In short: my team at Google is hiring. If you enjoy writing Eclipse plug-ins, send me your résumé at: alruiz at google.com. Important details: No prior experience with Eclipse is needed. We are looking [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This is a follow up for <a href="https://twitter.com/alexRuiz/status/245935916835815424" target="_blank">a tweet I sent this morning</a>. I&#8217;m sharing some more details to save everybody&#8217;s time.</p>
<p>In short: my team at Google is hiring. If you enjoy writing Eclipse plug-ins, send me your résumé at: alruiz at google.com.</p>
<p>Important details:</p>
<ul>
<li>No prior experience with Eclipse is needed. We are looking for strong Java developers that have passion for building tools.</li>
<li>This job is in Mountain View, at Google&#8217;s headquarters. No telecommuting. Candidates should be willing to relocate if necessary.</li>
<li>You need to go through the regular Google interview process.</li>
</ul>
<p>Take a look at <a href="http://alexruiz.developerblogs.com/?p=1921" title="What I am doing at Google">this post</a> if you&#8217;d like to know a little bit more about what we do and our culture.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2557</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>FEST named finalist In ATI Automation Honors</title>
		<link>http://alexruiz.developerblogs.com/?p=2548</link>
		<comments>http://alexruiz.developerblogs.com/?p=2548#comments</comments>
		<pubDate>Mon, 10 Sep 2012 08:09:30 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[FEST]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[UI Testing]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2548</guid>
		<description><![CDATA[I&#8217;m pretty happy to announce that FEST has been named a finalist in the 4th Annual ATI Automation Honors. The winner will be announced at the TestKIT 2012 Conference. If you are happy FEST user, please vote for us! :) Update: FEST&#8217;s home page was down, most likely due to the recent problems GoDaddy is [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="http://alexruiz.developerblogs.com/files/2012/09/atiHonorsFinalistBadge_20122013_150.png" alt="" width="150" height="150" class="aligncenter size-full wp-image-2549" /></p>
<p>I&#8217;m pretty happy to announce that <a href="http://fest.easytesting.org" target="_blank">FEST</a> has been named a finalist in the <a href="http://www.automatedtestinginstitute.com/" target="_blank">4th Annual ATI Automation Honors</a>.</p>
<p>The winner will be announced at the <a href="http://www.testkitconference.com/" target="_blank">TestKIT 2012 Conference</a>.</p>
<p>If you are happy FEST user, please <a href="http://www.automatedtestinginstitute.com/" target="_blank">vote</a> for us! :)</p>
<p><strong>Update:</strong> FEST&#8217;s home page was down, most likely due to the <a href="http://www.reuters.com/article/2012/09/10/godaddy-outage-idUSL1E8KAGLE20120910" target="_blank">recent problems GoDaddy is going through</a>. If you have problems accessing it, you can visit our <a href="http://code.google.com/p/fest/" target="_blank">Google Code page</a> :)</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2548</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Never, ever use Iterable as a return type</title>
		<link>http://alexruiz.developerblogs.com/?p=2519</link>
		<comments>http://alexruiz.developerblogs.com/?p=2519#comments</comments>
		<pubDate>Thu, 06 Sep 2012 09:10:00 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2519</guid>
		<description><![CDATA[This is a short rant. Please do not use Iterable as a return type. Its Javadoc states that Implementing this interface allows an object to be the target of the &#8220;foreach&#8221; statement. That&#8217;s the only purpose of this interface. Other than that, this interface is almost useless, or at least a PITA to consume. For [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://alexruiz.developerblogs.com/files/2012/09/Iterable.png"><img src="http://alexruiz.developerblogs.com/files/2012/09/Iterable.png" alt="" width="400" height="301" class="aligncenter size-full wp-image-2539" /></a></p>
<p>This is a short rant. Please do not use <code>Iterable</code> as a return type. Its <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html">Javadoc</a> states that</p>
<blockquote><p>
Implementing this interface allows an object to be the target of the &#8220;foreach&#8221; statement.
</p></blockquote>
<p>That&#8217;s the only purpose of this interface. </p>
<p>Other than that, this interface is almost useless, or at least a PITA to consume. For example, to obtain the size of an <code>Iterable</code> you&#8217;d need to do this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Iterable<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> names <span style="color: #339933;">=</span> getRecentUsers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> size <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name <span style="color: #339933;">:</span> names<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  size<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Or, just to check that an <code>Iterable</code> is not empty:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Iterable<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> names <span style="color: #339933;">=</span> getRecentUsers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">boolean</span> empty <span style="color: #339933;">=</span> <span style="color: #339933;">!</span>names.<span style="color: #006633;">iterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Horrible, isn&#8217;t it?</p>
<p>Return a <code>Collection</code> instead. If your users may need to access to the elements by index, return a <code>List</code>.</p>
<p>(I actually think that <code>Iterable</code> should not even used for parameters, but I&#8217;m not 100% sure yet.)</p>
<p><strong>Update:</strong> After reading the comments in this post, I realized I didn&#8217;t cover one use case: collections that contain a big number of elements and are lazily loaded. I also did not specify the context I was talking about: domain-specific APIs that you are in control of.</p>
<p>I still think that <code>Iterable</code> is a poor choice. Since we are in control of the API we can provide something more useful (or potentially more useful) to the consumers of such API. In the case of lazily-loaded collections, provide something like a <code>Page</code> object. It may or may not implement <code>Iterable</code>. A <code>Page</code> class may contain other useful information besides simple iteration of elements (e.g. the page number.)</p>
<p>Changing the subject a little bit, this is something that I&#8217;ve seen quite frequently, all in the name of &#8220;flexibility&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Iterable<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getRecentUsers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> users <span style="color: #339933;">=</span> fetchFromDb<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #003399;">Collections</span>.<span style="color: #006633;">unmodifiableList</span><span style="color: #009900;">&#40;</span>users<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Since we are already dealing with <code>List</code>, why not just return the same type?</p>
<p><strong>Update 2:</strong> If you are thinking about <a href="http://code.google.com/p/guava-libraries/" target="_blank">Guava</a>&#8216;s usage of <code>Iterable</code>. please read the comments, which includes one from the man himself, Kevin Bourrillion.</p>
<p><strong>Update 3:</strong> This is my position about general-purpose libraries like Guava:</p>
<p>Guava&#8217;s goal is to make Java easier to use. It provides a lot of useful functionality that IMHO should be in the JDK itself. As such, it needs to deal with very general classes such as <code>Iterable</code>. Plus, it provides utilities to overcome some of <code>Iterable</code>&#8216;s deficiencies (like lack of a <code>isEmpty</code> method.)</p>
<p>My post is about domain-specific APIs that you provide to your users, not something like Guava.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2519</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>A handy setup for writing articles for developerWorks, using Eclipse</title>
		<link>http://alexruiz.developerblogs.com/?p=2468</link>
		<comments>http://alexruiz.developerblogs.com/?p=2468#comments</comments>
		<pubDate>Wed, 22 Aug 2012 22:57:21 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[CDT]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2468</guid>
		<description><![CDATA[Today, IBM developerWorks published the article I recently wrote, &#8220;Integrate an external code checker into Eclipse CDT.&#8221; When writing for developerWorks, we have the option to write in three formats: Word, Write or XML. Since I find it pretty painful to use Word or Write, I usually choose the XML format. developerWorks provides a pretty [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Today, IBM developerWorks published the article I recently wrote, &#8220;<a href="https://www.ibm.com/developerworks/java/library/j-codan/" target="_blank">Integrate an external code checker into Eclipse CDT</a>.&#8221;</p>
<p>When writing for developerWorks, we have the option to write in three formats: Word, Write or XML. Since I find it pretty painful to use Word or Write, I usually choose the XML format. developerWorks provides a pretty detailed tutorial on <a href="http://www.ibm.com/developerworks/library/i-dwauthors/" target="_blank">how to write an article in XML</a>. In addition, developerWorks provides an &#8220;author package&#8221; that includes a little command-line program to convert the article in XML format to an HTML page, something handy when you want to see how your article will look like when published.</p>
<p>While writing my last article, I noticed that I was wasting too much time switching between my XML editor (<a href="http://eclipse.org" target="_blank">Eclipse</a>), the conversion tool and the browser (I like to review the article as I write it, and the HTML format is a lot easier to read than XML.)</p>
<p>I wanted to write and preview everything using a single tool. Unfortunately, there is no WYSIWYG editor for developerWorks&#8217; XML format. The best I could do is to have everything, the editor, the command-line tool and browser in one place: Eclipse.</p>
<p>Eclipse already comes with a built-in browser. Luckily for me, <a href="http://alexruiz.developerblogs.com/?p=2428" title="New Terminal plug-in for Eclipse!" target="_blank">I released a terminal plug-in for Eclipse</a> last month! </p>
<p>Here is a screenshot of my setup (click to enlarge.)</p>
<p><a href="http://alexruiz.developerblogs.com/files/2012/08/writing-with-eclipse.png"><img src="http://alexruiz.developerblogs.com/files/2012/08/writing-with-eclipse-1024x568.png" alt="" width="588" height="327" class="aligncenter size-large wp-image-2478" /></a></p>
<p>On the left side I have the XML editor. Once I&#8217;m done writing, I switch to the terminal and run the conversion tool (after the first time I just press &#8220;UP&#8221; and &#8220;ENTER.&#8221;) Once conversion is done, I just refresh the browser (on the top-right) to preview the article.</p>
<p>This simple setup saved me a lot of time (I&#8217;m using a 30-inch monitor, BTW.) If you write or plan to write articles for developerWorks you may want to give it a try :)</p>
<p>You can find more information about the terminal plug-in at the project&#8217;s <a href="http://code.google.com/p/elt/" target="_blank">home page</a>.</p>
<p><strong>Update:</strong> <a href="https://plus.google.com/u/0/108956878818216492486/posts" target="_blank">Alexander Pupeikis</a> made a good point on my <a href="https://plus.google.com/u/0/110937808291147673063/posts/4BH5igv8sTK" target="_blank">G+ post</a>: why bother with all this for writing text?</p>
<p>What I forgot to mention is that being in an IDE is pretty handy if you include code snippets or a code attachment in your article. In my case, for code snippets, I write code in a Java editor to ensure I&#8217;m not writing stuff that doesn&#8217;t work. Then I copy/paste code between editors.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2468</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Terminal plug-in for Eclipse!</title>
		<link>http://alexruiz.developerblogs.com/?p=2428</link>
		<comments>http://alexruiz.developerblogs.com/?p=2428#comments</comments>
		<pubDate>Wed, 18 Jul 2012 15:08:41 +0000</pubDate>
		<dc:creator>Alex Ruiz</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://alexruiz.developerblogs.com/?p=2428</guid>
		<description><![CDATA[I&#8217;m pretty happy to announce the first release of our terminal plug-in for Eclipse! This plug-in provides a fully-working, command-line terminal to Eclipse 3.7 or later (yes, even 4.2!) It works on Linux and MacOS only. Why a terminal? At Google we have several interactive command-line tools that we need to invoke from Eclipse. It [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m pretty happy to announce the first release of our <a href="http://code.google.com/p/elt/" target="_blank">terminal plug-in for Eclipse</a>!</p>
<p><a href="http://alexruiz.developerblogs.com/files/2012/07/terminal21.png"><img src="http://alexruiz.developerblogs.com/files/2012/07/terminal21.png" alt="" width="552" height="239" class="aligncenter size-full wp-image-2435" /></a></p>
<p>This plug-in provides a fully-working, command-line terminal to Eclipse 3.7 or later (yes, even 4.2!) It works on <a href="https://code.google.com/p/elt/wiki/FAQ#Why_not_Windows?" target="_blank">Linux and MacOS only</a>.</p>
<h3>Why a terminal?</h3>
<p>At Google we have several interactive command-line tools that we need to invoke from Eclipse. It resulted in poor user experience. The terminal opened in its own window. After issuing several commands, managing all those windows was messy. This terminal also does not allow us to copy/paste URLs.</p>
<p>This first release is mostly for users to give the terminal a try. For our next release, we expect to fix all major bugs and have the ability to issue commands from Eclipse. </p>
<h3>Standing on the shoulder of giants</h3>
<p>The terminal plug-in is based on two great Eclipse projects: <a href="http://www.eclipse.org/cdt/" target="_blank">Eclipse CDT</a> and <a href="http://www.eclipse.org/tm/" target="_blank">Eclipse Target Management</a>. We forked the minimum necessary pieces to make the plug-in work. From Target Management we got the terminal emulator, and from CDT we got the pseudo-terminal (PTY) support.</p>
<h3>Improvements</h3>
<p>Once we had a minimal terminal working, we added some features to improve the user experience.</p>
<h6>1. Quickly open a terminal from almost anywhere in Eclipse</h6>
<p><img src="http://alexruiz.developerblogs.com/files/2012/07/open-terminal-here.png" alt="" width="345" height="166" class="aligncenter size-full wp-image-2455" /></p>
<p>A new terminal view can be opened in three different ways:</p>
<ol>
<li>Right-click any file or folder, and select the &#8220;Open Terminal Here&#8221; context menu (idea borrowed from the Windows XP Power Toy &#8220;Command Prompt Here&#8221;)</li>
<li>On a terminal view, click the &#8220;New Terminal&#8221; button in the toolbar</li>
<li>If there are no terminal views open, go to the menu &#8220;Window&#8221; &gt; &#8220;Show View&#8221; &gt; &#8220;Other&#8221; and find &#8220;Terminal&#8221; under the &#8220;General&#8221; category</li>
</ol>
<h6>2. Colors and font configuration</h6>
<p><img src="http://alexruiz.developerblogs.com/files/2012/07/font-color.png" alt="" width="382" height="401" class="aligncenter size-full wp-image-2457" /></p>
<p>You can change the terminal&#8217;s background and foreground colors as well as the font. Go to the menu &#8220;Window&#8221; menu (or &#8220;Eclipse&#8221; menu in Mac OS) and navigate to the &#8220;Terminal&#8221; &gt; &#8220;Colors and Font&#8221; preference page.</p>
<h6>3. Hyperlinking</h6>
<p><img src="http://alexruiz.developerblogs.com/files/2012/07/http-hyperlinking.png" alt="" width="395" height="89" class="aligncenter size-full wp-image-2451" /></p>
<p>The terminal plug-in recognizes and provides hyperlinks for URLs using the HTTP(S) protocol. We&#8217;ll provide an extension point for custom hyperlink detectors.</p>
<h6>4. Keyboard shortcuts</h6>
<p>Shortcuts for copy/pasting text was one of the most requested features. On Linux you can use Ctrl+Shift+C and Ctrl+Shift+V while on MacOS you can use Command+C and Command+V, respectively.</p>
<h6>5. Change terminal&#8217;s title</h6>
<p>By default, the title of a terminal view is the last segment of the path of its working directory. You can change the title by pressing a button in the toolbar.</p>
<h3>Project location</h3>
<p>The terminal plug-in is hosted at Google Code, under the name <a href="http://code.google.com/p/elt/" target="_blank">ELT</a> (Eclipse Local Terminal.)</p>
<p>Feedback is always welcome :)</p>
]]></content:encoded>
			<wfw:commentRss>http://alexruiz.developerblogs.com/?feed=rss2&#038;p=2428</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
	</channel>
</rss>
