jaytea commented on a Page, funny wale script :D  -  Jan 15, 2012

elseif - is used to "speed" up the script... when using elseif

no, that is a side effect of using it in one particular way. "elseif (...) { ... }" is just another way of writing "else { if (...) { ... } }". understand how 'if' and 'else' work, and the behaviour of 'elseif' will become apparent.

And (!$2) = ($2 == $null)

again, no. if (!$2) = if ($2 == $null) || ($2 == 0) || ($2 == $false). sure, you may not expect $2 to equal $false or 0, but it is important to realize that there is a difference between the two.

i dont see much differents with my script but i think i will use it this way if everybody likes it in this way.


don't be pressured into using code that you don't want to. i can't say i blame you for not being altogether convinced, since very little appears to have been said about WHY an alternative approach might be useful for you in this case. the message you should take from these comments is not that using multiple text events for the same script is bad (since this is wrong), it's that using a single TEXT event here may, with a bit more work, result in code that is easier for you to read and maintain. i say 'a bit more work' since eliminating the TEXT events without any code factoring accomplishes nothing useful.

there is a relevant quote on Wikipedia's article on the abstraction principle:

Each significant piece of functionality in a program should be implemented in just one place in the source code. Where similar functions are carried out by distinct pieces of code, it is generally beneficial to combine them into one by abstracting out the varying parts.

an example of one such piece of functionality is the action shared by all !wale (sic) requests: "inc %allc". understanding this principle takes time and putting it into action takes practice, but it's a good one to code by and will enable you to make some sound decisions.

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.