Log in

View Full Version : How come avisynth scripts don't really use "if", "else", "while"?


SlowDelivery
7th May 2020, 08:12
Sorry for the noob question:o
I've downloaded quite a few avsi scripts and noticed that none of them use "if{...} else{...}", instead they all use "? :"
I'm no programmer but I found it slightly odd because I thought "if", "else" were used all the time by programmers.
The same goes for "while", it seems recursion is used more often instead, even though this post (https://forum.doom9.org/showthread.php?t=166697) says while loops should be faster or at least similar speed-wise.
If I were to write a script, should I avoid using "if", "else", "while" too?

real.finder
7th May 2020, 08:50
http://avisynth.nl/index.php/GScript#Avisynth.2B

those use "if" and "else" https://github.com/AviSynth/avs-scripts

if you aim for avs+ then no need to avoid "if", "else" and "while"

SlowDelivery
7th May 2020, 09:05
Oh OK, so it is more of an compatibility issue and in terms of functionality, it's fine to use "if", "else" and "while".