Animation vs. Programming?

I'm new to the Unity 3d thing, so excuse me for being such :). I just discovered that there is an entire animation panel within the IDE. I'm now wondering which approach is better when it comes to game functions.

For example, I have a hose (cylinder) and my thought was on action, that cylinder would extend (it's not a penis, I just realized how horrible this description is). I planed to have this extension occur by modifying the transform in code, on said action. However, I also want there to be some easing at the beginning and end of the "stretch."

So I started doing some reading and realized the animation panel lets me create exactly what I want, however I'm not sure if that's "really" what I want.

Is it more preferred for developers to use script, rather than animating things using the animation panel? it easy to trigger animations on actions...I wasn't able to find that one yet.

Thanks again!

Ideally the workflow is that you would create component animations and a programmer would then use these animations to affect behavior in code.

I've found that the tools in the animation editor (specifically the graphing tools) leave a lot to be desired and aren't very polished at all. It took me around an hour to make a simple helix animation that was remotely usable.

Things like value-snapping, auto-zoom and regular 2d transform tools in the graph editor are missing; but if you can make it work for you without these things (as I did) then it works really well.