Fog Creek Software, Inc.

Well, I’m now at Fog Creek. I love it here. The benefits they mention in their recruiting materials are all real and all great. I love the food, I love the snacks, I love the flexibility, I love the views of New York and the Hudson.
More important than that, I love the work.

Fog Creek

Microsoft

Over the last few years, working on Outlook at Microsoft, I became more and more aware of good engineering practices. At Microsoft, so much of product development is handled by others, that initially, it was easy to sequester myself in my office, write lots of code, then fix lots of bugs, and feel a certain sense of accomplishment. I had to learn what it meant to write code that could be localized, code that was considered to have quality, by the standards there. I also saw lots of code, much of it good and much of it bad. I became very familiar with old code and still managed to forget plenty of code that I wrote after only a few months.
But I also started learning about what good code could be. I started to develop a certain feel for good code, and also started to recognize the natural impediments to writing good code, some of which are inherent in shipping a product that people will buy. I learned about TDD and tried to practice it in my work. I shared the ideas and concepts with my team. I started to get impatient with pace of adoption at Microsoft, while at the same time recognizing some of the reasons it was slow as valid.
As I approached my 6 year mark at Microsoft, I really started feeling like it was time for a change, both professionally and personally. Our family was ready to live somewhere that didn’t involve 8-9 months of rain each year. So I started feeling around for jobs. The Fog Creek opening landed on my radar at just the right time and, long story short, I started on September 14th.
One part of that long-story-made-short bears mentioning. After making the decision to take the job at Fog Creek, I was once again impressed at what a great place Microsoft is. My coworkers and management were very supportive of both me and the move. I’ve reflected on my time there and feel very good about what I learned, what I accomplished, and the products and features I was able to work on. I would definitely recommend it as a great place to work.
I’ve had a few friends and acquaintances ask me how I went about making this decision, and I felt like it would be good to share some of the reasoning that went into it for others. I’m not going to write a “10 reasons to switch jobs now” list or a “7 reasons small companies are better than large ones” list or a “How to land a dream job in New York City” essay. Rather, I’d like to talk about how I see my career and hopefully pull out some universal principles for any career in software development.

Own your career

First of all, you need to own your career. I’m not going to go into a lot of detail on this one, because any good advice on careers in general, or software development careers in particular, will offer plenty of detail on this one. I just want to call it out as a necessary pre-requisite to all the other ideas.

Know what you want

As my wife will tell you, I don’t normally know what I want. I tend to be pretty ambivalent about a lot of things. About 6 months before this career change, however, I started taking about 30 minutes a day just to think about and write about my career. I went back over all the notes I’d ever written down, all the goals I’d ever considered, all the crazy ideas I’d ever had. I organized them all and tried to figure out what made me tick. This was a pretty simple exercise, easy enough to do before breakfast (what can I say, I’m a morning person). But it paid huge dividends almost immediately. I went into work more excited (still at Microsoft). More importantly, I started to really care about where I would end up. I don’t know if my 30 minutes a day strategy would work for everyone, but you really need to become passionate about something, or your career won’t go anywhere.
For me, that passion boiled down to becoming a software craftsman. Which leads to another important principle in creating your ideal career: strive to be your very best. I connected with the ideal of a being software craftsman, which is admittedly still being defined. Whether that includes TDD as pre-requisite, or whether that means trying to be a Duct Tape Programmer is secondary to the ideal of crafting the best code possible within a set of interesting, creativity-inspiring constraints.

Broad and deep

A few years ago I had some interesting conversations with a friend of mine about whether education should initially take a student deep or broad. I don’t know that we ever answered that question, but we both agreed that a good education is ultimately both. At Microsoft, as at most big companies, I got to go deep. I learned what it meant to work on a single code base, in a single language. During my 6 years there I worked on two or three major feature areas. So much of the product development and marketing was handled by others, and many of them I never met or knew. I was able to gain a lot of knowledge about a very limited set of technologies, product areas, and functional roles. A big part of my desire for a change, any change, was to do something new. I wanted to come to a small company so I could at least be closer to the sales, marketing, and customer support side of the business. I wanted to change my technical focus, and learn more about new technologies: web development, new languages, whatever. It was time for me to broaden my experiences.

Make incremental improvements

