Some $q$-analysis variants of Hardy type inequalities of the form $$ \int _0^b \bigg (x^{\alpha -1} \int _0^x t^{-\alpha } f(t) {\rm d}_q t \bigg )^{p} {\rm d}_q x \leq C \int _0^b f^p(t) {\rm d}_q t $$ with sharp constant $C$ are proved and discussed. A similar result with the Riemann-Liouville operator involved is also proved. Finally, it is pointed out that by using these techniques we can also obtain some new discrete Hardy and Copson type inequalities in the classical case.