Click here to Skip to main content
15,794,347 members
Articles / All Topics

A Coder Interview With Hans Dietrich

Rate me:
Please Sign up or sign in to vote.
4.80/5 (32 votes)
5 Oct 2011CPOL7 min read 36.6K   9   14
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 track down Code Project member Hans Dietrich.

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 Dietrich.

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 Project.

Who are you?

I am Hans Dietrich, currently living and working in Los Angeles as a software contractor/consultant.

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 ( I am continuing to expand it whenever I get a chance.

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 it before.

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.

What new tools, languages or frameworks interest you?

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 wants.

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 conventions (TCHAR, _T, 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.

How has the developer community influenced your coding?

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- in-a-barrel game.

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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer (Senior) Hans Dietrich Software
United States United States
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.

Recently, I have moved to Los Angeles where I am doing consulting and development work.

For consulting and custom software development, please see

Written By
Software Developer CodeProject Solutions
Canada Canada
The CodeProject team have been writing software, building communities, and hosting for over 20 years. We are passionate about helping developers share knowledge, learn new skills, and connect. We believe everyone can code, and every contribution, no matter how small, helps.

The CodeProject team is currently focussing on CodeProject.AI Server, a stand-alone, self-hosted server that provides AI inferencing services on any platform for any language. Learn AI by jumping in the deep end with us:
This is a Organisation

4 members

Comments and Discussions

QuestionDoes the website of run normally? Pin
chen.zd16-May-14 0:57
chen.zd16-May-14 0:57 
GeneralExcellent Pin
David Pritchard30-Oct-13 3:17
David Pritchard30-Oct-13 3:17 
QuestionReally? Pin
pip0109-Nov-12 6:01
pip0109-Nov-12 6:01 
QuestionIs there a reason why you are not actively writing articles, as before? Pin
Shao Voon Wong8-Oct-11 18:37
mvaShao Voon Wong8-Oct-11 18:37 
AnswerRe: Is there a reason why you are not actively writing articles, as before? Pin
Hans Dietrich8-Oct-11 18:52
mentorHans Dietrich8-Oct-11 18:52 
GeneralMy vote of 5 Pin
linuxjr6-Oct-11 6:22
professionallinuxjr6-Oct-11 6:22 
QuestionNice Pin
Fabio Franco6-Oct-11 5:28
professionalFabio Franco6-Oct-11 5:28 
GeneralMy vote of 5 Pin
Chris Meech6-Oct-11 3:39
Chris Meech6-Oct-11 3:39 
QuestionExcellent article Pin
Pete O'Hanlon5-Oct-11 8:45
subeditorPete O'Hanlon5-Oct-11 8:45 
AnswerRe: Excellent article Pin
AspDotNetDev5-Oct-11 17:12
protectorAspDotNetDev5-Oct-11 17:12 
QuestionBe Honest Pin
AspDotNetDev5-Oct-11 8:19
protectorAspDotNetDev5-Oct-11 8:19 
AnswerRe: Be Honest Pin
Hans Dietrich5-Oct-11 8:31
mentorHans Dietrich5-Oct-11 8:31 
I prefer to say, I got them in spite of the mis-spelling.

Smile | :)
Best wishes,

[Hans Dietrich Software]

GeneralMy vote of 5 Pin
DaveAuld5-Oct-11 6:09
professionalDaveAuld5-Oct-11 6:09 
GeneralMy vote of 5 Pin
Simon_Whale5-Oct-11 5:56
Simon_Whale5-Oct-11 5:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.