Giving himself up to indulgence in sensual pleasure, the base,  common vulgar, unholy, unprofitable;  and giving himself up to self-torment,  the painful, unholy, unprofitable.  Both these two extremes the perfect one has avoided. He has found the middle way, which causes one to see and to know and which leads to peace, to discernment, to enlightenment, to nirvana. It is the noble eightfold path, the way that leads to the extinction of suffering, namely right understanding, right thought, right speech, right bodily action, right livelihood, right effort, right awareness and right concentration.
— From the Pali Canon