Wednesday, October 22, 2008

The Unmentionable NECRONOMICON of WinApps (BAD Code is Language Independent)

I am working on a MFC app internally referred as the unmentionable NECRONOMICON of WinApps. This thing is a dying beast composed by an indefinite number of dlls: it seems put together as an ad-hoc example of the so-called DLL HELL. It compiles and builds by magic and by magic only. The thing is so scary no-one ever attempted touching it for 7 years or so. There are stories about the last guy who tried to fix a few bugs: he went crazy and left the company with no reason (OK, he just left the company). 

Anyway, most of this thing is coded in C++ and MFCs (except a bunch of cryptic COM components in VB6 and stuff which hopefully I'll never have to touch).  After having a thorough look at the code I can say that YES, the app is way far from being mainteinable, but - surprise - it's not because of C++. Same stuff written in C# would scare eggs out of (SCRUM) chickens.

Loads of people seems to hate C++, because it's error-prone (...), verbose, kinda cranky and not that cool anymore. Most of them probably don't even know about copy-constructors and destructors otherwise they'd hate C++ even more. I agree with most of this complaints and no-one would ever dream of developing a brand new WinApp today using MFCs. We got away from that and now we can focus on making cool apps, not just "working" ones.

Getting to the point, the fact that C++ apps do not write themselves seems to be ignored - people tend to forget one of the basic laws of programming: BAD code is language independent.

P.S. Wish me luck, I need it

No comments: