Brick walls, continued…

Warning: The following post may only interest my fellow nerds.  And even that is debatable.  🙂

I have dabbled in C/C++ over the many, many years of my programming tenure.  Almost 20 years ago, at the age of 16, I tried my hand at Turbo C++ 3.0 by Borland.  The low level nature of the language, and need for meticulous memory management, were a barrier to my fledgling skills and as a result I got frustrated.  I continued programming with QBasic for DOS instead.

About a decade ago I tried in earnest to learn C++ again along with DirectX.  Self instruction did not last long.  Soon after that I then took a certificate program at a local university for Object-Oriented Programming in C++.  By then I was understanding the syntax and the commands.  Yet still, it didn’t really stick with me.  I just didn’t enjoy the language very much and I couldn’t “just write code” whenever I felt like it.  Each line was a tentative save & compile session, ending with a review of whatever compiler warnings or errors I had just produced.  Not fun.

I found Darkbasic Professional a few years later and I loved it.  It had everything I needed, such as a simple BASIC syntax with an API geared towards making 3D games.  I often wonder, if I had stuck with C/C++ would I have grown to enjoy it along with my expertise?  I’ll never know the answer to that because I quickly abandoned any C/C++ efforts and stuck with DBPro.

As the previous post stated, over the last few years I have had a heck of a time with random crashes and other such anomalies that seemed to be out of my control.  Over the past year that ended when I decided to stop playing victim, get the source of the Newton physics wrapper DLL, and start looking into updating it to a later version of Newton that had lots of bug fixes in it.  I wasn’t sure if any of them would fix my random crashes but it was worth a try.

After a month or two of fighting with Visual C++ 6.0 (a very dated version) and learning about compiling DLLs I got the Newton physics wrapper updated just enough so it was functional.  I didn’t include some new commands, nor did I update the documentation or demos for the wrapper.  This was a custom version just for me to use with in my big project.  It still crashed once in a while, but not as often.

A few months ago I decided that enough time had passed and I should finish up all the new commands for the wrapper, update the documentation and demos, and ship out the new Newton physics wrapper for my fellow DBPro users.  I dove back into C++ and worked out the changes necessary.  While updating and testing the demos I noticed that I could repeat the crash I encountered all these years in one of them.  After debugging the DBPro code, and the wrapper source itself, I was able to spot the bug and fix it!

It felt really good taking care of a bug that has plagued me for years, and caused untold amounts of grief and frustration.  I still don’t enjoy C/C++ but I can’t say any longer that it has never given me any joy.

With the spectres of failure cast into the abyss, I can now forge ahead in my long journey to complete the marble game.

Comments are closed.