Tuesday, June 26, 2012

3 Books that Can Help Master an Open Source IDE

First, some background. My company has been using RubyMine as an integrated IDE for some time, but the team has tried some other options; there has been a preference to move towards using Vim as the editing environment, along with some other modifications. Additionally, I've been trying to do what I can to maintain the Ruby I am learning (granted, it's still fairly rudimentary, but I'm getting better).

One of my goals is to make a driver for a number of Cucumber scripts that I use to drive my testing. The name of this test environment is jokingly referred to as "Mordor" and the driver that oversees everything is called "Sauron" (yeah, our group has other utilities that are LoTR inspired too, it happens when you get a bunch of geeks together ;) ).

To this end, "Sauron" right now is a bash script that does some things in a fairly simple manner:

- it runs some preliminary steps to make sure the environments are clean.

- it then runs a randomized order of tests (currently hard-coded in my rake setup, looking to make it a flag that I can call on for the future).

- it then takes the failed test cases, does some text substitution to make new test suite lines, and then reruns the test suite.

- currently, I have it set to run repeatedly until the failed cases log file is empty. This alerts me to troublesome test cases and the areas in which they might be failing.

While this does the job in bash, I'd really like to make this a standalone app in Ruby, I'd also like to make it act and have all the attributes of any well designed command line application. To this effect, I've found "Build Awesome Command Line Applications in Ruby" by David Bryan Copeland to be a very cool read. This is a recently released title from Pragmatic Publishing (as are all three of these books I might add) that walks the user through how to create a robust and well designed command line application in, you guessed it, Ruby.

This book goes well beyond just the basics of writing a command line app. It also discusses options such as how to create an effective man page and usage syntax, how to create meaningful exit codes and format output so that other programs can use them, trapping signals from other apps so that your app can use them effectively, making your app customizable by using external configuration options, distributing your app using RubyGems, and creating acceptance tests that follow human behavior and an introduction of sorts to test driven development.

It's a slim book that clocks in at just under 200 pages, but the information provided and the way that it structures the development process is very reasonable and easy to follow. Plus, the information on how to do these steps goes well beyond hacking together an app. If you want to approach the process from a craftsman's level of appreciation, I think this book does a great job.

Having come to enjoy the ability to open a bunch of tabs in RubyMine. I'm also used to doing the jumps between tabs on the terminal window and keeping track of a lot of the processes I run while writing code, checking on runs and also looking at system resources. Still, I like the ability to actually see everything in front of me, and move and navigate between the various areas while all of the steps are happening in real time.

There are several ways that this can be accomplished, and my team has decided to use tmux to do this. How timely then to have Brian P Hogan come out with "tmux: Productive Mouse Free Development". This is a quick read (the whole thing is just under 70 pages) but it is packed with helpful ways to leverage and get used to working within a multi paned environment and customize it to maximize your speed and focus.

Sections include setting up multiple panes and navigating between them, running commands to optimize movement, copying and pasting text between windows, and how to utilize pair programming with tmux, both with shared accounts and separate accounts. I've grown to really like using tmux, and this is a quick and informative way to get up to speed.

Finally, to take advantage of this cool new tmux layout and leverage speedy text editing, the team has decided that Vim is the tool of choice (thankfully, my years of Vi on SPARC machines in the 90s can come back and help me once again :) ). To this end, Pragmatic Publishing has a book in beta currently for Drew Neil's "Practical Vim: Edit Text at the Speed of Thought".

To be honest, I picked this up just yesterday, so I'm only a few chapters in, and this book is still being written, so to give a full review is premature, but I like what I'm seeing so far.

The book is currently split into six parts. The first one gets the user up to speed with the various modes in Vim and also gets the user to wrap their head around the various Ex commands that make Vim's command line experience so expansive (and occasionally maddening).

Part 2 deals with manipulating and using files.

Part 3 focuses on speedy navigation within and between files.

Part 4 focuses on registers and macros, and the ability to string together complex commands to massage files and their contents in ways you may not have imagined possible in the visual or command modes.

Part 5 deals with Search and Substitution commands, and ways that you can do massive edits of sections of data.

Part 6 deals with useful tools that can be called from within Vim and add to the ability to rapidly pull in text, edit text or delete text, as well as some cool tips on how to work with and maintain source code.

As this book is still under development, and I expect more will be added, don't take this review as a definitive one, but if you like the idea of beta testing books, this one would be a good one to do it with.

Again, I want to state that I like RubyMine and think it does a number of things quite well, but if you decided that you do not want to have to pay for an IDE and would like a flexible alternative that delivers many of the benefits and opportunities of a dedicated IDE, these three books will definitely give you plenty to consider and ways to get proficient with little cost (just the cost of the books themselves; the software is FREE :) ).

No comments: