When you work for a company that does business internationally, you get the chance to see some rather funny translations. I came across a rather funny one this morning when I was looking thru bug reports that I figured I'd share with you. I'm almost tempted to post this one under Creative Writing....
Summary: Bond between data variables
Description: If a data type variable is enhanced by a second one (dd = d), the two variables remain bonded and the change of one of the two variables is reflected on the other one. I enclose herewith the trial program that put in evidence the problem.
Here's the closest translation I can come up with:
Summary: Variable references
Description: If I assign an object variable to another object variable, then changes made in the first will be reflected in the second. I have enclosed a sample project that demonstrates the problem.
Of course, this person is just confused by the fact that all object types in RB are really references, so the behavior he is seeing is intended (it's the way the language is designed to work) and is not really a bug.
Think of references as being smart pointers -- when you say foo = bar (where foo and bar are both an object type), then foo and bar both reference the same underlying data. This means changes that foo makes (such as foo.value = 4) will be reflected in bar (so that bar.value is 4 as well).
This is a concept that catches most people who are new to programming, or who are coming over from the C/C++ world. So I figured I'd just clear that up.
By Reference and By value ... classic OOP problem in most language implementations.
Thanks goes out to explicit object cloning!
Yeah, it can be confusing at first. But once you've gotten over the hump, it's not so hard to keep track of.
::laughs::...yeah...you pretty much know what I'm talking about there my friend...I've complained about it to you many a time before...hehe...thanks for the support.