Forgot your password?
typodupeerror
Programming

Journal GeckoFood's Journal: [geek] Gecko writes clean C++ code! 2

I have been working on a little toolkit for well over a year, the cornerstone of which is a library of routines I have built to handle file reads and memory management. I thought I had it fairly tight but I wanted to be sure. Because of a change in the way I am writing the application that uses the underlying library I got access to a good memory checking tool.

I have been using a variety of compilers for a while but Borland/CodeGear is the only one I have actually spent any money on - the others are either free or I got them free by being in the right place at the right time. I have also been using a freebie GUI library, wxWidgets. It's a nice library that's very well suited for cross-platform development. It also is a wee bit harder to use than some of the other offerings.

I just switched back to the VCL, which is CodeGear-specific and it forces me back into the CodeGear GUI. That gives me a clean shot at using CodeGuard, which is the CodeGear equivalent of BoundsChecker, Purify and tools of that nature. It will tell you if you have memory leaks, improper memory usage, bad calls and other stuff that slip past the compiler - it finds abuses of the language.

With a fully instrumented debug build in hand I ran the application and loaded up every drop of data available: 30+ megs and close to a million pointers. Without explicitly telling the application to free up everything I killed the app with the intention of making the destructors do all the work. They did. Not one byte of memory was leaked and no abuses of the language were found. There were no ill-formed function calls (passing bad parameters that are syntactically correct but do not convert well).

Overall, I gots clean code! Since this is the first time I have checked it this way and it came out so clean, I guess you could say I'm more than a little happy.

This discussion was created by GeckoFood (585211) for no Foes, but now has been archived. No new comments can be posted.

[geek] Gecko writes clean C++ code!

Comments Filter:
  • But that sounds very cool. I don't do C or it's variants - two years of RPG II [latech.edu] was enough "arcane as hell" for me.

    It does take a good amount of skill to make sure that there aren't any loose ends left hanging. I can see why you would be happy that the results are so clean. :-)

    • 'Stunned' is a better word. I have been working this code in one form or another for almost 2 years, and to have it come out clean like that was the very last thing I expected. I won't argue, though.

Each honest calling, each walk of life, has its own elite, its own aristocracy based on excellence of performance. -- James Bryant Conant

Working...