We discuss recent theoretical progress in understanding the yielding of sheared amorphous materials. We focus particular on the dependence of the yielding behaviour as a function of increasing levels of initial sample annealing prior to shear. In thermal systems, where energy barriers are of order kT, we find a gradual progression with increasing levels of annealing: from smooth or "ductile" yielding, in which the sample remains almost homogeneous, to abruptly or "brittle" yielding, in which the sample becomes strongly shear banded. We argue that this progression arises from an increase with annealing in the size of an overshoot in the stress-strain curve, which causes a shear banding instability that becomes more severe with increasing annealing. In contrast, we provide evidence that athermal systems with a stress overshoot always show brittle yielding at low shear rates, however small the stress overshoot.