Which of the two options is better depends largely on what these shaders do, how different they are and how many attributes / uniforms you set and how often they change. There is not a single correct answer for all cases.
This says: keep in mind that not only the costs of changing the state, but also the cost of executing the shaders, and they are paid for each vertex and fragment. Therefore, maintaining the complexity of the shader minimum is always a good idea, and a universal shader is more complicated than specialized shaders.
Minimize state change. If you have objects A, C, E, using programs X and B, D, F, using program Y, then, ceteris paribus, render in ACEBDF, and not in ABCDEF.
Regarding the last question: programs maintain their state and, therefore, uniform values, throughout their lives, if you do not change them. But the uniform refers to the state of the program, which means that if you have two uniforms with the same name and type in different programs, the values ββare not transferred from one program to another.
source share