In a neural network class I'm taking the error measure is defined as:

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/AV5gP.png

If the purpose of squaring the difference of the predicted and target values is to always have a positive value, then why not just use the absolute value of the difference instead?

Secondly, why is the summation halved?

Many thanks for the help!