Welcome to our continuing series of Code Project interviews in which we talk
to developers about their backgrounds, projects, interests and pet peeves. In
this installment we train our sights on Code Project member Hans
Hans been a Code Project member for 10 years and is Code Project's resident
MFC expert. He's helped Code Project community immensely over the years, from
writing nearly 100 articles, to founding the Code Project Mentors – a
group of Code Project members that help new authors gain their footing on Code
Who are you?
I am Hans Dietrich, currently living and working in Los Angeles as a
Because many of my clients request to sign an
NDA, I cannot mention specific company names. A large percentage of my clients
are in the financial business sector. Even in these tough times, I have no
trouble finding new clients, most of whom come by way of word-of-mouth from
another client. These new clients have usually already checked me out by
looking at my articles on CodeProject, so they know I am an expert with
MFC and user interfaces.
In the last few years, I have found myself getting an increased number of
client inquiries. Apparently, this is because Microsoft has been pushing very
hard on .NET, with the result that fewer programmers are getting into MFC,
thus making MFC programmers a scarce commodity, and allowing me to charge
accordingly! Once again, this confirms what my business partner likes to
say: Microsoft is God's gift to consultants.
It has been interesting to me that a few clients have come to me with a
surprising request: They originally had an MFC application, and then
Microsoft's marketing spiel convinced them to convert to C#/.NET. To their
surprise, the converted app turned out to be slow, unresponsive, and lacked
characteristics of the original app that their customers liked. When my (new)
client went to Microsoft, they were told: Give it time. Your customers will
get used to it. Soon all apps will be just like this. That response, coupled
with a ton of complaints from their customers, made the client call me and
beg, Please get us back to our MFC app. It took a little while – there were
numerous new features that were put into the .NET version – but this client is
now happily back in MFC-land.
To a lesser extent, I have also been doing some WTL and Qt work for
clients who want to support multiple platforms. This represents sort of a full
circle for me, since before I started doing Windows programming (yes, I still
have my Petzold!), I was working on Unix systems. At one point, I
made a count that my software was running on 78 different Unix platforms.
What do you do?
As I said, I sign NDAs with many clients, so I cannot give names of any of my
current consulting jobs. I think many CodeProject readers have seen my sig,
which points to my Hans Dietrich Software website
(http://www.hdsoft.org). I am continuing to expand it whenever I get a
My latest product is XCaptionButton), which I actually started
back in 2004. This component allows you to put graphic and text buttons in the
caption bar of any app. I was dissatisfied with the implementation, so I put
it on the shelf. Recently, when working on something entirely different, I
realized how to make the implementation much better – simpler, easier to
manage, with extremely fast performance, that would work across all Windows
platforms, including Aero. When I tried out this new implementation, it
worked beautifully, and now I'm trying to figure out why I hadn't thought of
I mentioned my business partner already. He has a web site that I'm finishing
up a new product for. This product is the easiest-to-use file renamer that you
have ever seen. Some of my clients have file folders with thousands of files
that I have to rename for testing purposes. I finally got tired of writing
custom batch scripts and I decided to build a renamer utility that would work
just like any text editor – search/replace, macros, everything. It also
accommodates MP3 and JPG renaming. Best of all, it's just a click away using
the Windows Explorer shell extension, and I can use it at home on my x64 Windows 7
system or on my client's XP system.
What is your development environment?
My home system is a 12GB dual quad-core Dell running Win7 x64, dual 28-inch
Hanns-G monitors. My main dev tool is Visual Studio, of course. My own
preference is VS2008, and I am happy that most of my clients have also
stayed with VS2008. With MFC I use C++, of course, although lately I have been
doing more C# work for random things.
When I fire up VS, the one other tool I usually also open (if it isn't
already) is UltraEdit. I use this for looking at everything from non-
project rc files to html. I've lost track of the number of so-called HTML
editors I've tried, but I always come back to UltraEdit.
I have been looking at the new C++0x features and trying to understand
how they can be best used. I am also trying to get better with Qt, since every
one of my major clients has a Qt project underway or in the research phase.
What is your coding pet peeve?
This question comes up frequently on many programming sites. It's amusing
in a way because it usually indicates a certain lack of professionalism. If
you're coding for yourself, you're free to use whatever you want. When you
walk into a new client's office, however, you don't have that luxury, and the
programmers there will tell you very quickly what they think of your aberrant
(to them) coding practices. As my friend likes to remind me, Just because you
work sitting up, doesn't mean you're not a whore. So you do what the client
Yes, I use hungarian for MFC programs, because that's the way MFC code
is. As for the rest of it, I wrote a C++ code beautifier ten years ago, that
easily converts whole directory structures of code, in terms of indenting,
brace lines, etc. One of the minor (I thought when I wrote it back then)
features is that it converts from ANSI to UNICODE coding
CRT TCHAR function names). I came to
appreciate this very much indeed when a client asked me for a quote to convert
his code base to be UNICODE-compliant. He was expecting me to say weeks, and
was hoping it would be less than a month. He was stunned when I told him it
would take a couple of hours.
How did you get started programming?
With my father's help, I got a job at the local university's computer center,
working as an operator when I was in high school. For my senior thesis in
high school, I used a computer program to demonstrate the solution of a well-
known physics problem. This experience followed me into college, where I
continued as a computer operator, helping me to pay my way through college.
I think you have to qualify that question quite a bit. In recent years, for
example, CodeProject has veered sharply from its original path as a hard-core
programmers' site to a social networking site that caters to programmers.
What's the difference, you ask? I'm guessing – and here is where I will
probably get clobbered – that few of the 8 million members at CodeProject
actually do any programming at all, ever. And even fewer do programming on a
daily basis, to earn a living. You can see the result of this very frequently
in the Lounge, or in the Bugs & Suggestions forum: people
complaining about being disrespected, people complaining about some mythical
"reputation points," with the expected hundreds of followup posts. It is
obvious that for some, Q&A forums have become a shoot-the-fish-
The key thing to keep in mind is that no other site on the web has the
technical breadth, the bedrock core of articles, or the enduring presence of
senior experts, as CodeProject. To the extent that the social networking fluff
blurs that image, I am regretful.
What advice would you offer to an up-and-coming programmer?
When I was beginning with programming, there was no MSDN. I had to learn
by reading code. I am constantly surprised that so many new programmers today
are seeking shortcuts, rather than learning the basics. Here's another thing
that will help you to learn: write an article for CodeProject. You will learn
more from writing just one article, and taking the comments you get seriously,
than a whole course-load of CS.