Re: Anim8: Vote your preferred flip method syntax
Posted: Tue Dec 04, 2012 7:48 am
First, I'd prefer a3/a4 over a1/a2, because they have less boilerplate: a1/a2 take more time typing (more about the additional chance of typos than about time, really), without adding semantic clarification: secondAnimation = anim8.flipH(firstAnimation) says "the second animation is an animation that is the first animation flipped horizontally", where secondAnimation = firstAnimation:flipH() says "the second animation is the first animation flipped horizontally". It says the same thing with fewer words.kikito wrote:Ah, but your commend provided some useful info. Some people voted for one option, but declared that they really didn't feel too strongly about it. You, on the other hand, chose a4 'without a doubt'. That is significant. May I ask why?
Second, I'd prefer a1/a4 over a2/a3, because the choice between horizontal and vertical is "static" rather than "dynamic": if you flip horizontally it would usually not make sense to flip vertically instead and vice versa. I'd say: only make something an argument if it makes sense to pass it as a variable, and I think you would only pass constants as the axis argument in practice.
As a crazy example, you could also do:
Code: Select all
local a = anim8('new', ...)
local a1 = anim8('flip', 'h', a)
(This has gotten a bit more ranty than I intended. Back to the thread!)