Tuesday, July 14, 2009

3 Code Review Items

It is true, things do come in threes. Yesterday I had three code review related experiences.

1 - What was I thinking

I created a code review in Crucible to share with my team. when it came time to do the code review, Crucible hung. Strange. It has always been a good product, why should it have problems now? Answer: 768 files is probably not a reasonable code review. At just 10 minutes per file that would be 128 hours for the entire review. Lesson learned: Keep the code review to a reasonable size both for the software and the people.

2 - Free book in the mail

I got a free book on code reviews in the mail. Best Kept Secrets of Peer Code Review is a compilation of 10 practical essays from industry experts giving specific techniques for effective peer code review. It is short but looks like a good read.

3 - 5.0 for 5 users for $5 for 5 days deal

While I am a big fan of Crucible, it is not free software, unless you work for a non-profit, like I do. It which case you can use it for free. A competitor of Crucible, CodeReviewer by Smart Bear Software is running a deal where you can get a 5 user license for $5.00. It has some interesting features. This comes from a conversation with a person at Smart Bear:
From a big-picture perspective, the two tools are similar: they automate the peer code review process. The biggest difference is the level of support for what we refer to here at Smart Bear as "pre-commit review." Both tools have good support for doing "post-commit" code review; in other words, creating a code review based on file revisions that have already been checked in to version control. From what we've seen in our customer base (over 20,000 licensed seats across Code Collaborator and Code Reviewer combined), about half of developers prefer to do pre-commit review and the other half do post-commit review. Crucible supports pre-commit review, but not nearly as thoroughly as Code Reviewer. A key reason for that is that Crucible does *not* include a client-side application, with the exception of plugins that they do provide for the Eclipse and IntelliJ IDEA integrated development environments. Please note, however, that the current version of their Eclipse plugin does not provide any support for creating pre-commit reviews (and further, it only supports Subversion). In contrast, Code Reviewer's client side tools consist of: a cross-platform GUI, a cross-platform command-line utility, an Eclipse plugin, and a p4v plugin (for Perforce users). These tools automate the creation of pre-commit reviews by using the developer's version control tools to figure out what files have changed in the developer's local working copy and then Code Reviewer packages up the necessary local changes and creates the review accordingly. For a pre-commit review, Crucible makes you do all of that manually (with the exception of when you are using their IntelliJ IDEA plugin): you have to create your own diffs, etc. So that's the biggest single difference between the two tools. Some additional points to note: 1. The list of supported version control systems is similar, but not identical. Both tools can, in theory, work with *any* version control system that can produce diffs. Crucible provides specific support for post-commit review creation with CVS, Perforce, Subversion, Git, and ClearCase. Code Reviewer provides specific support for pre-commit and post-commit review creation with CVS, Perforce, Subversion, Git, Vault, and Mercurial (as a side note, Code Collaborator provides specific support for 14 different version control systems). 2. Support for iterative review. Code Reviewer has always supported iterative review: the ability to upload multiple revisions of a file(s) and make it easy for users to see the most recent changes only (or all changes) and to keep it straight which comments/defects were entered on which lines of code, even as those lines of code move around because of insertions/deletions across the different revisions. Historically, this is not something that Crucible supported, but they are claiming support for this in their just released v2.0. Note, however, that it appears to only work with post-commit reviews, unlike in Code Reviewer where it works with both pre-commit and post-commit reviews. I haven't tested it enough to figure out if their 2.0 release can accurately move comments/defects with lines of code through multiple revisions of a file. 3. Real time chat. The Crucible user interface for entering comments/defects works well, but it is not real-time. If someone else enters a comment/defect in the same file that you are working in, you won't see that comment/defect until you refresh your browser page. In Code Reviewer, this works automatically. I realize this might not be useful in a "code buddy" environment, but we do have many customers who use this facility as essentially an IM-client in order to chat about the code in real time.
Can't hardly go wrong for 5 bucks.

>Summary

Monday, July 6, 2009

Source code of Atari games

It has been a long time since I looked at assembly code, but today an opportunity presented itself. The Source Code of Several Atari 7800 Games Released! It downloaded Joust to take a look and it is a thing of beauty, I think. Assembly was never beautiful I guess, but it sure got the job done. I sure do not miss assembly but the games are still around in various forms. I don't think anything I wrote even 20 years ago is still running.

Monday, June 1, 2009

Square root of x divided by zero: The speed, size and dependability of programming languages