When I told my wife that I had submitted my resume to a company based in New York City, her first reaction was incredulity: “New York City! I never want to live there!”.  I assured her it was just for interview practice, because I felt the same way. I bring this up because sometimes our career goals will take us unexpected places. I personally would love it if Joel woke up one day, realized how much more profitable Fog Creek could be if it were based in Fort Collins, Colorado, and decided to move the whole company there. But I doubt that will happen. And that’s ok. I realized, and so did my wife, that we weren’t going to get the perfect situation at this point (especially in this economy). We knew even before the job search began that there would be some compromises. As it is, I’m extremely happy with the compromises we made, and we’ll probably be at Fog Creek for quite a while. I expected to give up more and not get as much. But no, we don’t live in New York City. They couldn’t handle our three boys, so we’re actually enjoying a great place in New Jersey.

Sometimes, be the worst

I know this advice has been around for a while in the body of software development career advice (links!), but that’s another reason I made this move, and it’s already started to bear fruit. I was by no means the best on my team at Microsoft. But I’d been there a while and I was too comfortable. I knew, coming to Fog Creek, that it would not be comfortable, that I would stretch myself technically, socially, and in other ways. But that wasn’t just something I had to live with. It was a necessary change for me, one that I looked forward to. It was time to grow, to learn, to stretch.
In saying this, I recognize that you probably shouldn’t go through your whole career this way. It would probably get pretty depressing if you always felt that you didn’t quite measure up. Plateaus aren’t bad things, they allow us to step back, to look over the things we’ve learn, to rest and recuperate in a way. And being the best is also a valuable position to be in, when you can mentor others and learn from their fresh new ideas.

And so…

At this point, I’m very happy with the move. I’m excited to be working on Fog Creek’s new product, Kiln. I’m just as excited for the new version of Outlook to ship, and am itching to get my hands on a copy of Windows 7.
Life is good.

Whimsical Walk

In my last post I mentioned that I was doing some practice with the binary search algorithm. I wanted to approach it with a slightly different mindset and see what kind of an algorithm that led to. So I decided to think of it as a walk. I would go “visit” locations in the array and see if I should turn right or left at each one. Doing this in C meant that I could do some crazy stuff with arrays – nothing I would do in shipping code, but fun to play with nevertheless. Here is what I came up with:

 1 char ChopWalk(int value, int *array, int size, int *poffset)
 2 {
 3     int walkto = size / 2;
 4     int direction = 0;
 5     char found = 0;
 6 
 7     if (walkto == size)
 8         return 0;
 9 
10     if (value == array[walkto])
11     {
12         found = 1;
13         direction = 0;
14     }
15     else
16     {
17         if (value > array[walkto])
18             direction = +1;
19         else if (value < array[walkto])
20             direction = -1;
21         found = ChopWalk(value, &array[walkto + direction], direction * (size / 2), poffset);
22     }
23 
24     *poffset += walkto + direction;
25 
26     return found;
27 }
28 
29 int Chop(int value, int *array, int size)
30 {
31     int result = 0;
32     if (ChopWalk(value, array, size, &result))
33         return result;
34     else
35         return -1;
36 }

Practicing Binary Search

So for the last couple of weeks I’ve been practicing the binary search algorithm, as laid out by Dave Thomas here. I’ve done both iterative and recursive variations in C++ and then in C. I love the value of katas for learning new languages and features. I know both C++ and C, but doing this simple problem in both programs allowed me to work on learning new areas in each. First, in C++ I took the time to use the standard template library (stl), because I’m not very familiar with it. I just used vectors in my tests, but it helped me to become familiar with the stl documentation and the concepts of iterators as used in the stl.

Next, I did the same variations in C. This was fun because C is so basic, and it’s been a long time since I coded in straight C. You don’t worry about concepts like objects or functional programming (though they may help you think about the problem). It gets you really close to the underlying physical model of computation. You’re forced to think more about how the memory is laid out, and how the algorithm takes advantage of that, whereas with C++ and the stl the whole problem and the solution are more abstract, just slightly more removed from hardware.

In addition to the languages themselves, it’s also a chance to practice my use of tools. I used the work to hone my skills in vim, to understand our build system at work more fully, and to consider testing frameworks.

Practicing Prime Factors

Uncle Bob’s tweet from a few weeks opened my eyes to the value of practice in honing my development skills, and led me to read a lot more about practicing and code katas. One of the things I love about having a kata, like the prime factors kata, is that you can focus on different skills and techniques each time through. You can do it in different languages, with different testing frameworks, using different text editors or build systems, on different operating systems, etc. I’ve done it a few times in the last few weeks, mostly in C++ (my current language for work projects). But I’ve used Visual Studio, vim, my work’s build environment, and other variations. I still haven’t used a decent testing framework, but that’s one I want to add.

Having gone through the prime factors kata a few times now, there are some changes that I feel should really be made near the end. Ok, the rest of this post isn’t going to make much sense until you at least read through the prime factors kata. Go do it now.

Commenters rightly pointed out that having the additional

