Talking @ NDC 2011

I am really looking forward to going to the Norwegian Developers Conference this summer, and very exciting to be given the chance to speak at the conference together with two of my colleagues.

This is the abstract of our talk:

Modernizing a large desktop application through vertical porting

Schlumberger’s market–leading desktop seismic–to–simulation software Petrel® helps geophysicists, geologists, and reservoir engineers maximize oil and gas reservoir performance. The first version of Petrel was launched in 1998 and was developed using C++.  During the past years, Petrel has gradually adopted C# and .NET technologies through a new managed API, called Ocean, which is built on top of the legacy C++ core and facilitates plugin development.  However, significant parts of Petrel still use a stack consisting of C++ for business objects and C++⁄CLI with Windows Forms for the UI (which is also used in the pure C# parts). In order to utilize new technologies such as WPF, increase developer productivity and decrease maintenance cost, replacing the old C++ and C++⁄CLI stack with a pure C# stack as much as possible is desirable.

In this talk, we describe how we did a vertical port of a subsystem in Petrel, the Seismic Attribute system, from a C++⁄CLI⁄Windows Forms stack to a new managed architecture using C# and WPF. Doing a port vertically means porting the entire subsystem at once rather than porting each layer separately. The Seismic Attribute system consists of user interfaces, storage, advanced algorithms and an external interface which enables plugin development of new algorithms with custom user interfaces. Porting the old C++⁄CLI–based system to a new managed architecture is thus no small undertaking.

We will describe the considerations which led to us doing the vertical port versus keeping the legacy system, the WPF–based Model–View–ViewModel (MVVM) design of the new system, how we integrated our new architecture with the rest of Petrel, how we collaborated with teams doing ports of other parts of Petrel, new innovations resulting from the porting work, and – most importantly – mistakes and lessons learned.

Advertisements

Clean Code

“A Handbook of Software Craftsmanship” – this was the intriguing subtitle of Robert C. Martin’s book “Clean Code” that I picked up at the JAOO conference in Århus, Denmark, last October.

The book really served as an eyeopener for me, and it made me think about how I can improve in my craft as a software developer, and how I can help the people around me improve.

There are a lot of problems that can arise in your code if you are not careful when writing it. The book brings many different heuristics for how to make your code better, and I recommend it for anyone writing or reading software.

So how can we become better at writing clean code ourselves?

I think the first step is to become aware of the problems, and to see examples of both bad an good code. A book like this can of course help with that, but I think it is very important to have a forum where you can discuss coding techniques and issues with others. In our office, we’re trying to get this by having a software craftsmanship study group where we, about once a month, get together and discuss topics about our craft. We’ve started by going through the chapters of Martin’s book, and it has been creating some very good discussions so far.

I’ve noticed that since I’ve started to think more about clean code, I’ve changed my view of coding. Code that I used to find quite good doesn’t look so good any longer now that I’ve learned how much better it could be. I really appreciate code that is readable and maintainable, and I find that these factors usually are more important than other quality attributes like performance. This is of course not always true, but a great deal of our code is not run in critical inner loops, and I would much more have it well readable and maintainable than super fast.

Kindle on the road

I promised to say a bit more about how I liked the Kindle after using it a while. I must admit that it haven’t been used very much at home, mostly since most of the books I’ve read lately haven’t been available on it. I’ve been reading books about software development, and thought there are a few on the Kindle, it seems that there are still quite a few that’s missing.

But recently I was away on a 10 day vacation to the US. I had a little while ago started Asimov’s “Foundation” on the Kindle, and thought a long vacation would be a perfect opportunity to finish this book. I pretty soon found that travelling with the Kindle is brilliant. I had a long layover in Copenhagen, and go to read quite a lot of the book, so much that I was getting afraid that I would be out of reading material during the upcoming flight to Newark, should I continue to read all through it. But it was very easy to turn on the wireless on the Kindle and then buy the next book in the series so it would be ready.

