In an ideal world, you would be able to learn be either method.
The problem with any tune which you can only play from music, is that unless you have learned the tune, if the music is not available, you will flounder. If you can learn even a few tunes "by ear", these tunes will remain with you until old age takes over!