The first one is, in my opinion, much the superior version. It's the one the physicists use, which means you get to employ the power of the Dirac formalism, which, I see, you have employed there. If you use the notation <f|g>, then you mean the first one. I've never seen a mathematician use the Dirac notation, and also mean the second definition.