New Blog

Brand new domain, brand new box, brand new blog. Welcome to node.mu, a Mauritian flavored node on the internet.

 
 
1 Comment. Leave a comment or send a Trackback.
  1. #1 • Carine said on November 30 2005:
     

    Hey there. Dunno where to email you, so I’m leaving the answer here Regarding the numeric thingy i.e why they put the numeric before the variable), hmm I’m not a programmer but have asked my colleague for the reason. Example:

    set x = 2;
    if (x == 1) print “thank you this is 1″
    else if(x==2) print “sorry i am 2 now”

    in this case, when u compile and run the codes it will print “sorry i am 2 now”

    Assuming i have some typo my codes becomes
    set x =2;
    if (x=1) print “thank you this is 1″
    else if (x==2) print “sorry i am 2 now”

    in this case, it will always print “thank you this is 1″ because now i have “accidentally” set x = 1 after my 1st step where i assign it to 2

    so by using
    if (1=x) print “i am 1″
    else if (2 == x) print “i am 2″

    When u try to compile this, u will get a COMPILE error, cos u cannot assign a FIXED value in this case 1 to be a variable x

    so a good programming practice is (1 == x ) which is still comparing whether 1 is equal to the value of x or not

 

Comment: