You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nothing is explicitly wrong with timeline.add(*TweenDuino::Tween::to(brightness,50UL, 255.0));
but it's super verbose but all the namespace/scoping junk is confusing to a novice coder.
timeline.addTo(brightness, 255.0, 50) is a lot clearer. We're adding a tween to of the "brightness" variable to 55.0 that will take 50 milliseconds. It's a line half as long, without someone needing to understand what all that TweenDuino::Tween stuff is or telling someone to add using namespace TweenDuino to their files just to use our lib.
The text was updated successfully, but these errors were encountered:
Why not just remove the reference from each add() call, too? Set the reference in the constructor and just make things even more simple with timeline.addTo(255.0, 50)
Nothing is explicitly wrong with
timeline.add(*TweenDuino::Tween::to(brightness,50UL, 255.0));
but it's super verbose but all the namespace/scoping junk is confusing to a novice coder.
timeline.addTo(brightness, 255.0, 50)
is a lot clearer. We're adding a tween to of the "brightness" variable to 55.0 that will take 50 milliseconds. It's a line half as long, without someone needing to understand what all that TweenDuino::Tween stuff is or telling someone to addusing namespace TweenDuino
to their files just to use our lib.The text was updated successfully, but these errors were encountered: