home  |  articles  |  quotes   ::   website  |  profile

Software Development

How to use source control - treat it like a video game

It struck me the other day that the way I use source control is very similar to how I play video games - specifically, when and how I save my game.  I like to use source control as a safety net - it’s a way to keep track of a place I may need to return to.  It allows me to continue on with my work and not be worried if I go down a wrong path.  I can always revert and be right back where I started.

Taking this one step further, we might say that the quick save in a video game is like a commit in source control. Saving your game with a specific name is like creating a branch.

Let’s say I just finish taking out a whole horde of zombies (Left 4 Dead anticipation is infiltrating my blog).  I’ll probably do a quick-save to make sure I don’t have to re-play the same encounter again.  This is just like committing some code you just finished.  You’re saving your current progress to make sure you don’t have to re-write the same code twice.

Now, back to my game, what if I come to a fork in the road.  I can go left through the ominous looking sewer, or I can go right through the abandoned city.  Well at this point I’ll go and save my game with some sort of name like “Taking the sewer”.  That way I can continue playing, quick-saving as I go, but I can always get back to that fork if it turns out I made a mistake.

This is very similar to creating a branch in source control. You want to start working on something new, or something experimental, and you need to be able to save your progress as you go, but you always may need to go back to that original point.

I find that many developers wait too long to commit their changes.  The more frequently you commit, and the more organized you are about it, the less you have to worry about keeping track of every change you make.  This means you have left cruft floating around in your mind to remember and you can concentrate on writing good code.  I think if developers think about source control the same way they think about saving their game progress, it would help them get into the habit of committing frequently and branching appropriately.

Software Development
Subversion

Comments (8)

Permalink

sp.py - SharePoint Scripting with Python

I wrote a small introduction to SharePoint scripting with Python a while back and this weekend I didn’t have anything better to do (well actually I did, but I’m an addict - what can I say) so I decided to expand on it.  I’ve started putting together a small Python library for working with SharePoint using IronPython.  It’s called - amazingly - sp.py.

So far the library if pretty small - although it does include a nice little module for workign with stsadm commands.  I’ll be adding to it as necessary.  I’ve decided that although adding custom stsadm extensions is nice and does fit into the “way to do things in SharePoint”, it’s just too much overhead when you want to do something simple.  So at this point when things come up that need automation, I’ll be adding new sp.py scripts.

In addition to the sp.py library I’ve added three scripts:

So where can you get this awesomeness?  Well, actually you can get it on github.  Github???  You mean that totally web 2.0 site for hosting Git repositories?  Yeah - that’s the place.  If you’re wondering why I’m using git for source control, well I guess Subversion just wasn’t “edge” enough anymore.  Git’s actually pretty cool - and if you need to use Windows you can download a Windows version here.

At some point I’ll figure out how to post it as a zip or something instead of a tarball.  But until that point, you can grab the tarball here.

Office System
Python
SharePoint
Software Development

Comments (0)

Permalink

Region Folding in Textmate

As a long time Microsoft developer who is in the progress of branching out and learning new things, I sometimes find it hard to give up certain features I’ve grown accustom to.  When it comes to writing code, one feature of Visual Studio I have learned to rely on is folding sections of code using #region and #endregion.  I find regions to be a great way to organize code around different subjects, activities, etc.  For me it’s a way to reduce the visual clutter and immediately jump to the section of code I need to work on.

On the Mac, TextMate does a great job of code folding based on syntax.  I’m doing a fair amount of work with Ruby these days and TextMate is an excellent tool.  Unfortunately for me however all folding is based on the syntax of the code, and not extra non-code markers like #region.  Luckily TextMate’s bundle system is completely extensible and customizable.  Folding is based on regular expressions so with a fairly simple change I was able to get #region folding in TextMate.

The first step is to figure out the regular expression.  The core regex for #region folding would be this:

^\s*\#region
^\s*\#endregion

Next open up TextMate’s Bundle editor, open the Ruby language, and locate  the foldingStartMarker and foldingStopMarker sections.  Below is the entire contents of my foldingStartMarker and foldingStopMarker sections.