if (n > 1)

clause added in test 4 isn’t intuitive and violates the TDD principle of just adding enough code to make the tests pass. But they then added the caveat that without it the step to loops and the candidate variable in test 7 is pretty big for the refactoring step, mostly in terms of the mental leap. I agree.

But if you really do the easiest thing you can as you add tests, you don’t run into that problem at all. The key is when you get to the test for finding the prime factors of 9 (i.e. the seventh test in the slides). The slides have you first creating a variable, candidate, to represent the number 2. This may makes sense as a refactoring step done before writing this test, but lets ignore that for now, and assume you haven’t done it. Then the easiest way to get the seventh test passing is just to copy the entire while loop below itself and change the 2’s to 3’s. Not only is that dead simple (Ctrl-C, Ctrl-V), it also makes the following steps much more obvious. At this point it’s easy to see how important the candidate variable is, so you create it, and increment it between the two while loops. Then the two while loops are identical so you just nest them inside another while loop. The remaining refactoring work to for loops is the same as the slides.

Speed up Tasks on Your Windows Mobile Smartphone

One of my biggest frustrations with the Windows Mobile task application is that it synchronizes your completed tasks. After a while, this greatly outnumbers your active tasks, making the task app really slow. So I periodically move my completed tasks to a separate task folder (I like to have them around for searching). Alternatively, you could just delete them once a week or so. The following Outlook macro code can be used to move all the completed tasks in your tasks folder to the first tasks subfolder.

    Dim fld As Folder
    Dim fldComplete As Folder

    Set fld = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderTasks)
    Set fldComplete = fld.Folders.Item(1)
    For x = fld.Items.Count To 1 Step -1
        Dim objTask As TaskItem
        Set objTask = fld.Items(x)
        If (objTask.Complete) Then
            objTask.Move fldComplete
        End If
    Next x

Platforms vs. Solutions

From http://www.flickr.com/photos/tripu/Jeff Atwood recently discussed The Dark Side of Extensions, and advocated taking the five most useful popular extensions to Firefox and integrating them into the product as features. Before the Firefox team decides to go do that, it might be useful for them to step back and consider what they want Firefox to be: a solution or a platform.

The platform vs solution question eventually rises in any successful software project. The reason is that successful projects are used and usually by a lot of people. The more people use your software, the more people want to change it to fit their particular needs, address weak areas in the product, or adapt it for new uses. Once this pressure starts being applied, from your customers, you have a choice. You can hire extra people, work extra hard and try to take care of the most frequently requested changes as quickly as possible. Or you can do the work to make your software “extensible”, essentially to turn it into a platform. Of course, you can also do something in between.

The most obvious example of a platform in software is the operating system for a personal computer. Windows, Linux, and Mac OS X, are all platforms for personal computing. Of the three Linux is probably the most pure as a platform. Mac OS X is the least pure, because Apple sees it more as one part of a larger solution that they offer to users, and so don’t give their developers the same level of support that either Microsoft or the open source community does.

Those who advocate a pure platform approach like Linux, because you can include or exclude “bloat” (i.e. features) that you never use. This was very apparent in the comments to Jeff’s post, where tons of people said, in effect, “I don’t want a bloated browser like IE or Opera – I just want it to include the things I use.” Mozilla is definitely going down the platform route with Firefox, and the users who therefore choose Firefox reflect that.

Microsoft tends to take a middle of the road approach with its software. Windows and IE both attempt to be solutions and platforms at the same time. And both had great success because they got the killer “apps”: Windows had Office and IE had all the websites that only worked in IE for years. Heck, even now my wife won’t switch to Firefox because some pages “don’t look good”, despite Firefox’s apparently better support for standards.

Apple obviously approaches the problem by trying to produce a solution, and that has been extremely successful for them in certain markets (can anyone say iPod? iPhone?). In the past they haven’t had as much success as a platform, so it will be interesting to see how the new iPhone SDK works out for both Apple and it’s developers.

Ultimately, I’m not sure that creating a platform for end-user extensions is the right way to go in the browser market. Platforms are market makers. Windows created a huge market for all types of software by creating a successful platform for personal computers. The real market that browsers enable is the market for cool web sites and services, not the market for browser extensions (how many browser extensions are profitable products?). A browser needs to focus on becoming a platform for web sites and services, and becoming an easy way to get to those for end users. Browsers are not the only user interface to the internet, but they are the primary one and can remain so only if they provide an excellent platform for creating web sites. Of course, there are huge problems in trying to do that. But if a browser can do that, in a way that gives it a competitive advantage, it will become the platform for the web and be more successful, and probably more profitable, than Windows.

