harriyott.com

Friday, October 22, 2004

Last day

It's my last day at this job. I've made some good friends here, and I'll miss them. Going on holiday next week, and starting the new job the week after.

Thursday, October 21, 2004

Am I any good?

I was talking to a colleague yesterday, who was saying that one of the other developers was a bad developer. I've spoken to the "bad" developer before, and he has criticised other developers. Thinking about it further, I've never heard a developer say that they were bad, or even average, in the same way that all drivers think they are above average drivers.

So what is it that makes developers say they are above average?

Firstly, the religious wars over choice of language. All C++ developers are superior to VB programmers. All java developers are superior to .NET developers (because .NET just copied all of java's features). Every developer believes that their "favourite" language is better than other developers' favourites.

Secondly, style is often confused with skill. I've heard developers slating other developers over curly brace placement, and choice of prefixes for Hungarian notating. Code commenting is often criticised. Looking at someone else's tricky code, even if commented well, may take several reads before understanding it. Above average developers may dismiss the comments as inadequate after the first read. Also, every developer has their own ideas about whether there are enough, or too many comments.

Thirdly, despite being highly analytical and logical, developers are also creative. Developers like elegant solutions. It has been often observed that many developers are also musicians, myself included. Musicians, along with other performers, are often sensitive, insecure creatures, with easily bruised egos. It can be crushing to hear criticism, so it is avoided - even self-criticism.

Fourthly, bug-tracking tools, for all their benefits, can add competitiveness to a team if managed badly. I have been in teams were developers were insulted for having introduced bugs that appeared in the formal testing stage. Bugs are a fact of life for software development, and everyone creates bugs. The correct handling of a new bug report is to fix it, not to cast blame and keep score.

Fifthly, out-sourcing, down-sizing and redundancies scare people, even at the rumour stage. The game is to stay off the list-of-people-who-are-likely-to-go. This can lead to jostling for position and back-biting.

Finally, there is no accepted way of measuring one developer against another, so each developer can use his own scale and criteria. Although the best developers are easy to spot, the rest are harder to place.

A developer may be very intelligent, constantly reading about patterns, new libraries and techniques, and apply them successfully to problems, but fails to communicate with the rest of the team, and refuses to draw icons. Is she a good developer? Possibly not, although she may think she is.

Conversely, the developer who spends time maintaining the build machine, appeasing the testers and writing the help documentation may be considered lowly, but his contribution is vital. Joel Spolsky has examples of good developers getting negative reviews, which illustrates this point nicely.

Until I thought about it properly, I thought I was an above average developer. Now, I don't know. Probably below average; I know I have a lot to learn. I'm not sure it even matters where I figure in the scale. What is important is that I continually improve, and hang around with people who I can learn from, in all areas of development.

Firefix II

I recently posted about MSDN sample code not displaying properly in Firefox. MSDN have now fixed this.

Tuesday, October 19, 2004

Copy and paste coding

It's my last week of working here, which is strange. I'm working on odd little bits and pieces for people, which is understandable, but frustrating today. Today I'm working on some VBA code that is part of an iFix SCADA system. There are a series of button bars that correspond to the function keys. Depending on which screen is displayed, a different screen is opened from the button bar.

My instructions are to use the existing code, which has been written for the F1 key, and write code for the other eleven, "Only leave the format as it is, because the customer will be maintaining the code, and they won't be able to cope with constants and stuff".

So, there's one function for F1, another for F2, another for F3...

Each of these functions checks the name of the current screen, and the id (0, 1, 2 or 3) of the button bar, and then instructs iFix to open a different screen.

I would like to move this code into one function, and each of the Fx click events call this function with a parameter containing the function key. The [source screen -> Fx -> target screen] mappings could be kept in a separate file which could be read in; this would remove the need for recompiling and reinstalling when a screen changes.

However, I've been told that the customer wouldn't be able to understand this. They need to have all the code for the button in one place, so they can change it easily by selecting "Edit Code" from the actual button. I'm quite happy with the ideal of doing what the customer wants, and they are non-programmers, so it can't be hard. I still find it offensive to copy the same chunk of code into eleven other functions though.

Friday, October 15, 2004

Code as HTML

I like this very much. A handy plug-in for Visual Studio to copy code as HTML for pasting into web pages. Let's give it a go then. Right, here's what it looks like.

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmMain());
}

Google Desktop

The Google Desktop search beta has been announced and seems popular, with a couple of exceptions. Erik Speckman, along with others, wants FireFox and Thunderbird to be included. PDFs aren't indexed yet either.

Valid points, but I can't imagine that these won't be addressed in version 1.0. Google points out in the about page that

Google Desktop Search is still under development as a beta product. We intend to add new file, email, and chat formats and browsers as Google Desktop Search evolves, and when new formats are created and used. If there's a format you'd like Google Desktop Search to be able to search, please let us know. We can't guarantee that we'll add every type that's suggested, but your suggestions will let us know what formats are important to you.


It sounds really good and everything, but it solves a problem I don't have. I have a neat and orderly "My Documents" folder, a well organised set of email folders, and I bookmark useful web pages and categorise the bookmarks. It may be useful for searching source code, but I don't need to that often.

I am impressed that Google have developed so many variations of a search engine. I often use the calculator for conversions, for example. I'm looking forward to whatever they release next.

Thursday, October 14, 2004

On being nice

I try to be nice, because I like to. Recently I came across the phrase "be nice to everyone, as they might be useful one day". I guess if you aren't generally nice to people (and I can think of at least two people who aren't), it's good advice.

I was involved with an example of this a couple of days ago. My boss had a CV on his desk, from someone who lives near me. He asked me if I knew the person, but I didn't. From the date of birth on his CV, I realised I knew someone in their school year, so I texted her to find out if she knew him, and if so, what he was like.

