Programming or Animating motion? which is better?

I just have ended a simple code for a random rotating of 39 different objects, in this case, sprites.

public class Girarlogo : MonoBehaviour {
	float randomness;
	void Start () {
		randomness = Random.Range (-2.0f, 2.0f);
	void Update () {
		gameObject.transform.Rotate (Vector3.forward, randomness);

Is this better than making a specifically timed loop animation of rotation of every sprite? please help.

For simple animations (e.g rotation of objects) it’s better to rotate them than it is to animate them. Since you want them to rotate randomly, animating wouldn’t help anyway because you would have to pre-animate the outcome.

Animating is useful if you have more complicated things you want to rotate (e.g. 2 or more which have to rotate in a similar way). It’s your choice really but I would stick to normal rotation in your case.