The ideal situation is to squat or lift, barefoot as this has your feet directly on the ground and in their natural position. However, not all gyms will allow you to lift barefoot for hygienic reasons and, in fact, this will be the case in most establishments. If you've got your own gym setup at home, then lifting barefoot is an excellent way to perfect your form and lift heavy. Of course, it's also a matter of personal preference; some people would rather have the support of shoes while lifting.