foldingStartMarker = '(?x)^
(\s*+
(module|class|def
|unless|if
|case
|begin
|for|while|until
|(  "(\\.|[^"])*+”          # eat a double quoted string
| ”(\\.|[^''])*+”        # eat a single quoted string
|   [^#"'']                # eat all but comments and strings
)*
(                 \s   (do|begin|case)
| [-+=&|*/~%^<>~] \s*+ (if|unless)
)
)\b
(?! [^;]*+ ; .*? \bend\b )
|(  “(\\.|[^"])*+”              # eat a double quoted string
| ”(\\.|[^''])*+”            # eat a single quoted string
|   [^#"'']                    # eat all but comments and strings
)*
( \{ (?!  [^}]*+ \} )
| \[ (?! [^\]]*+ \] )
)
).*$
|   [#] .*? \(fold\) \s*+ $         # Sune’s special marker
|    ^\s*\#region
‘;
foldingStopMarker = ‘(?x)
(   (^|;) \s*+ end   \s*+ ([#].*)? $
|   ^     \s*+ [}\]] \s*+ ([#].*)? $
|   [#] .*? \(end\) \s*+ $    # Sune’s special marker
|   ^\s*\#endregion
)’;

You can see where my two regular expressions were added near the end of each section.

Once you do that, close the editor, reload your bundles, and you’re good to go.

Ruby
Software Development

Comments (0)

Permalink

Motivation

I’ve got good news and bad news. First the good news: as a manager, having motivated employees is completely within your control. It doesn’t matter how big your budget is, how many employees you have, or how high in the corporate food chain you are. It is absolutely within your power to have motivated and enthusiastic employees.

Now the bad news: having motivated employees is your responsibility – yours and yours alone. It’s not the responsibility of the HR department or some disconnected “Chief Culture Officer”. It is your responsibility. And it gets worse – if you want to motivate your employees, you have to mean it.

So, before you read any further you need to ask yourself a question: do you feel motivated? Do you want to motivate your employees? Do you want to motivate your employees because you want them to feel the same commitment and passion you do? Or because you want to squeeze a few more hours out of their already long work day?

Motivation is all about communication and vision. It’s about transferring your own motivation and drive to your employees. If you don’t believe in the vision, then no amount of “employee retreats” or “team building exercises” are going to make a difference.

So again, ask yourself if you really feel it. If you don’t, it might be a good idea to step aside so someone who is truly motivated can take the reins. On the other hand, if you are motivated and are looking for some tools to help you transfer that motivation to your team, please keep reading.

Still here? Okay well either you’re lying to yourself, you’re really bored and are reading anyway, or you really do feel enthusiastic and want to pass some of that along. Hopefully it’s the latter, but I’m not going to be picky.

I’ve broken this article into four parts:

  1. Being Available
  2. Empathize, to a point
  3. Commitments
  4. General conduct

Part 1 (Being Available) is ready to go now. The other 3 parts will be posted as my time allows.

Articles
Project Management
Software Development

Comments (0)

Permalink

Motivation - Part 1: Being Available

Being Available
Or, how I learned to get up off my ass and walk around a lot

As I said up front, motivation has a lot to do with transferring your enthusiasm to your employees. But in order to do this effectively you have to be genuine about it. If you aren’t feeling it, you’ll end up doing more harm than good. Employees only need a few “fake” ra ra sessions to start seeing everything you do in that light. So the best thing to do if you aren’t feeling the enthusiasm is to do nothing. Doing nothing is much better than doing something in this case because that something is likely to cause damage that is very difficult to undo. Continue Reading »

Articles
Project Management
Software Development

Comments (5)

Permalink

MicroISVs and their blogs

It seems like every small software company out there has a blog these days. It’s become a requirement. In fact, most times these days the blog shows up before the actual product. But if you ask me, by and large it’s a waste of time. If you’re blogging in the hopes that it will attract potential customers or keep customers interested then you need to look long and hard at the kind of content you’re publishing.

Look, marketing is important - critically important to the success of your company. But if your blog is going to be a marketing tool, it’s got to be targeted at your potential customers. Your customers don’t care that you really liked some Joel on Software post. Your customers don’t care that you’re putting the finishing touches on some feature or that you contributed to some open source project over the weekend. Your customers want to read things they care about - not things you care about.

The key to a successful blog for a software company is one that truly provides value and connects with your customer base. If you are passionate about the subject of your software, then you have a good chance of writing a compelling blog which adds value on top of the software you sell. If you’re not that passionate, or if you suck at writing, a better approach would be to try and aggregate news articles or other industry/subject related blog postings.

At the end of the day, look at everything you do through the eyes of your customer. Is it valuable to them? If not, then you should stop and put that valuable time into something else.

Software Development

Comments (0)

Permalink

Idiot users? Nope. Just unfair expectations.

Mr. Angry over at Angry 365 Days a Year wrote a post titled Idiot users and how to deal with them. I think he starts off in a good way but I’d like to add a few comments to his overall message.

Whenever you encounter an “idiot” user, think about this. What if you were asked to drive a forklift? What if you were asked to replace the spark plugs in your car (are there even spark plugs in a car)? What if you were asked to field strip a M-16?

I had an experience as a kid that sticks with me to this day. I was staying with a great uncle of mine and was hanging out downstairs. He had a fireplace and at some point the fire died down to basically nothing. I didn’t even notice it - I was probably playing with legos or something. Anyway, at one point he comes downstairs and exclaims “You let the fire go out!? Boy how you been raised?” I’d never started a fire in my life much less understood that it was expected that I should keep it going in someone else’s house. But from his point of view I was stupid for not realizing what was a basic, fundamental part of life. Me on the other hand, I was upset that his opinion of me was now colored by what was really an unfair expectation/assumption on his part.

The point is, there are plenty of things we don’t know. And it’s not because we’re stupid, it’s just because we haven’t been exposed to them. Or maybe we’ve been exposed to them at a very superficial level, but we don’t interact with them with enough regularity to be comfortable. This is how many “idiot” users are with computers. It’s not that they’re stupid, they just aren’t as comfortable with computers.

And it’s more than just knowing enough about browsers to know that “Google” isn’t the “Internet” (it’s just the page that shows up by default Dad). It’s a very fundamental difference in language. Have you ever used the term GUI to a non-technical user? While they’re sitting there politely nodding their head they’re thinking “uh, why did this guy just refer to his program as having a rich GOOEY AJAX (when did cleaning products enter into the picture) driven interface?” And how about the term “interface”? To us, this is a no-brainer. It’s so common that everyone should understand it. But you know what, when you look at the definition for the word interface, our version is number 6 on the list.

So cut those “idiot” users some slack. Try and remember that they are probably very far out of their element and their comfort zone. Try and remember what it feels like to be out of your comfort zone and having someone judge you based on their standards - not yours. Try and remember that while they might not get computers, they are probably extremely good at something you suck at.

Edited 2/4/07 - added Mr. Angry’s name and link.

Software Development

Comments (4)

Permalink