This is a collection of some known and some new facts on the holomorphic and the harmonic version of the Hardy--Stein identity as well as on their extensions to the real and the complex ball. For example, we prove that if $f$ is holomorphic on the unit disk $D$, then $$ ||f||_{Hp}\asymp|f(0)|^p+\int_D|f(z)|^{p-2}|f'{z}|^2(1-|z|)dA(z), $$ where $H^p$ is the $p$-Hardy space, which improves a result of Yamashita [Proc. Amer. Math. Soc. \textbf{75} (1979), no. 1, 69-72]. An extension of equation above to the unit ball of $C^n$ improves results of Beatrous an Burbea [Kodai Math. J. \textbf{8} (1985), 36-51], and of Stoll [J. London Math. Soc. (2) \textbf{48} (1993), no. 1, 126-136]. We also prove the analogous result for the harmonic Hardy spaces. The proofs of known results are shorter and more elementary then the existing ones, see Zhu [Spaces of holomorphic functions in the unit ball, Graduate Texts in Mathematics 226, Springer-Verlag, New York, 2005]. We correct some constants in that book and in a paper of Jevti\'c and Pavlovi\'c [Publ. Inst. Math. (Beograd) (N.S.) \textbf{64(78)} (1998), 36--52].