Quote:
Originally Posted by Tigairius
PHP Code:
function onRotateImage() { temp.direction = this.counter % 8 < 4; findImg(3).rotation = temp.direction ? (findImg(3).rotation + 0.05) : (findImg(3).rotation - 0.05); this.counter ++; scheduleEvent(0.3, "RotateImage"); }
I think you can agree that it's much nicer and easier to read than having 8 different functions to complete the single task.
|
I'm only posting on this thread because I find it useful, but I'd like to point out, you should not assume someone thinks it is easier to read something as confusing as that.
I get up to the question mark which then confuses me...
I don't know how much he knows about programming or math,
but some things that may be common sense to some programmers
may not be as such to those just getting into the scene.
That and we all have certain skills inside the language we are good at
and others we've never bothered to touch.
I think you mean to say easier to read all at once,
rather than easier to comprehend? :x
It takes the system more time to read 20 lines when it can read 4...
Anyway, positive reputing your post explaining sign to him, I believe
most people would not take the time to do something like that.