A lot of it comes down to whether a process is reversible or not. I've taken multiple courses on thermodynamics and still only understand it a little.
Reply on news.ycombinator.com