A friend of mine sent me this. It is a benchmark of a bunch of languages. Turns out Java 1.4 was not so bad after all. Square root of x divided by zero: The speed, size and dependability of programming languages: "The Computer Language Benchmarks Game is a collection of 1368 programs, consisting of 19 benchmark reimplemented across 72 programming languages. It is a fantastic resource if you are trying to compare programming languages quantitatively. Which, oddly, very few people seems to be interested in doing."

Thursday, April 23, 2009

Liferay and Eclipse

Holy Java Blog: "Developing portlets for Liferay in Eclipse In this blog I'd like to tell you how to use Eclipse with Liferay to develop portlets with the ability to change a class or a JSP in Eclipse and have that immediatelly reflected on the server (hot deployment)." A good look at Liferay and Eclipse.

Thursday, April 9, 2009

14 Days to Ubuntu 9.04 and counting

I have been using Xubuntu 9.04 Beta on an older laptop with much happiness. It is lightweight and snappier on the older hardware.

Thursday, April 2, 2009

Maven documentation

Whilst reading dzone, I came across an article, Five tips for successfully deploying Maven, that highlights some good ideas for working with maven. While all 5 ideas are worth the time to read, the 4th idea intrigued me most because I have always found the maven documentation difficult to find and navigate. Quoting the 4th idea:
4 Use the documentation Well, duh. But a weak point of Maven in the eyes of many people is the lack of documentation and the sometimes poorly organized information. There are a few good points of reference though, that you can spread around you team by setting up links on the Wiki for example:
  • The Definitive Guide to Maven: a free book from Sonatype, available both as HTML and PDF. Good for the beginner, and sometimes as a reference. If you don't know where to start, start here.
  • The plugin list: a comprehensive list to the official plugins, with links to each project page and JIRA subsection. Most of the core functionality is actually performed by one of these plugins, and you can learn a lot by studying things like the resources plugin documentation.
  • The POM reference: for the slightly more advanced user. Every element in the POM is explained. Don't forget to specify the XSD information in your POM file to get the most help from your XML editor.
These are 3 great links for maven documentation. I must admit I didn't even know about the first 2 and the 3 is great to have a link to as well. By getting a better understanding of how maven wants things to work, it is easier to work with it instead of against it.

Wednesday, April 1, 2009

jQuery - Simplified interaction with JavaScript

I hate JavaScript. Let there be no confusion about that. Every line of JavaScript adds another point of failure to my project. Even if it works in all browsers today, one can never be sure about tomorrow. I use it very sparingly. Today, one of my coworkers did a presentation on jQuery. He did a great job of presenting it. What really impressed me was the simplicity and of course the cross-browser support. The supported browsers as of today are: IE 6.0+, FF 2+, Safari 3.0+, Opera 9.0+, Chrome. While we still have some IE 5.0 customers out there, this is a confidence inspiring list. The basic usage is simple enough:
  1. Select one or more elements
  2. Perform some action on said elements.
Selecting elements is done with CSS selectors wrapped in a $() like $('input[type=text]') which will find all text fields. Of course, there can be $('#id') and $('.class') as well as more complex $('div div') which gives nested divs. Actions can be things like toggle, load and hover. Toggle changes from hidden to shown and back again. Load does an AJAX call and hover is an event handler for a mouse hover. There are lots of actions that can be performed and they are documented as well. His demo mostly focused on creating a JavaScript drop down list using jQuery. He did a good job of showing the benefits without going overboard. One of the great points was that by moving the javascript out of the tags, the web page would work quite well with JavaScript disabled. Of course there are other issues but this is a great one to overcome as it is important for customers to have a positive experience even in a non-JavaScript browser. Looking at the site it looks like there are also some interesting form validation options as well. Also of note, it is supported natively by Liferay. Definitely worth a look.

Tuesday, March 31, 2009

Creating a watermark in Abiword

I have recently installed Xubuntu and am giving it a try at home. One of the children was using Abiword to do a paper and wanted a "watermark" like Microsoft Word has. Using new or different software is always frustrating. For example, moving to Word 2007 was most frustrating. Unfortunately, there is no watermark in Abiword. Instead, it is called a "Page Background" which is found under the "Format" menu. Arguably, calling it a watermark is not correct but it is what we are used to calling the background image. Doing a Google search for "abiword watermark" didn't find anything useful. Hopefully this simple posting will make it easier for the next guy.

Thursday, January 8, 2009

Code Reviews

There is an interesting article on code reviews: Running an Effective Code Review
clipped from www.cio.com

Running an Effective Code Review

Code reviews can be a frustrating waste of time, but they can be a worthwhile experience that contributes to team-building, improves the software, and oh yeah... is also fun.

 blog it