The main downside from reading a paper book that I noticed when travelling, was the fact that I had to turn it off during takoff/landing. Otherwise, it was a very nice reading experience. I also like the fact that I have a dictionary available, should I come across a word I don’t understand, or want a better definition of than I can get from the context.

Kindle

22/11/2009 1 comment

Amazon just recently started selling their Kindle ebook reader outside of the states, and I decided to get one. The ordering was pretty slick, and it took just a few days before I had the reader in my hand – the speed of the shipment from US to Norway really impressed me.

I like reading on it – particularly in bed. It is better than reading a book, as I don’t have to fold the pages, and it doesn’t slam shut when I fall asleep in the middle of a page. I also like the reading technology – the electronic inc seems to be working nice.

I think the wireless solution is brilliant. It is very convenient to be able to get books almost anywhere you are.

But I have yet to read very long on it. So far it has been used for my bedside reading, and I tend to fall asleep after a few pages. But I am sure that I will love it the next time I have a long flight.

I will update here when I get more experience.

Categories: Books Tags: , ,

I Am Not What I Code

While driving to work one morning last spring I was listening to a political program on the radio. There was a debate about a report the government has presented to Stortinget, the parlament. Two politicians where in studio, one from one of the governing parties, and one from the opposition, from the concervative party. What struck me was how unwilling the person from the side of the government was to listening to critisism.

Naturally I wrote it off as her being a politician, not willing to see the other side of the matter. But somehow it sounded like there was a bit more to it.

After a while it struck me – she had probably been involved in the work to create the report, and the other side was picking it apart, saying that the handcraft of the work was not very good. On some level she must have been reading the attack on the report as an attack on herself, probably unconciously. So she became very defensive, and would try to attack the opposition instead of answering the critizism or admitting that they could do some things better.

This made me think about how we work in software development. A healthy development process should always encourage team work using tools like peer reviews and formal tecnical reviews, and maybe even doing the coding together in pairs or teams.

The idea behind this is that more minds are better than one. Even if I am very good in one domain, I might not always have the best idea. Having someone looking over what I design or code, could trigger an idea in their mind, an idea that I never would have thought of.

But when these tools haven’t been in use regularly, you risk ending up in a situation where people have very strong feelings about their own code. They would object if someone else suggested any changes or wanted to remove their code – not because the change or removal is wrong, but because it makes them feel bad.

It’s not hard to understand those feelings. I know that when I have worked hard on something, it don’t feel good to learn that there is no longer any need for it. But that is the reality. We have to be agile and allow for change when making software, that also includes living with the discovery that something we’ve coded no longer is needed.

What’s important is to not let ourself or our self worth be defined by what we code. If someone is criticizing something I’ve coded, I should listen to it and allow them to come with their thoughts about it – not take it as a criticism of me as a person.

How can we get to a state where this is natural? I believe that having regular code reviews and shared ownership of the code would help getting people out of their silos. If we can get in the habit that all code is something we can improve on, and direct our pride against the wellness of the complete code base and the great working end product instead of the “brilliant” pieces of code that I wrote, I think the end result will be much improved.

Basically I think it comes down to having a strong team feeling.

More about Social Networking tools

In my last post I wrote a little about networking tools like Facebook and LinkedIn. I also posted a picture of the network of my friends, and how they are connected between themselves. Each of the dots in the graph represent a friend, and the edges represent a connection between two of them. Stronger colored connections means that the people also have other similarities besides being friends with me and each other – like being fans of the same thing or belonging to the same group.

Here is the same graph arranged in a different way, and with light colors:

My Facebook friends

My Facebook friends

This form of the graph shows the clustering better, but the individual edges between the persons are harder to see. In the application, you can hover any one of the dots, see who it represents and also see which of the other dots are connected (that is, which friends that person has in common with me). Naturally there are no dots representing myself in the graph, since that dot would be connected to every other.

