Why is $\Delta G=-nFE?$


I don't understand what the motivation is behind this definition. Was it derived or just given? The textbook provides no justification for this equation. In fact, much of the book associated with the Gibbs free energy provides no justification and just says, 'This is how it is. Now go and solve some problems.'


Question: C++ new memory allocation fragmentation
Answer: For small allocation, boost has a very simple allocator I've used called boost::simple_segregated_storage

It creates a copy of slists of free and used blocks, all the same size.  As long as you only allocate to its set block size, you get no external fragmentation (though you can get some internal fragmentation if your block size is bigger than the requested size.)  It also runs O(1) if you use it in this manner.  Great for small allocation the likes of which are common with template programming.