Friday, 30 October 2009

Stack Overflow Dev Days – London

On Wednesday I took a day off to go to the London venue of the Stack Overflow Dev Days tour. I wasn't entirely sure what to expect even up to the moment I arrived as I signed up without the faintest idea of what anyway was speaking about, and more importantly whether any of it would be relevant to my day-to-day work as a self-confessed C++/C# server-side kind of guy. Frankly I didn't care, for me it was going to be a day of meeting new friends, old friends (from the ACCU), and generally soaking up what's new and cool in the world of Software Development -C++ and faceless servers are presumably not cool.

Opening Keynote by Joel Spolsky

The day opened with a humorous little skit on software development practices by Jeff, Joel and the Fogbugz team and was followed by Joel in person to talk about to eternal struggle between Simplicity and Power. His argument was that although simple to use software is good for the user, fundamentally what users think they want is features, and when it matters (voting with their wallets and getting the bills paid) power matters – a lot.

Python Introduction by Michael Sparks

Joel was followed by Michael Sparks from the BBC, here to give a short introduction to Python. His example was a simple piece of Python code to aid spell checking - the same code that was referenced by Joel earlier in his keynote as being elegant. Python is one of those languages I've always felt I should learn (I dabbled some years ago) and this presentation has wet my appetite again, but only when I need to do some heavy string processing.

As an aside, I agree that the code has an elegance, but where I felt it was let down was through a few classic examples of poor variable and function naming – 's', 'edit1' and 'edit2' would have been far clearer named something like 'permutations', 'generate Typos' and 'generateTyposOfTypos'. Or did I miss something obvious here?

Fogbugz by Joel Spolsky

After a cup of java during the morning break, Joel Spolsky got to do a little sales pitch about his Fogbugz products. The pitch was pretty good as it certainly looked far simpler than the bug tracking products I've been forced to use in the past. His companies latest addition is Kiln, which adds Version Control to the mix and allows tighter integration for handling code reviews etc. It's his event so I suppose a certain amount of chest-beating was to be expected.

Android by Reto Meir

The battle for the hearts and minds of the mobile platform developers was started by Reto Meir with an introduction to Android. After a brief background of supported devices and usual market growth spiel we got to see him create a simple Hello World app and run it on an emulator. Unfortunately the choice of font size didn't help and the constant scrolling around the virtual desktop made you feel quite sea-sick. However I saw enough to get a taste for what Android's about.

jQuery by Remi Sharp

To me jQuery epitomises what Joel talked about in his keynote about Simplicity and Power and also about elegant code. I have to stand back and marvel and what I feel is a truly fine piece of technology. Although I have only done a smattering of JavaScript in the last 8 or so years, jQuery clearly illustrates how far machines and, more specifically, JavaScript engines have come. Perhaps if this is your bread-and-butter it's nothing special.

Needless to say Remi's presentation was slick, providing plenty of examples of how to harness the power of the query side with the Fluent Interface (which he termed Chaining) that drives the DOM mutation. A fair amount of the audience had used jQuery already so perhaps he was preaching the converted.

Lunch

A whole paragraph devoted to lunch? I'm afraid the only thing that marred the entire day was having to wait nearly an hour to get lunch because they ran out of food! The event was sold out months ago, so someone knew exactly how many people were attending, so how can you run out of sandwiches? I missed the start of Jeff's talk due to this mishap. I'm not sure everyone got coffee earlier either.

Jeff Atwood

Unlike Joel who clearly had something to sell, Jeff seemed to be more interested in showing what makes him tick, and how that passion has driven the Stack Overflow venture. Hearing him talk about getting excited about everything right down to configuring the hardware makes him an instant soul mate. Also his plug for the book Coders at Work had the desired effect on me as it went straight on my Amazon wish list.

Qt by Pekka Kosonen