I found this interresting application through the article “The convergence of social and technological networks” by Jon Kleinberg, posted in the November 2008 issue of Communcations of the ACM. This is a very interesting article describing how small the world has become due to these social networking tools (at least for those using it). Just think about how fast some things spread on sites like this – be it a funny video or a rumour, or some strange applications.

When you look at the picture above, you see more than one cluster. When one of my friends on Facebook post something, it will appear in my news stream. If I then like it, I may comment on it, or maybe even post it myself. Or if it is a group someone joins, I join it to. Many of the others in the same cluster as the initial poster have seen it before, and so they will then see it again – but the interesting thing is that so will all those of my friends who are in different clusters (and of course those in the same clusters with no direct link to the initial poster). So when my Facebook friends also sees this – they might find it interesting too (given that any of my friends share my interest – which isn’t that unlikely), and so the snowball can roll on.

The article mentions how this reminds us of the concept of “six degrees of separation” – a term originating in a play by John Guare, based on the 1960’s research of Stanley Milgram. In this research, people were asked to try to forward a message to a given person which they did not know, only by passing it through people they knew. It turned out that the median of steps the message went was only six.

I’ve often heard this theory reffered to – people saying that “you can get to anyone in the world by just six steps!” – it is probably an exaggeration, at least if you base it on the research (though I think it’s thought to be an average – implying of course that there are many people who are more than six steps away since there are  a lot of people less than six steps away) – but often you will see that the number of steps to go from one individual to another is surprisingly few.

Kleinberg’s article tries to explain that by using the fact that even if most of our friends are close to us (in some way – be it geographical or based on interests) – there are always someone who has some odd connection. Look for instance on the connection I’m making between the people in my church (the largest cluster) and the people I went to folk high school with (the densest cluster). In my Nexus graph there are no edges between these clusters – indicating that I’m the only person who has Facebook friends in both groups (as far as I know I’m the only one who knows people in both these groups – with one possible exception, but they’re not connected on Facebook).

In the news article “Analyzing Online Social Networks” from the same issue of Communications, Bill Howard speculates that the average step to get from one random individual to another in the online networks is more likely less than three.

I recently joined the professional network tool LinkedIn. This tool provides some statistics about this. I’ve now got 25 contacts in LinkedIn – some of these are about as new as me, while other has been on there for a long time, and have a lots of contacts. According to the statistics, there are 1000+ people two degrees away (contacts of my contacts), and 126,400+ people three degrees away. So out of the 35 million LinkedIn users, I am able to get to 127,500+ people two steps or less.

Social Networking Tools

24/02/2009 2 comments

Isn’t it strange how the social networking tools have totally changed the way we use the Internet? And the changes are really broader than that too, they show themselves in real life. I’m currently using two such services – Facebook and LinkedIn.

Just think about all the information you now know about people that you only know peripherally because of tools like Facebook or Twitter, information that you never would have known before, not even about your closest friends. How is this affecting our daily life and how we relate to the people around us?

I’m sure there are both positive and negative effects coming out of this, some we might not see right away. I started using Facebook a couple of years ago after I attended the 10 year anniversary of my time at Bjerkely Folkehøyskole (which today offers different photo classes, when I was a student there, the courses were different). As I arrived there and met my old class mates, I discovered that most actually had quite good overview of where many of the others that had been there were in their life. How? They were all friends on Facebook.

So this made me want to check this out. I also wanted to hear from those who did not make the anniversary (only 10-15 out of 60 students where there), so I decided to join Facebook. As soon as I was back home from my trip to the East, I created a profile and joined the Facebook group for people who had attended that school that year.

Since then I’ve got a lot of other friends on Facebook, I just passed 100, and they come from different groups of people:

  • People I went to Bjerkely with
  • Friends from my youth here in Sandnes
  • People I studied with
  • People I know from church
  • People I know from work
  • People I went to school with as a child in Gausdal
  • Family and Relatives
  • Some other friends

Some people fall into more than one of these categories, causing links between the clusters if I map my friends:

My friend map from Nexus

My friend map from Nexus