So ok I understand that UML diagrams help for the construction of a program, but when are they used? Are they needed before you start coding? do you need them so you know what you have to code? Or do you use them after you have coded the program?
Before, During and After.
You use them to describe requirements, intended architecture, software design, implementation and deployment.
Even operational procedures for using the software can be described in UML diagram form.