Blog

Tuesday, August 23, 2011

When true IS false the hope IS lost

{Imported from my previous post in vstretch blog}

Logic, mathematical logic is one of the most pure concepts that serves as the basis for the programmers value system, core beliefs or even in the extreme cases the religion. One of my university professors used to draw a simple logical chart that is universally true in programming and the life:

Input
Result
Philosophy
True
True
Possible
True
False
Possible
False
True
Devil exists
False
False
Possible
In other words both true and False results can be inferred from a true statement, and only false results can be inferred from the initially false statement. In the case if false assumption results into a true statement, the logic is non-existent, and your core beliefs are fractured, might as well be the end of the word, or for the devil to exist.


Having a special fondness for the programming language Perl, which I use for most of my coding (as a job requirement) I grew fond of it over the years, through it's wonderful unpredictability and sometimes weirdness, there is a powerful open source community backing it Cpan.org, and the general easiness of using the scripting language versus general purpose languages, I was caught by a surprise running into a pure existence of devil the other day. A code snapshot, to better prove the point:

use strict;
use warnings;

my $var1 = '';
my $var2 = '';

$var1 = (1 == 1)
        ? "true"
        : "false";

(1 == 1)
        ? $var2 = "true"
        : $var2 = "false";

print "var1 $var1\n";
print "var2 $var2\n";

Can you guess the value of $var2?
FALSE!!!
The value is false, this is the proof that Perl is evil, and human race should avoid it. This is the prove that the condition when logic stops working and devil exists, consuming your reality and beliefs.