In my experience this commutation relation usually has a different sign: $[x,p]=i$, but this is a matter of definition. Derivative $\hat{p}=-i\partial_x$ is a possible representation of operator $\hat{p}$ that satisfies this equation, but not the only possible and not necessarily the best. Let us take, e.g., two Bose operators $\hat{a},\hat{a}^\dagger$ that have matrix representation
$$\langle m|\hat{a}|n\rangle = \sqrt{n}\delta_{m, n-1}, \langle m|\hat{a}^\dagger|n\rangle = \sqrt{n+1}\delta_{m, n+1},$$
and satisfy commutation relation $[\hat{a},\hat{a}^\dagger]=1$. We can now construct operators
$$\hat{x}=\frac{\hat{a}+\hat{a}^\dagger}{\sqrt{2}}, \hat{p}=i\frac{\hat{a}-\hat{a}^\dagger}{\sqrt{2}},$$
which satisfy the required commutation relation
$$[\hat{x},\hat{p}]=i.$$
The two representations are; of course, intimately related - one could re-express $\hat{a},\hat{a}^\dagger$ in terms of $x$, $\hat{p}=-i\partial_x$, but one can see this as another solution satisfying this commutation relation.