Monthly Archives: April 2009

Viewpoints

Recently, I’ve been spending quite a bit of time thinking about viewpoints.  It is something I’ve never really paid much attention to, thinking that it was just one of those things.

The more I think about it, the more it travels up my ToDoList to think about it more.

Why am I blogging about this?  Well, during my day job, I have many conversations with many different people – often these are within meetings, but this also includes water-cooler chats, email, and many more forms of communcation. During these conversations, I’m increasingly finding that it is important not only to understand my viewpoint (and here I mean view position, rather than point-of-view), but also the viewpoint of the person I’m communicating with.

It is fair to say I’m a bit of a scatter-brain.  I have lots of ideas all whizzing about, competing for attention, and generally distracting me from what I’m actually meant to be doing.  I’ve found the best way to separate these two activities is to ensure I allocate enough time for them, and put myself in to the environment that suits the activity best.

In very general terms, I love getting started on something new, but  struggle to take that thing to completion – I usually get to 80% completion, and start to get bored.  I suppose that suggests that I’m better at the high-level concepts, than the low-level details.  Some people are much better at focusing on the low-level details and ensuring that are completely finished – but don’t like dealing with the fuzzy high-level things.

I know this is a huge generalization, but I think time spent understanding your own and your collegues viewpoints, can go a long way to helping you move ideas and solutions forwards.  Otherwise, in my opinion, things get stuck in a cycle of repetition.

Writing Skills

For a long time, I’ve been confused by the lack of taught technical writing skills. A fundamental role, in my opinion, for a Software Engineer is to be able to communicate ideas, designs, and results, in written form. Without good technical writing skills, this good-practice can easily invalidate itself.

When I was going through school, I always struggled with my writing. There were so many variances that it seemed, to me, to be a complex task. Whereas with coding, it has always felt very natural. Both are governed by rules and recommendations; both are precise and creative at the same time; I wonder what the difference is. My difficulties with writing definitely helped me choose my current career path; where essays and long reports were seldom required.

Having read many technical documents over my career, there has been a very noticable difference in readability. I’m sure the technical documents that have been hard to read are mainly due to poor technical writing skills, rather than poor ideas or designs.

With increasing reliance on writing to communicate designs, I think it is more important than ever to improve our technical writing – which seems conspicious by its absence in all of the technical training (both formal and informal) that I’ve encountered.

The best advice I’ve had, is:
* Keep it simple,
* Use short sentences,
* Avoid unnecessary language,
* Read ‘The Elements of Style’.

The Zone

I’ve spent a period of time today working on a new tool to help me with my current development project. 

Before I started, I had a pretty good idea of what I was going to create.  But as I always do, I sketched a few ideas out in my journal.  After this I got stuck into coding and before I knew it, I was ‘in the zone’. I was oblivious to everything around me, and was entirely focused on this single task.  Thankfully I work in a quiet (and fairly small) office, which means it is much easier to avoid distractions.

In the ‘Peopleware’ book, a significant proportion is devoted to the office environment, and how to ensure that productivity is not hampered by poor (or lazy) office layouts. I’m almost certain, that if I had been working in a larger (and therefore more distracting) office, I wouldn’t have made anywhere near as much progress.

Another interesting point made in the ‘Peopleware’ book is that you can’t fake quiteness – listening to music (to drown out the office noise) has the side-affect of reducing your creativity (due to the part of the brain involved in music listening and creativity).  It is interesting stuff – but as Google supposedly uses the open office policy, perhaps not quite accurate.

What type of office do you work in?  How are you affected by it?

 

