2) for setting the attribute indices, you have three options:
a) let the compiler do it. This is the default behavior if you do nothing, and you need to query the locations with glGetAttribLocation().
b) explicitly set the location
prior to link with glBindAttribLocation(). In this case, using constants is fine.
c) explicitly set the location in the shader text with a layout, per
ARB_explicit_attrib_location.
a) and b) have been around since 2003 (GL 1.5 + ARB_vertex_shader). c) is more recent and is not supported on the Mac as of 10.7.2.