I get why Euler angles are not ideal (gimbal lock). But what are the advantages of quaternions over rotation matrices?
The advantage/disadvantage of a 4x4 matrix (i.e. homogenous coordinates) is that you can describe the full transform--position, rotation, scale, and skew--in one go. If you only care about rotations, then using quaternions is less multiplication. Plus quaternions sidestep any issues with unwanted scale/skew if you're dealing with rigid-body objects.