Nokia are probably the Microsoft of the mobile phone world. Whereas the new kids on the block, Android and iPhone, are cool and sexy, Nokia has the established customer base but no pizzazz. Pekka did his best to get the audience on his side by the tried and trusted means of self-deprecation. There were some interesting demos of how you can develop without needing a locally installed SDK, and the thought of remote testing, sure seems sensible given the diversity of hardware out there. Ultimately though Qt just isn't quite as sexy…

iPhone Development by Phil Nash

Phil is a fellow member of the ACCU and I was fortunate enough to go to his presentation at this years ACCU Conference about iPhone development. However this talk is a far more polished affair as he has dropped some of the more grungy details of Objective-C development in favour of putting together a demo app live on stage. Like the Android presentation earlier, it was only a simple app, but had just a little more panache than the competition. The main stumbling block I fear though is still Objective-C, the manual memory management is a real turn off.

Humanity: Epic Fail by Jon Skeet

Being new to the world of C# development, Jon Skeet is a name that I only have a passing familiarity with at present by virtue of me having only just read his book, C# In Depth. Oh, and a few Stack Overflow replies as well. The man seems to have a somewhat legendary status and doing a presentation with a hand-made sock puppet doesn't appear to have put a dent in that.

The premise of his talk was that there is a huge disconnect between the users view of the real world and how they expect the software we develop to model it. They are simply unaware of the limitations of the digital world, such as in the representation of real numbers, or the ambiguities of time-zone names, or the subtleties involved in processing text from the many different languages we speak. Quite frankly if people like him can't get it right, what chance do those of us further down the evolutionary chain stand?

How Not to Design a Scripting language by Paul Biggar

The afternoon coffee break was succeeded by Paul Biggar, a PhD student studying scripting languages. He had some interesting opinions on where their limitations lie and how they could be improved to reduce the performance gap with the traditional compiled languages. I've never read The Dragon Book about compiler design, but I'm aware of it's reputation, and someone who publicly dismisses it in favour of Engineering a Compiler by Cooper & Torczon had better know their onions. He was definitely one of the more entertaining presenters.

Yahoo! Developer Tools by Christian Heilmann

Christian Heilmann finished off the day promoting the YUI toolkit from Yahoo! I got the impression from this talk that there is fair bit of competition in the web toolkit arena, and their USP is that they use it and that they have 330 million customers to support. That customer base figure was trotted out a number of times… The demo of YQL, a SQL like query language for extracting data from web services, was certainly very interesting. I would have thought that YQL plus jQuery would be a very powerful combination.

Final Thoughts

Joel returned to the stage to close the day and asked who would come again. Most, including myself, raised their hands. At £85 it was certainly a bargain compared to what you normally pay for training – more so if the subjects were relevant to you. Me, I just enjoyed the day surrounded by geeks who are passionate about their profession. Now if we could just convince a few more to join the ACCU…

Monday, 19 October 2009

DDE Is Still Alive & Kicking

Dynamic Data Exchange (DDE) is an ancient inter-process communication (IPC) mechanism carried over from the 16-bit Windows days. Post millennium Windows programmers are probably more used to a diet of COM, but there still seems to be life in the old dog yet. Maybe there are less people around to answer questions on DDE, or perhaps the other old timers are ignoring them in the hope they'll go away because I seem to have had more emails on the subject this year than ever.

I presume the reason the questions are still coming my way is because I have a number of freeware tools on my website aimed at working with DDE Servers that are still actively supported:-

  • DDE Query is my oldest tool and is a GUI based utility for sending requests and creating advise loops on items. It was written as the main test harness for my DDE library.
  • In contrast DDE Command is my most recent addition and is the console based counterpart to DDE Query. It also provides the ability to invoke XTYP_EXECUTE transactions.
  • In between the two is my DDE COM Client - an automation compatible inproc COM component that can be used as a DDE Client for scripting scenarios, such as VBScript.
  • The final, and second oldest utility I provide, is a Network Bridge to allow DDE Servers to be accessed remotely. It is entirely transparent to the client and server, unlike the built-in Windows NetDDE service.

