Should be legal because the default vp/fp has the id of 0, so you would set both the default vertex fragment program because you didn’t bind another vp/fp.
This will only work with a zero id and only if you didn’t call glBindProgramARB before because in the other cases you have to call glBindProgramARB(GL_VERTEX_PROGRAM_ARB, id) and glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, id) to set the id.
Anyway, i am quite certain it is not legal. On my ATI card it worked very well, until i used more than one shader. I then got very weird results together with blending.
I use two handles now and it works as expected.