How to Get More Done and Be Happier

So I realized the other day that I was getting up at the same time each morning, doing more, and getting to work earlier. I thought I’d share how I did it. First, you should know that my morning routine is important. I try to spend some time praying and studying the scriptures, plan my day, then do the standard stuff: eat, shower, spend some time with my family, and leave for work. In the past I always got caught wasting time in the middle of all this following blogs, watching new movie trailers, reading a good book, or getting distracted in any number of other ways. I knew it was a problem and I tried to fix it by “focusing” more, pushing through the things that were important, etc. It never worked for very long and my old habits came back.

But I realized this morning that all that changed a couple months ago and I didn’t even notice. I now get to work earlier, get more done in the morning, rarely give in to the distractions, and, most importantly, feel way better about the way the day is going as I arrive at work. This means that my “private victory” each morning is happening. Instead of arriving at work feeling like a failure because I’m late, or because I didn’t get anything done before coming in, or whatever, I now get to work and I’m able to focus on my work, knowing that all that morning stuff got done.

You’re probably wondering what my secret is.

And you’re getting mad because I’m dragging this out and not telling you.

Ok, I’ll tell you.

I decided to do more.

Yep. I decided I just needed to add a few more things to my morning routine. Ok, actually just one thing, but it usually takes 30-60 minutes. Despite that I’m getting more done, going to work on time each day, and doing so with more energy. You may wonder what this magical new activity is. But there is nothing magical about it. Unless it’s magical because I really like to do it and I’ve made a commitment to do it. But everybody has something like that. I think the only magical thing about it is that I decided it was important enough to do each day, and do early to make sure it happens.

For me, it’s running. Yep, I’ve been going running each morning for the last couple months and I’m still doing all those other things, and I’m getting to work earlier. I’ve run a couple marathons and loved to run in high school, but it’s been years since I ran regularly or towards a goal. But I’ve committed myself to run a marathon by the end of the year, and I’m on track. I’ve run 46 days straight without missing a day (excluding Sundays). I’ve worked up from my first week’s mileage of 5 whopping miles to 12 whopping miles. That doesn’t seem like much, but it’s part of my commitment to keep going. I’m NOT going to increase mileage so fast that I get burnt out, injured, or bored. I’ve also found a friend to run with in the last couple weeks and that has helped me to keep going.

Of course, if you want to get more done in the morning running probably isn’t going to cut it, though it might. The key is to find something that is important to you that you’re not prioritizing like you should. For me, it was running. For you, it might be photography, or practicing an instrument, or working on a coding project on the side, or riding your bike, or reading great literature (or not so great literature), or woodworking, or whatever. The main thing to recognize is that when you put your priorities in the right order, life is just smoother. The important things get done, the less important things are more clearly less important, and you’re happier about everything you do. By starting your day with the “first things first” you set the tone for the whole day. And anticipating that each night can make it easier to prepare accordingly. I’ve started getting all my running gear ready each night, and I’m going to bed earlier so that I’m ready to go when the alarm goes off.

So now it’s your turn. Ask yourself: what do I need to make a higher priority in my life? How can I work on that a little each morning? And then go do it. You’ll be happier.

Administrator in Vista

ChessSo I’m working to setup my new “dev box at home” with Vista and finally noticed that there was no administrator account. That was not something I had heard about, but have since found quite a few articles referring to the change. It was interesting to see what the reasoning was behind the change, as well as the attempts of some to re-enable it for all the wrong reasons (like to get rid of UAC).

Based on this post at the Vista security blog, it appears that they’ve thought through the decision and all the interesting test cases fairly well. The one point I’m hitting is that I also have a Windows Home Server. On my other machines (XP, Media Center) I have the normal family accounts plus an Administrator account, each of which has some permissions on the WHS machine. This makes it easy on any machine to do administrative work on both the machine and the server. I found out about this whole no administrator thing when I tried to login (doh, where is it) and then create (can’t create an account named administrator) that account. Turns out it exists but is disabled.

Although it is fairly easy to enable the Administrator account, I’m not really sure if I should. It doesn’t have UAC enabled by default, but I can enable that. However, the fact that it’s different from other admin accounts makes me wonder if there are other differences that I should be aware of. I’ve been using Vista off and on at work for the last year and a half, and I haven’t noticed the need for the original “administrator” account until now. The alternative to enabling it would be to create a new admin account on all the other machines.

I think I’ll actually go that route. I like to have control of things, and being forced to create an account like this when I get a new machine is a good reminder of the bigger world of security issues that I need to be aware of. I should also note that despite the new UAC features in Vista, I’ll still be maintaining separate admin and user accounts. Though my wife sometimes gets annoyed when not running as admin I remind her that it’s kept our computers very safe over the last few years.

