<?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>The Shyam &#187; productivity</title>
	<atom:link href="http://theshyam.com/tag/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://theshyam.com</link>
	<description>Ramblings from the Real Shyam; You know, unlike those other fake Shyams!</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:07:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Gathering Rapid Feedback with TDD, better known as Infinitest!</title>
		<link>http://theshyam.com/2009/08/gathering-rapid-feedback-with-tdd-better-known-as-infinitest/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gathering-rapid-feedback-with-tdd-better-known-as-infinitest</link>
		<comments>http://theshyam.com/2009/08/gathering-rapid-feedback-with-tdd-better-known-as-infinitest/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 17:38:39 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[infinitest]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=144</guid>
		<description><![CDATA[So I have had this question often, especially from TDDers, on what the best way is to get rapid feedback as you type. One of the biggest things when you do Test Driven Development is the fact that you can see a Red / Green bar or some sort of indicator of your tests. Because [...]]]></description>
			<content:encoded><![CDATA[<p>So I have had this question often, especially from TDDers, on what the best way is to get rapid feedback as you type. One of the biggest things when you do Test Driven Development is the fact that you can see a Red / Green bar or some sort of indicator of your tests. Because that indicator is what tells you what you should be doing. Green bar? Time to write a failing test so you can add that next feature in. Red bar? Well, you know what is broken, so time to go ahead and write that feature. So initially, I used to just hit <strong>Alt + Shift + X, T</strong> to run the test I was currently editing. And then I learnt the joys of <strong>Ctrl + F11</strong>, which re runs your last configuration.</p>
<p>But still, I was left wanting more. I mean, I don&#8217;t want to have to hit something to tell eclipse to go run my tests. Eclipse already knows when I save, as it can automatically shoot off a build. Why couldn&#8217;t I just have another step afterwards which then runs my test, so I don&#8217;t have to do anything? It was along this line of thought that I stumbled upon <a title="Misko" href="http://misko.hevery.com" target="_blank">Misko</a>&#8216;s setup of using build steps to <a href="http://misko.hevery.com/2009/05/07/configure-your-ide-to-run-your-tests-automatically/" target="_blank">run all unit tests at each save</a>. Hallelujah! But the more I used this, the more I started realizing its pain points. You actually had to setup each project to do this? Uh, no. Not happening. Too much effort. I like being lazy.</p>
<p>So then I happened upon this <a href="http://www.infinitest.org" target="_blank">Infinitest</a> thing. The description sounds promising, &#8220;<em>A continuous test runner for your JUnit tests.</em>&#8221; And what, it &#8220;<em>integrates with Eclipse and IntelliJ</em>&#8220;. And its &#8220;<em>Intelligent and runs only tests that are needed.</em>&#8221; I&#8217;m sold, where do I sign up? So I went ahead and installed it, and tried it out. And it actually seems to live up to its claim, so far. Its main configuration has a single checkbox, which basically says run Infinitest or don&#8217;t run it. Nice. And it integrates seamlessly with the problems view. Like so :</p>
<div id="attachment_149" class="wp-caption aligncenter" style="width: 584px"><a href="http://theshyam.com/wp-content/uploads/2009/08/Infinitest-results.png"><img class="size-large wp-image-149     " title="Infinitest Results" src="http://theshyam.com/wp-content/uploads/2009/08/Infinitest-results-1024x178.png" alt="Infinitest results in the problem view" width="574" height="100" /></a><p class="wp-caption-text">Infinitest results in the problem view</p></div>
<p>As can be seen above, I made a change which broke two tests. Half a second after I saved those changes, I have problem markers popping up all over my project telling me that the last thing I just did blew up some tests. I can double click on the markers, go to the exact line where the failure is, and see if it was an issue of the test being wrong or me being stupid. And in some cases, that isn&#8217;t even needed, because you know the tests shouldn&#8217;t have broken.</p>
<p>Infinitest seems to be smart enough to recognize all JUnit tests without you having to point it out, and runs only the tests that matter, and not all of it. But if you have other kinds of tests, then you might run into trouble. I am still playing around with it, and will probably update this post or add a new post later with more detailed info if I deem it necessary. But in the meantime, for those of you who want to run tests at every save, check out <a href="http://www.infinitest.org" target="_blank">Infinitest</a>. It is awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2009/08/gathering-rapid-feedback-with-tdd-better-known-as-infinitest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Eclipse Productivity Shortcuts</title>
		<link>http://theshyam.com/2009/07/eclipse-productivity-shortcuts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=eclipse-productivity-shortcuts</link>
		<comments>http://theshyam.com/2009/07/eclipse-productivity-shortcuts/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:57:02 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[shortcuts]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=135</guid>
		<description><![CDATA[Do you code in Eclipse? Feel that you are not as productive as you can be, even with an IDE? Learn these simple keyboard shortcuts for eclipse which will increase your throughput to extraordinary levels. ]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Back in college, I used to be a notepad nazi, so as to say. I used to code all my giant programs solely in notepad (The most I upgraded to was to Textpad). And once I joined Google, I was apathetic to IDEs, so I just picked IntelliJ and went with it. Somewhere down the line, I attended a Testing and Refactoring workshop, and the only IDE available was Eclipse. And it was for a great reason.</p>
<p style="text-align: justify;">While the focus of the workshop was testing and refactoring, what they did do, which I applaud them for, was they showed us some awesome shortcuts. And suddenly, I was doing these insane refactorings at the blink of the eye. It was then that I started searching for and learning every eclipse shortcut that would help me be more productive. And before I knew it, I was typing 6 words a minute and coding up 100 words a minute <img src='http://theshyam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . And I loved it.</p>
<p style="text-align: justify;">And so, today, I just wanted to share the best shortcuts that make life easier. And without further ado :</p>
<p style="text-align: justify;"><strong>Ctrl + Space </strong>: One of the two most important keyboard shortcuts that eclipse offers. This one is probably commonly known for autocomplete in eclipse, but not many people know that it is also context sensitive. For example, hitting Ctrl + Space when you are in the <strong>middle of typing</strong> will <em>show you all members and methods that begin with your text</em>. But hitting Ctrl + Space when you have <strong>nothing typed</strong> <em>shows you all members and properties available</em>. But the real eclipse masters know that, hitting Ctrl + Space when you <strong>type in for or foreach</strong> will show you autocomplete options for<em> generating a for loop or for each loop</em>. And if you do it right after you <strong>assign something to a collection</strong> or a list, it will <em>fill in the loop variables for the for each loop</em>. Autocomplete after <strong>typing in test</strong>, will allow you to <em>generate the skeleton of a JUnit test case method</em>. Autocomplete after <strong>typing in new</strong>, generates you a <em>skeleton for a new call</em>, which you can tab through and fill in. So many more uses and use cases for Ctrl + Space that can be found. You can generate / override method signatures in child classes. Just use and abuse it, and you will learn so much.</p>
<p style="text-align: justify;"><strong>Ctrl + 1</strong> : If there is just one more shortcut you remember from this post, let it be this one. The other super awesome, context sensitive shortcut in Eclipse, which is basically <strong>Quick Fix</strong>. If you have an <strong>error in a line</strong>, Ctrl + 1 will show you potential <em>options to fix it, like importing a class, or adding an argument to a method or fixing the method signature</em>. If you just do a <strong>method call which returns something</strong>, then you can hit Ctrl + 1 and ask it to <em>assign it to a new local or field variable</em>. You can hit Ctrl + 1 <strong>on a</strong> <strong>parameter to a method</strong> and <em>assign it to a field</em>. Ctrl + 1 <strong>on</strong> <strong>a variable</strong> can allow you <em>to inline it</em>, and <strong>on </strong><strong>an assignment</strong>, can allow you to<em> split up the declaration and assignment, or convert it to a field, parameter, </em>etc. It is, by far, The <strong><em>Most Awesome  Keyboard shortcut</em></strong> that you can know and use. Especially on errors!</p>
<p style="text-align: justify;"><strong>Ctrl + F11</strong> : Reruns the last run configuration that was executed. If you do TDD, then Alt + Shift + X, T followed by Ctrl + F11 is the most standard approach.</p>
<p style="text-align: justify;"><strong>Ctrl + Shift + R</strong> : Shows the Open Resource dialog. Type to filter, and jump directly between classes. I love this shortcut, and use and abuse it!</p>
<p style="text-align: justify;"><strong>Ctrl + Shift + O</strong> : Organizes Imports, and gets rid of unused imports.</p>
<p style="text-align: justify;"><strong>Ctrl + O</strong> : Shows the methods and properties of a class. You can start typing to filter and hit enter to jump to a particular signature / type. Hitting Ctrl + O again toggles showing inherited members. Very useful for jumping between sections in a class, or finding that one method you want to get to.</p>
<p style="text-align: justify;"><strong>Ctrl + T</strong> : Opens the Type Heirarchy. Shows all super classes as well as sub classes / implementing types in your class path. Very useful for jumping to an implementation class. Can be called from the class type, or even a method signature. Can toggle between Supertype and Subtype heirarchy if you hit Ctrl + T again. Again, you can type and filter once you are in this menu.</p>
<p style="text-align: justify;"><strong>Ctrl + / </strong>: Comment / Uncomment code. Single or multiple lines, depending on what you have selected. Enuff said.</p>
<p style="text-align: justify;"><strong>Alt + Shift + R</strong> : One of my most used shortcuts, Rename. It renames anything from variables to methods to even classes, renaming the class files if necessary. Also fixes all references to refer to it by the new name. Can sometimes break if there are compile errors, so watch out when you use it. You can also ask it to fix all textual references as well.</p>
<p style="text-align: justify;"><strong>Alt + Shift + M</strong> : Extract Method. Super useful method to break up a larger method into smaller chunks. If the code block you have selected does not need to return too many types, and looks reasonable as a separate method, then pulls up  a prompt where you can basically edit the method signature, including return type, method name and order and type of parameters. Very useful</p>
<p style="text-align: justify;"><strong>Alt + Shift + C</strong> : Only useful when the cursor is on a method signature, but this one allows you to refactor and change the method signature. This includes changing the return type, method name, and the parameters to the method, including order, and default values if you are introducing a new one. Automagically fixes all references to said method.</p>
<p style="text-align: justify;"><strong>Alt + Shift + L</strong> : Once you have a expression selected (a method call, or whatever), then Alt + Shift + L extracts that to a local variable. It prompts you for the name of the variable, and automatically infers the type as best as it can. Extremely useful shortcut!</p>
<p style="text-align: justify;"><strong>Alt + Shift + Up / Down</strong> : This one is a useful one. If you hit up, it selects the next biggest code block, down selects the next smallest. Useful in conjunction with refactoring shortcuts like extract local variable, extract method, etc. Useful to know.</p>
<p style="text-align: justify;"><strong>Alt + Shift + T</strong> : Brings up the Refactor menu. Depending on the context, this will show options like Rename, Move, Extract Interfaces and classes, Change Method Signature, etc. Nice to know, but not one I use very often. The ones I do use have already been listed above.</p>
<p style="text-align: justify;"><strong>Alt + Shift + S</strong> : Shows the Source menu. This includes menu options like Comment related, and the ever useful Override / Implement Methods, Generate Getters and Setters, and much more. Some of the menu options have direct shortcuts, but a lot of the generate commands don&#8217;t, so useful to know.</p>
<p style="text-align: justify;"><strong>Alt + Shift + X</strong> : Pulls up the Run menu, and shows what key you have to press to run a particular type. Now I generally use this as Alt + Shift + X, followed by T, which basically executes a JUnit Test. Fastest way to run unit tests without leaving the comfort of your keyboard.</p>
<p style="text-align: justify;"><strong>Alt + Up / Down</strong> : Moves a block of lines up or down. Rather than say, selecting, hitting Ctrl + X and then going to the place and pasting, why not just select all the lines, and use Alt + Up or Down to move them. Automatically handles indentation depending on the block. Very convenient</p>
<p style="text-align: justify;"><strong>Ctrl + D</strong> :  Nice and Simple, deletes the current line the cursor is on. If you have selected multiple lines, then they are all blown away. Much faster than selecting a line and hitting delete.</p>
<p style="text-align: justify;"><strong><em>UPDATE</em></strong>: Adding in some of the shortcuts that I forgot or were mentioned in the comments for easy finding</p>
<p style="text-align: justify;"><strong>Ctrl + L</strong> : Jump to a Line number</p>
<p style="text-align: justify;"><strong>Ctrl + Shift + T</strong> : Display available types. A better version of Ctrl + Shift + R if you are only looking for Java classes</p>
<p style="text-align: justify;"><strong>Alt + Shift + Up / Down</strong> : Duplicate selected lines above or below. Easier than hitting Ctrl + C followed by Ctrl + V</p>
<p style="text-align: justify;"><strong>Ctrl + Alt + H</strong> : This one, I didn&#8217;t know about. but pulls up the Call heirarchy, showing you all callers and users of the method under the cursor. Super useful, especially if you are refactoring.</p>
<p style="text-align: justify;"><strong>Ctrl + Shift + L</strong> : Show the list of shortcuts. You can hit it again to go in and edit your shortcuts.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2009/07/eclipse-productivity-shortcuts/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Two heads are better than one</title>
		<link>http://theshyam.com/2009/06/two-heads-are-better-than-one/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=two-heads-are-better-than-one</link>
		<comments>http://theshyam.com/2009/06/two-heads-are-better-than-one/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 21:30:44 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[pair programming]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://assertionfailed.wordpress.com/?p=63</guid>
		<description><![CDATA[The beginnings of this post were when a colleague asked me to send him a brief snippet about Pair Programming and its benefits. While the snippet I sent him was mostly definition oriented, it did get me thinking that it would make a great blog post. And so here it is. Pair programming is an [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<div style="text-align:left;">The beginnings of this post were when a colleague asked me to send him a brief snippet about Pair Programming and its benefits. While the snippet I sent him was mostly definition oriented, it did get me thinking that it would make a great blog post. And so here it is.</div>
</div>
<p>Pair programming is an agile concept and is frequently used in XP (eXtreme Programming). At its core, it is nothing but having two people sit and code instead of one. And while that may seem like an obvious timesink and a doomed concept, considering two people cannot type and code at the same time, it is surprisingly effective for many reasons, some of which I will try to outline with examples from my brief experience.</p>
<p>When you work as part of a team, there is usually a process (sometimes a series of flaming hoops even) which you have to jump through before you can submit your new, super amazing, code which breaks all previous latency records. Or something just as amazing. And for a lot of groups, that involves a code review process, where someone familiar with the architecture of the system or understands the programming language and the problem goes through your code, points out issues (as if there are any in my code !!!) and so on. And while this is a good way to ensure that the quality of code that is submitted to your code base remains above a certain threshold, it becomes a huge timesink. Especially the more you know about the codebase, as everyone and their aunts start sending code reviews your way.</p>
<p>How is this solved with pair programming, you ask ? Well, consider this. While pair programming, assuming one guys starts coding away. What does the other guy do ? He (aha, you shout, as you understand even before I say it) reviews the code as you type, suggesting corrections and optimal solutions in case you start going down the wrong route. But then, you ask, isn&#8217;t that a huge waste of time, considering you are basically getting one person to just sit and permanently review ?</p>
<p>Here is where the beauty of pair programming really shines. Its called pair programming for a reason. For one, both programmers take turns in writing up new code, while the other looks on and makes sure the code is up to the amazingly high standards. Another, how many times have you written this super awesome function which took you half an hour to think of, only to find someone tell you in a code review to use this existing library function that does the entire same thing ? Now imagine that guy is, instead, sitting right next to you and telling you this before you even start coding this up.</p>
<p>Furthermore, what if I am a new guy joining a team with a very stable, settled code base. How do I hit the deck running, other than sitting for hours reading up on documentation ? Well, I go find a senior guy who loves pair programming (which is easier than it sounds if a team loves Agile practices) and go pair with him. Instant knowledge dump, and easier transition. This was the case with Arthur, a guy who joined our group for a short period of time. Instead of spending, say two weeks reading design and architecture documents, we started pairing with him from day one. By the end of day three, he had already fixed two bugs (both of which were on the first day itself!!!) and had made quite some headway into designing his first full feature. Now this intensive pairing (some might even call it hand holding) might have caused us to loose some productivity in the first few days, but by the 4th day, we had a new engineer who was capable of working independently if need be while pairing on the initial designs and features.</p>
<p>Also, Pair programming helps increase discipline and productivity. How you ask ? Well, I tend to loose focus quite easily, and love to be caught up on my emails (the thousands that spam me everyday, sigh!). And replying to my IMs takes precedence, often interrupting my thought process. Now I was pairing on the other hand, out of respect to my pair, I usually end up closing all such external annoyances, and often get two to three hours of uninterrupted work. Does wonders for my productivity, which is why I often roam around look for people to pair with.</p>
<p>Of course, if you need to convince management why you need to do pair programming, you need but point them at the multitude of studies that have been done which show an increased quality in software developed while pairing as compared to individuals. Also, if a person ever does end up leaving the team, there is someone on the team left who has paired with him and thus there are no systems which are alien to everyone on the team ever. And hey, its fun to pair, think out loud and bounce ideas off of each other. Seemingly impossible problems may seem easier as well when you pair. Often times, I seek out a teammate to bounce ideas off of, and more often than not, he will say &#8220;Alrite, let me get my keyboard. Lets pair on this.&#8221; Then it would take two hours to churn it out, and we would have a working, tested prototype by the end of it.</p>
<p>Of course, on the other hand, there is the intimidation factor of pairing with someone who seems much more knowledgeable and would eat you for lunch. Not to mention possible ego clashes and the fact that some people might find it akin to tutoring if they are paired with someone new. But these are pitfalls that can be overcome quite easily with a dedicated team.</p>
<p>And pair programming works really great when you do Test Driven Development. TDD is the art of writing a failing test before going and writing just the amount of code to pass the test. When you practice something known as ping pong pair programming with TDD, it becomes quite interesting and fun. In this, one person writes a failing test, and then the other person goes and writes the bare minimum code to get the test to pass (That is the key, the bare minimum. Don&#8217;t do speculative programming). And then, they switch. So the guy who wrote the code the first time now writes the next test, and the other person implements the functionality. This ensures that both people get turns at writing code and tests, and can make sure they cover all the cases. You end up with well tested code, but just enough code for your need. No speculation, no unneeded generalization, nothing extra.</p>
<p>And of course, no agile practice post is complete without an obligatory dilbert comic, so here goes :</p>
<p><img style="border:0 none initial;margin:0;padding:0;" title="Dilbert on Pair Programming" src="http://assertionfailed.files.wordpress.com/2009/06/dilbertpairprogramming.gif" alt="Dilbert on Pair Programming" width="455" height="141" /></p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2009/06/two-heads-are-better-than-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