[Edit: For some reason, my blog lost the original post, so I'm re-posting the contents.]

Code Swarm and TFS

You may (or may not) have seen a CodeSwarm video.   If not, here is a link.

I like the idea of these videos (although I’m not exactly sure why). I thought it would be interesting to see a video for the source code at my place of work.   We use TFS, and from what I could find, there was no existing code to hook TFS to CodeSwarm.   As such, I spent a few hours working around the TFS SDK to see if I could solve it.  My code and notes are here – hope it is useful.  If you do like it/use it/modify it/improve it, please let me know.

[Note: I only started using the TFS SDK this evening, so I may have done it the wrong way. Also, but using the ChangeSet check-in time, it means a number of files are groupped with the same time - not ideal, but I suppose it is accurate.]

This requires a C# Console application – see the foot of this post for the code – to connect to your TFS server, and extract the data.  This will output an XML file containing the changes.  This can then be used with CodeSwarm to generate the video.

You’ll need to download and install the relevant pieces for CodeSwarm (available here).

Steps:

  • Use the output from the C# application to generate a file called “TFSExport.xml”.
  • Copy ”TFSExport.xml” to your “$/CodeSwarm/data” directory.
  • Update ”$/CodeSwarm/data/Sample.config” file to reference “TFSExport.xml”
  • Run the CodeSwarm toolkit (“run.bat”).
  • Voila!

The default CodeSwarm config needs some tweaks to get a good video.  If you have any suggestions, please send them to me.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.VersionControl.Common;

namespace TFSToCodeSwarm
{
  class Program
  {
    public static void GetChanges( string _tfsServer, string _tfsRepository, string _versionFromString )
    {
      //connection to TFS Version Control
      TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer( _tfsServer );
      VersionControlServer vcs = (VersionControlServer)tfs.GetService( typeof( VersionControlServer ) );

      // Null means *all*
      VersionSpec versionSpecFrom = null;
      if ( null != _versionFromString && "" != _versionFromString )
      {
        versionSpecFrom = VersionSpec.ParseSingleSpec( _versionFromString, null );
      }

      System.Collections.IEnumerable enumerable = vcs.QueryHistory( _tfsRepository,
            VersionSpec.Latest,
            0,
            RecursionType.Full,
            "",
            versionSpecFrom,
            VersionSpec.Latest,
            Int32.MaxValue,
            true,
            true );

      Console.WriteLine( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>" );
      Console.WriteLine( "<File_Events>" );

      foreach ( Changeset changeset in enumerable )
      {
        foreach( Change change in changeset.Changes )
        {
          long numSeconds = (long)(change.Item.CheckinDate - new DateTime(1970, 1, 1, 0, 0, 0 )).TotalSeconds;
          String strItemName = change.Item.ServerItem.Replace( '&', ' ' );

          String strDetails = String.Format( "<event author=\"{0}\" date=\"{1}\" filename=\"{2}\" />",
              changeset.Owner, numSeconds,  strItemName );
          Console.WriteLine( strDetails );
        }
      }
      Console.WriteLine( "</File_Events>" );
    }

    static void Main( string[] args )
    {
      if ( 3 == args.Length )
      {
        GetChanges( args[0], args[1], args[2] );
      }
      else
      {
        Console.WriteLine( "\nUsage: TFSToCodeSwarm <SERVERURL> <REPOSITORY> <STARTDATE>\n" );
        Console.WriteLine( "\nExample: TFSToCodeSwarm \"http://tfs\" \"$/SourceCode\" \"D03/02/2009\"\n" );
      }
    }
  }
}

Information Overload

I’ve been using RSS for a number of years.  As soon as I saw the concept, I was hooked.  Even to the point of developing my own RSS Reader (in C#), which I used for a while.  Given that I’ve been using it for a number of years, I’ve amassed a large collection of subscriptions, and am now struggling to keep on top of it all.

Everything I’ve added to my collection will have been because I found something useful on that site at the point I added it.   But looking over them now it is hard to determine if I’m still interested in it – and if I’m not, will I be interested in a future post.  The problem therefore is, do I:

  • Remove feeds to reduce the amount of content,
  • Only read posts from the last x days,
  • Keep everything, and try and read all of the titles.

Why am I blogging about this, well with so much information, I can forsee a time where every company has their own department entirely purposed with agregating information (whether it be from the internet, books, radio, speeches, etc…).  This happens to some degree today, on an adhoc basis.  With more and more content being produced each day, this is going to require a more formal process.

PS: One huge problem I find with blogs, is that there are a large number of posts that are merely links to / copies of other posts.   Maybe a good starting point would be for an application to remove this duplication.

My Computer History

I’ve always been interested in computers.  It started as a child when my dad bought a Amstrad CPC 464 computer – Wikipedia.  Apart from the obvious “HelloWorld” coding, my first really useful bit of development was when my dad bought a disk-drive for the Amstrad (the 464 was tape driven).  He’d already bought a word-processor – from Dixons if I remember correctly – which was on a tape.  When we got the disk-drive, I managed to hack into the word-processor code (using the equivalent of Ctrl-Break, which as the source was loaded into memory, gave you direct access to it), using this I re-worked it so that it would use the disk-drive.  Not spectacular, but I was impressed with myself, and was intregued by what computers could do for me.

I remember going to my local library and looking for books on programming – there never seemed to be any.  Compare that to today when they is so much information it is a challenge just working out what is useful and what is not.

After the Amstrad my dad got a PC.  An ICL  286, with 100MB hard drive – which had to be partitioned into 32MB blocks.

Eventually, I ended up at University of Manchester, studing Computer Science.  I had a great three years and left with a top degree.  Following this I spent 9 months working for a company supplying solutions to the MoD, I learnt a bit, but was really frustrated that I couldn’t just do things – so I left.

I then moved into the Telecoms sector, developing technology to process, consolidate and manage call records.  I really enjoyed this job, but unfortunately my office was closed as part of the telecoms crash of the early 2000′s.  Within a few weeks of my redundancy I’d managed to get a job at a security firm (SurfControl), which was developing solutions for the Windows platform.  This was the first time I’d developed anything for Windows, and it was to be a steep learning curve.  My first piece of code for this company was fairly rubbish, but I learned a lot from this experience.  Given the sector we were in, and the solutions we were developing, we were all exposed to some pretty interesting and complex stuff.  After 5 years at this company, and learning a great deal, I was again made redundant (due to the company being bought by our nearest competitor).

My next employer is also my current employer.  For the first year I worked on a client side virtualization technology – exposing me to the compexities of working inside other peoples software.  I’ve since changed roles, and am now the Software Research Team Lead.

At home, I use an iMac – which feels completely different to Windows, I’ll write a post in the future with my feelings about the two different platforms.

I hope this gives you a bit of background about me.  If you want any more info, let me know and I’ll follow up with a more detailed piece.

Vague APIs

I’ve spent a significant number of hours over the past few days trying to determine why an API call was failing. In the end, the change required was simple, but getting to that point took lots of tweaking and messing about. I tried all sorts of convoluted approaches, trawled the internet, and read all of the available documentation.  If one of those had resulted in a hacked solution that worked I may have used it (not knowing that there was a simple and easy modification required).

I wonder how much of core application development also follows this approach and ends up much messier (and harder to maintain) that it would have done if the problems encountered were much easier to address and resolve – irrespective of the intentions of the authors.

I suppose this comes back to my previous post of Support/Self-Fix – but APIs are the fundamentals of Software Development, and the authors have a duty to ensure that they explain exactly why they can fail (and how).  Either that, or release the source code so we can work it out for ourselves.