?

Log in

No account? Create an account
Bill Roper's Journal
The Perils of Positive Thinking 
21st-Oct-2016 11:44 pm
So there's a class that I ported over from C++ to Java two years and a bit ago as part of this project. It works fine when you convert it from C++ and you can use it for a great many things successfully. However, when you try to edit it, the class falls to pieces.

I haven't really touched the class in any significant way in quite some time, so when I looked at it, I was pretty much horrified to find that I had managed to port it in such a way that there was the ported-from-C++ array of children for each member of the class and the Java array of children that was hiding in the new Java-side base class. Only one of these was populated and it was -- naturally -- the ported-from-C++ array, which meant that all manner of bad things are happening when I try to edit the data structures.

I am now in the process of removing the ported-from-C++ array (which I will only use during serialization because I have to be able to get the data back into the C++ side of the world) in favor of the Java-side array. This requires a lot of hand editing of code in this lovely 4300 line class.

*grumble*

Well, at least I've learned something in the past two years.
This page was loaded Apr 22nd 2018, 12:26 pm GMT.