This is so very true. I had a problem once where I wrote a huge script and embedded lots of code like this:
And the code worked great in debug mode. But for the real thing I didn't want this huge debug log being generated so I flipped the bit, so to speak, and the thing stopped working. I spent a day trying to figure out why it only worked in debug mode... hehe the line at fault looked a little like this:
print DEBUGOUT "blah blah debug message blah" if DEBUGGING;
The problem? When I'm debugging the code the each iterator was able to go all the way through, but when I'm not debugging, the each iterator gets run once and then stops. When I need it later, I'm off by one. Ooops. By the way, while I could have fixed this by swaping the order inside the while predicate, I opted to follow a fellow Monk's advice and used Data::Dumper
print DEBUGOUT "key=$a, value=$b\n" while( ($a, $b) = each %hash and D
Ah, the Schroedinger Perl program. It is in a state of
functionality until you run it. ;)
... or the perhaps output is correct until you look at it?
See, true Schröedinger code would unlock all sorts of fuzzy logic. You could have 1, 0, and unknown. Effectivly building the trinary computer (Yes, from that RPG). The trick is, to be able to reproduce Schröedinger bugs whenever we feel like it. This would be difficult as we would have to code without observing what we're typing, or as a perhaps better solution, place our code in a box after finishing it. Also. does thinking about a certain section of code count as observing it, or do we deal with an idealized version of the code in our minds that is unlinked from the physical segment of code? Does linking this abstract mental segment of code allow for the creation of Schröedinger code? Does that change the answer to the first question? I sense there's something very big here, if only we could grasp it further.
I don't know anything about role playing games, but trinary computers have existed since 1958. The first was built by Nikolay Brusentsov, a Russian. Here's a link to a little bio about him.
You can also use google to do a search for Russian trinary computers.