These all use my own C++ DDE library which in turn is based on the DDEML C-API library that Microsoft provides. Under the covers DDE is just a message based protocol that uses Windows messages to encapsulate a connection between two applications – known as a Conversation. Data is passed by allocating it with the old GlobalAlloc() API, and the format is determined by either using a standard clipboard format, such as CF_TEXT or a custom one via RegisterClipboardFormat(). The fact that it is message based is also its biggest limitation as it means you cannot share data between machines – you can't even share data across desktops on the same machine. The only book I came across on the subject was Ole 2.0 and Dde Distilled by Al Williams, but it covers the topic pretty thoroughly.

Before working in finance the only time I had come across DDE was when writing an installer back the mid 90's. Under Windows 3.x you used DDE to communicate with Program Manager (the shell that today is known as Explorer) so that you could create a "Program Group" and the icons for your application. You can still see this legacy today if you fire up DDE Query and use the "Server | Connect…" option, where you will spot a server called PROGMAN with a single topic also called PROGMAN. If you open this conversation and request the item "Accessories" you will be shown a CSV formatted text block with the programs from the Accessories Start Menu folder.

Once I started working in finance I discovered that Excel was the traders tool of choice. Excel can pull data from a number of sources, but the legacy option for real-time data was DDE. The big providers like Reuters, Telerate & Bloomberg all provided tools to allow you to feed their financial data into a spreadsheet and the in-house software we developed followed the same architecture. Although COM was probably Microsoft's promoted technology, DDE felt far simpler to implement.

These days I don't work with that kind of real-time feed, but the questions I do get on DDE always seem to have RIC's in the examples, so I guess that it's the financial industry that is keeping this prehistoric mechanism alive.

Saturday, 17 October 2009

We Don’t Use IE6 Out of Choice

Whilst on site the other day I found myself wanting to check out the NHibernate Profiler website. When I arrived at the homepage I was greeted with a modal iframe that pointed out that I was using that old legacy browser we all love to hate – Internet Explorer 6.

This distraction is nothing new, many popular sites such as Twitter also display a little message that points out the error of your ways, but what really raised my ire was the approach NHProf has taken. Instead of just warning you that your browsing experience is likely to be sub-optimal due to your choice of browser they instead hide the site behind a semi-transparent modal iframe that just includes links to download more modern browsers such as Firefox or Chrome. Nowhere was there an option to allow me to accept the consequences and soldier on, knowing full well that content may be all over the place or unreadable due to poor image handling.

When implementing this behaviour did it ever occur to the developers that I might not be using IE6 out of personal choice? Or that upgrading my browser at that moment in time might be incredibly inconvenient?

There is a very good reason why Internet Explorer 6 is still popular among the development community and it has absolutely nothing to do with laziness or some twisted superiority complex – it's Corporate Policy. Large corporations are incredibly conservative when it comes to upgrading major software components like the OS, browser or office suite. This is likely supplemented by a very strict policy controlling what additional software can be installed to reduce the possibility of conflicts. They often have a significant number of line-of-business (LOB) applications that have been developed in house that could potentially break if one of these elements is changed – a move that could cause them significant financial loss. I know of one major financial institution that didn't start rolling out Windows XP on the desktop until 2007 at which point XP was close to entering what MS calls Extended Support. The remediation process was lengthy, tiresome and provided no added value to the business.

I completely understand that website development is hard enough given that you have to test with IE, Firefox, Chrome, Safari, Opera etc and adding support for a badly broken browser like IE6 into the mix adds significant cost – especially for a non-commercial venture. But I'm suggesting they do. I just want you to recognise that we're not all in the privileged position of being able to treat our machines as we please. Some of us have to put up with our desktops, CD drives and USB ports being locked down tighter than Fort Knox.

Trust me, no one would still be using IE6, if they (or even Microsoft) had a say in the matter…