Building a Windows Home Server

WHS Parts

Around September, Kami and I decided we would dedicate some money to replacing our dying backup server. It was nothing fancy, just a simple box that backed up important stuff via FolderShare and provided access to our printer. With the impending release of Windows Home Server it made a lot of sense to just wait a bit and setup a new box with that for backup, printer sharing, and away-from-home access. A friend of mine had recently tried to convince me to start building my own PCs for the savings, the customization opportunities, and the ability to build something more likely to last longer. So after thinking about it a bit I decided to do just that, instead of just getting the HP MediaSmart Server. I’ll outline the process of building the box in this post, and later talk about installing and setting up the software.

You can see the computer I got as a NewEgg (but without the motherboard, which is no longer available). Some of the things I wanted over the MediaSmart server included dual hard drives with more total storage space, a faster, upgradeable processor and motherboard, and 1G of RAM instead of 512 MB. What’s cool is that I got all this for less than the price of the cheaper MediaSmart server.

WHS Assembling

So, everything finally arrived and I found an evening to put it all together. I basically followed the instructions that came with each part and used Jeff Atwood’s excellent Building a PC series to direct my efforts. I skipped the overclocking, since I don’t really care about that at this point, nor do I have the time to really put that kind of effort into this PC. However, I may do it with the new dev box I’m buying for home use next month.

WHS Assembled

I got everything set up and connected, and it worked! I have yet to install the software, because I have yet to get the software. I planned on using Microsoft’s company store to get a nice discount on Windows Home Server, but they’ve been out ever since I started working on this. And the discount is big enough that I can wait, praying that our old backup server doesn’t totally die in the meantime. So I’ll post about that soon.

Why Keyboard Shortcuts Don’t Matter

Photo taken by http://flickr.com/photos/cc511/So, my last post was all about how I’m trying to become more productive by learning a set of keyboard shortcuts that I can use for faster text/code editing. In this post, I’m going to argue against the premise that it could actually make you faster. The reasons I’ll outline include opportunity costs, lack of portability, anything else? Well, we’ll see, won’t we.

First, opportunity costs. Yes, the dirty little secret about using keyboard shortcuts is that it takes time to learn them. The same could be said of command line interfaces. The main reason that most users (i.e. non-power users, those poor souls) don’t use keyboard shortcuts, or command line interfaces, is because of the learning curve. And there is an obvious learning curve. I’ve spent too much of the last couple days working to remember the keyboard shortcuts and use them a lot so I can make them habits. “But wait!” you say, “It’s an investment!”. Sure, ok, I can buy that. Now let’s look at the numbers to see what the payoff on that investment is. This page seems to indicate that you could save 16 hours a year by using keyboard shortcuts. Two whole workdays. Um, that’s not much when you consider that it probably takes more than two full workdays to develop the muscle memory needed to really gain that much time savings. So you won’t really start to see a return until you’ve been doing it for a couple years. Of course, others state that the mouse really is faster, so I’m not sure why I even argued that point. Okey, I know, the point is that the mouse is faster for people who haven’t yet built up that muscle memory. But then again, maybe not.

Ok, now let’s talk about opportunity costs. What else could you do with the time invested in memorizing keyboard shortcuts and making their use habitual? Wisely invested, a few days each year could let you read lots of books, take training courses or attend seminars, develop personal productivity tools (more on this in a future post), start learning a new programming language, or listen to the 1000 songs that can fit on your iPod nano. Doh, I mean your Zune.
Anyway, the next challenge is portability. Sure, you might learn all the cool keyboard shortcuts for vim, or emacs, or Visual Studio, or whatever. But you can’t then use them in the others, or in Notepad, or a web browser, or a mail program, or whatever. Even the really basic navigation ones, much less the more interesting ones and potentially useful ones. This actually makes using other programs more difficult once you’ve mastered a lot of app specific shortcuts. Unless you want to go the route of the “Emacs As Operating System“, which may actually have benefits, but only for a very small subset of people.

Basically, those who would use Emacs As Operating System are people with a great memory. Those who can memorize, either in the head or in their muscles, thousands of useful commands. The rest of us are ok with a JIT use of commands. We find them and use them when we need them. Keyboard shortcuts are useful for commands we use more often then once an hour. That can actually include quite a lot of commands if you’re a developer who lives in a text editor of some type most of the day. But it probably doesn’t extend much beyond that. And trying to develop muscle memory of commands used less frequently will be very difficult.

Wow, I think I talked myself out of my latest project. Guess I’ll have to go find some other way to save 16 hours a year…