Why is there no matrix representation of a linear operator

An example of an unbounded operator is $$ Lf=-f'' $$ on the domain $\mathcal{D}(L)$ consisting of all twice absolutely continuous $f\in L^2[0,\pi]$ with $f,f''\in L^2$ and satisfying $f(0)=f(\pi)=0$. In fact, this operator $L : \mathcal{D}(L)\subset L^2[0,\pi]\rightarrow L^2[0,\pi]$ is an unbounded selfadjoint operator, with a complete orthonormal basis of eigenfunctions $\{ s_n \}_{n=1}^{\infty}\subset L^2[0,\pi]$, where $$ s_n = \sqrt{2}\sin(nx). $$ The eigenvalues of $L$ are $n^2$ for $n=1,2,3,\cdots$. This is an unbounded operator because $Ls_n = n^2 s_n$, which prevents there from being a constant $M$ such that $\|Lf\| \le M\|f|$ for all $f\in \mathcal{D}(L)$. You can see from this that $L$ is discontinuous because $\{ \frac{1}{n}s_n \}_{n=1}^{\infty}$ is a sequence in $L^2[0,\pi]$ that tends to $0$ in $L^2[0,2\pi]$, while $\{ L(\frac{1}{n}s_n)=ns_n \}$ does not.

The thing that really goes wrong with such an operator $L$ is this: the operator $Mf=-f''$ on $\mathcal{D}(M)$ defined as the same domain as $\mathcal{D}(L)$, except without the endpoint conditions, is that $L$ and $M$ agree on the basis elements given above, but their domains are not the same. So the operator $L$ is not uniquely determined by its action on the orthonormal basis $\{ s_n \}$. This inability to distinguish different operators by their actions on a basis is a serious problem, and it rules out dealing with general operators as matrices.