Michael Hasselmann

First steps with Qt

I started to look into Qt with the help of "Foundations of Qt Development" by Johan Thelin. As with its counter-part it shares the decent text and the sometimes not-so-convincing examples. Perhaps code examples from a book should generally be maintained like a real project (including bugtracker, mailing list/forum and public repository), since that allows the examples to improve over time.

Now, a personal highlight while reading the first chapters of the book was the screenshot of a paper'n'pencil design at the beginning of the second chapter. From there it continued with the derived use cases and then went on to explain the needed events and event handlers (signals and slots in QtSpeak) - a very convincing approach. However, the opportunity of introducing the reader to TDD was missed, and Qt unit testing is only mentioned late in the book (chapter 16). This actually implies that writing unit tests after writing the application code is OK. Nothing could be further away from the truth since testability is a design choice.

My first impressions of Qt are two-folded. There are already quite a few things I strongly dislike in Qt. Nevertheless I have to admit that it enables you to rapidly develop solid desktop applications, without boilerplating your code.

Comments

Murray Cumming commented on July 2, 2009 at 11 a.m.

I can't think of any introductory programming book that mentions unit tests early in the book. But, yes, that would probably be a good idea. It makes it less fun but it would encourage good habits.

(I need to start doing more unit tests as part of make distcheck, when I figure out how, for instance for Glom.)

Michael Hasselmann commented on July 2, 2009 at 11:22 a.m.

Regarding TDD this Smalltalk/Squeak tutorial did it quite well: http://squeak.preeminent.org/tut2007/...
Disclaimer: I don't want to encourage anyone to program in Squeak since it probably is the least useful among the better known ST implementions ...

Johan Thelin commented on February 17, 2010 at 11:05 p.m.

Actually, during the writing of the book, I kept a build-all.sh script, testing (almost) all code. I then kept markers in the code to mark where snippets started, begun (and where the ...-s goes).

As Apress forced me to use Word, I had a VBA script that pulled all examples from the source and put them in the word document when I decide that I was done.

Remembering the process, I recall really wanting a tool where I could handle code and text-documents in a tool where the code where linked to, rather than copied.

Anyway, I did the tests far back, and missed driving the TDD-point. Partly because it does not fall right into your lap when you use Qt (as I mean that user-cases does).

Michael Hasselmann commented on February 19, 2010 at 12:09 a.m.

Johan, thanks for giving this insight into your work! Having to manage the examples like that surely wasn't easy then ...

Post a Comment

This site's webmaster failed misserably in upgrading the underlaying web framework.
The comment system is entirely broken right now. Sorry!