Posts

Mercurial Branching

It's easy to do local branching in mercurial . My partner was exploring it for the first time and asked if this was supported in mercurial since it was supported in git . I didn't know, and dug into the the Mercurial book (pdf book) to find the answer. It's really very easy, though the use of update is a little odd. You only really need the update and branch commands, but I include others here because they provide aid and comfort. hg branch Name creates branch Name , and it becomes active on the next commit. hg branch shows the current branch (no param). hg branches shows the local branches. hg update Name switches to the branch called Name . hg tip shows you where you are wrt: branches, etc. hg merge Name merges the named branch with the current one. When you do a commit and allow mercurial to call up the editor, the commit message will be populated with the tip information, so you know for sure which branch you are in. WAIT! these branches are not what you th...

Find Users of method through inheritor

So you have a method defined on an abstract base class, and you are going be messing with it. Someone decided to hang a deep inheritance hierarchy (deep to me means three levels or more) on the class. You want to know who is using an inherited method. What G (Tim Gifford) did was pretty simple, but mighty handy. He just declared an override method on the abtract class's method, and used resharper's methods (show usages, show inheritors). Quick intelligence, little real effort, and you delete the override method when you're done. This is almost as nice as Dave Chelimsky's trick of commenting out a variable declaration in order to see where the variable is used. In VS.NET + Resharper, all the usages turn red. :-)

New Upgrade

Today we had a little upgrade to our internet access. We went ahead and moved from Vonage to Comcast for phone service, and included in the upgrade were a few cable channels and a boost in bandwidth. Channels: who cares. Bandwidth boost: yeee-haw! I'm now 80% faster on downloads, and nearly 5x on the upload. I had an afternoon's worth of remote pairing with WebEx and Skype, and it went pretty well indeed. I'm sure it was just the emotional optimism on my part, but I like to think that the audio and video were smoother and that I had less lag with the keyboard. I still have lag, and sometimes when my partner is refactoring the screen refreshes too slowly and I miss what he's done. Sadly, whomever is on the "hosting" side of things gets to do any work that has a lot of edits in a lot of places. Some funny stuff, though. A change we thought was the "easy bit" took most of the day, and the ugly-seeming part took almost no time at all. I learned som...

Caring About Stupid Stuff

A clear sign of a sick workspace is when people care far too much about stupid stuff , as reported at Tech Dark Side by David Christiansen. Nicely done.

Contractor or Consultant?

Saying it here for future reference: In the software world, the difference between a contractor and a consultant is whether you are paying for obedience or advice. Reference: CIO Matthew Edwards' blog entry.

First glance: SPE and TDD

SPE is a pretty nice python editor. I'm using Ubuntu Intrepid Ibex's default version (0.8.4) and have had pretty good results most of the time. It has nice features like functional auto-completion, file navigation, debugging, UML generation, session history, shell window, tab and syntax checking, etc. Many of these features, sadly, I don't really need. I probably need a bigger project so I can really appreciate the UML and documentation generators. In today's little app, it hardly matters. Overall, it is a very reasonable full-featured editor for python programmers. SPE 0.8.4 suffers from the same malady many of the others suffer from: no real support for TDD. I can switch to a script and run it with Ctrl-R (after making sure I do a save on each file that has changed). I would like to see the next version contain a Save-All feature and a nosetests runner. It would be even cooler if the nosetests runner would fire up automagically after a save or save-all or else in...

Power Of Naming

This is from a moderately recent copy of my Meaningful Names paper, and was translated into Java in the book Clean Code. Here it is in original context with python code examples. The simple act of using a better name (instead of applying a better comment) can reduce the difficulty of working with the code we write. What is the purpose of this python code? list1 = [] for x in theList: if x[0] == 4: list1 += [x]; return list1 Why is it hard to tell what this code is doing? Clearly there are no complex expressions. Spacing and indentation are reasonable. There are only three variables and two constants mentioned at all. There aren't even any fancy classes or overloaded operators, just a list of lists (or so it seems). The problem isn't the simplicity of the code but the  implicity of the code (to coin a phrase): the degree to which the context is not exp...