September 2009

State of the art (of the Twitter client)

This is what my Twitter client looks like today.

Current look of CheepCheep

It is displaying my "home timeline"; that is, the list of tweets I see when I log in to Twitter. The timeline is rendered in an embedded Internet Explorer control (and I need to apply some more CSS styles). I have also implemented the preferences dialog, and it works, but I cannot save the preferences yet (I have to enter the credentials every time I restart the application).

Not implemented yet: automatic updates, entering new tweets, deleting your tweets, viewing single tweets/conversations, viewing a single user.

Yes, I'm learning quite a bit writing this program. One of the things I have learnt is that Windows programming is not as horrible as I remember it — but then, it was about 15 years ago :)

More impressions on Windows Programming

I'm still learning how to program for Windows in C++ using the Win32 API, and I'm writing more of my impressions — remember that I've worked with Linux for the past 12 years, and this all is practically new for me.

  • Visual Studio is not a bad IDE, but it is not excellent either (at least for C++). That, or I have been spoilt by Eclipse and IntelliJ IDEA and their excellent support for refactoring (at least for Java). IDEA has such a powerful autocompletion, I have written complete modules without writing a method or variable name in full. In Visual Studio, OTOH, IntelliSense stops working all the time. Are you initializing a variable in the definition? It stops working. Have you got a syntax error 50 lines up? It stops working. Are you using C++ templates? It stops working. I don't know why it stops working so much, when it doesn't even try to figure out whether you want to input a type or a method or a variable name.
  • It is hard work embedding Internet Explorer in an application when you aren't using MFC or Visual Basic or C# or one of those frameworks that give you a "WebBrowser" class in which all the work is already done. Not knowing anything about OLE/COM/ActiveX didn't help, of course. I have to thank Jeff Glatt for his article, “Embed an HTML control in your own window using plain C” (and his “COM in plain C” series), and the authors of wxCode's IEHtmlWin component (once again, Free Software comes to the rescue!). Reading them helped me to understand how it works. Now when I go read the documentation on MSDN, it makes sense!.
  • Talking about MSDN, the quality of the documentation varies. At some points it is very comprehensive and includes tutorials and guides and everything, and can be read as an introductory book. However, at other points it already assumes you know how to do what you want to learn, and only includes a very broad overview and reference information. Not that the documentation in most Linux or free/open source projects is much better in general, mind you...
  • Update: I also want to correct my previous assertion that there was few documentation and my assumption that they kept it scarce on purpose for book publishers' sakes. It turns out there is plenty of documentation (see the point above), only that I didn't know how to find it, as it wasn't in the Express Edition help files. I think. Anyway, it's all online on MSDN.

Two weeks after

On August 15th I had posted a story saying that I was going to use Windows more frequently, and that I was even going to learn how to program for Windows. Let's see how it's going:

Of all the differences between Windows and Linux, the one I notice the most is the lack, in Windows, of the “primary selection”. That's the technical term for the X-Window feature that allows you to select some text with the mouse and then paste it anywhere pressing the mouse wheel. I use that all the time in Linux, so in Windows I always forget to press Control-C and Control-V to copy and paste.

As I said before, I'm also learning how to program for Windows. At first I had downloaded Visual Studio C++ Express Edition (as it is free of charge), but it has so many limitations that it did actually get in my way. Fortunately, in Microsoft's web site there's an evaluation version of Visual Studio Professional Edition, which has all the features but also a 90-day limit, so I downloaded it (3 GB) and I'm using it now.

The program I'm writing is a Twitter client. Writing this program will allow me to work in many different parts of Windows, such as the user interface, network communications, APIs for interpreting XML and working with graphics, etc. It will be quite hard because I have to learn everything as I go, but I already managed to write a program that displays a window and can download data from Twitter and show it in the window in the same XML format it was received from the server in:

A screen capture of the program's window.

Ah, and I also played (and finished) World of Goo. That's a game about joining balls of goo forming structures to achieve an objective. It was made by four people on a 10,000-dollar budget, and it was very successful. It is truly a beautiful game, and it's worth it. Ah, and it works on Windows, Mac and Linux (and there are demo versions for the three architectures).