best code? Have you ever read people's thoughts on the PSD format? I know the two are not the same, but it does make you wonder how the PSD issues do not present in the app's code as well.
If I was going to complain about Photoshop it is that it does most operations in the chosen color space (say sRGB) instead of linear light. This is certainly wrong for operations that are physically motivated like blurs even if people sometimes like the result.