Heat and work in thermodynamic processes