She knew him, and he seemed to be good at computers, and he was always nice to her. That was enough for this stage. If he was horrible, then his CV would be in the bin. I doubt he will ever know about this, but being nice to my friend had turned out to be useful.

I'm now wondering how many situations I'm in because I was nice to someone, or how many I've missed out on because I wasn't.

Wednesday, October 13, 2004

Geek beer

Fantastic. Went out for a beer with a friend last night, and we had our first proper techie conversation. I learned some things about areas of IT that I've not been involved in: RPG, 4GLs, Y2K testing and PC hardware. Now what was I saying yesterday?

Tuesday, October 12, 2004

How was your day, honey?

My wife, Julia, used to be an English and Drama teacher before we had children. When we were first married, we used to get home in the evening and have a conversation similar to this:

Me: So, how was your day?
J: Not bad. Had to give Tom a detention for shouting. Finished marking the Brecht essays, but Sarah didn't hand hers in until today, so I've got that to do now. Booked the theatre tickets and the coach to see "Art" next month, and wrote a letter to the parents. How about you?
Me: Good. I've finally found what was causing the memory leak, and fixed it. I feel quite relaxed now.
J: What's a memory leak?
Me: Well, it's when you allocate, sorry, tell the computer that you want to use some memory, and you forget to de-allocate, sorry, tell the computer that you've finished with it.
J: So how does it leak?
Me: Er.. When you stop running the program, the memory is still allocated to the program, so other programs can't use it. But as the program isn't running any more, nothing can de-allocate it. If this happens lots of times, the computer will slow down, or may stop altogether.
J: So is memory where the files are kept?
Me: No, that's the hard disk.
J: So what's the memory then?
Me: Um. The memory is kind of like a temporary area where things are stored so that a program can use them quickly. You can have a pointer that tells the program where a certain thing is in the memory. A bit like your pigeon holes at school. You know where to look as your pigeon hole has your name on it.
J: So the memory is where your temporary files go?
Me: Not exactly. Well kind of. In this case I putting numbers and strings in memory so I can..
J: Strings? What, like for tying things up with. No, it can't be. What's a string?
Me: A string is just a set of characters.
J: Characters?
Me: Yes. Sorry, letters and numbers and stuff. Maybe commas and question marks.
J: But surely you'd be able to see them on the screen when the program finishes, and you can just delete them.
Me: Well no. They're in memory, but they're not displayed on the screen, well, they can be, but they won't be once the program's finished.

And so on. A simple statement about fixing a memory leak became a big stressful session of me trying to explain things simply. Julia, bless her, tried her best to understand but she couldn't (and still can't) see beyond the user interface.

After I while, I noticed that I didn't enjoy talking about work with Julia, and realised why. I spent the day talking about memory leaks to people who would understand, and couldn't generalise when I got home. I could understand all of the items Julia talked about; detention, essay, theatre, coach, letter, as I had experienced school when I was younger. We couldn't talk about our day in the same way.

I felt like there was a part of my life that I couldn't share with my wife, and it upset me for a while. I tried being more abstract about my reply:

"Not too good. I had four things to do today, and managed to finish one. Roger shouted at me." or "Brilliant day. I fixed all the problems in the thing I've been working on."

This made the conversations a whole lot easier, and less tense. Success.

The problem was, I still had a deep spiritual need to talk tech, which just wasn't being satisfied. Talking tech to colleagues is either very specific about a particular task that we're working on, or me listening to them moaning about XYZ's support line, the boss, the customer's ever-changing requirements, having to write the test documentation etc. Not satisfied.

I have four or five friends at church who are techies, and we're all either musicians or sound engineers (there is also an Oracle salesman, but he spits when anyone mentions .NET). There isn't much time for chatting after church, or in the band practices or other church activities, as there's usually a church related purpose to the meeting.

Most of our "not-just-chatting" conversations are about music, but occasionally (twice a year, maybe) we talk about programming, or relational databases, or user interface design or whatever. I love these conversations, and find them immensely satisfying. I'd like more of them. With more people.

So I'm trying to work out how to get more of these conversations. I need to meet more techies. I'm starting a new job soon, so that may help. Uckfield is hardly silicon valley, but there must be some other techies about who can't talk tech with their spouse. There may even be enough for a geek dinner.

How do I meet them? I could wear a name tag, read about some old school associates on friends reunited, or hope someone local reads this and posts a comment, or start the Uckfield and District Association of Technical Conversionalists.

Monday, October 11, 2004

Pragmatic programmer tips

I've been meaning to cut out the tips section in the back of my copy for a while. Now I don't have to.

Sunday, October 10, 2004

The pleasure of small apps

Although I love working on decent sized projects, I also really enjoyed writing a throw-away application yesterday. I needed to compare the size of over 150 archived directories to their originals, and also a bunch of corresponding CDs.

I used to use VB6 to knock up things like this, but .NET has provided an alternative. I wrote a WinForms program with C#, and it worked fine. It took about three to four hours, gave me the directory sizes, and won't be used again.

Because it won't be used again, and because I needed the results quickly, I didn't write unit tests, comments, documentation, help files, a schedule, or a spec. And I loved it! As much as I would usually write or use these things, and absolutely know that they are necessary for creating good software, the most fun bit for me is actually writing the code. Wow, do I dare admit that to myself?

I guess for a footballer the training, meeting the press, travelling at weekends and so on are the equivalent essentials that aren't quite as exciting as playing a match. However, the match playing would be poor without them.

Friday, October 01, 2004

FireFix

In FireFox, the MSDN code examples had no line-breaks, so I used IE for looking at the site. I've just found out that FireFox can be told to display MSDN properly.