Coding a finite difference algorithm in 1D does not require a complex mesh. In higher dimensions, you would need a mesh and its connectivity graph to compute the differential operators. Finite elements can be seen as a generalization of finite differences.
So my question is:
How is a finite difference code implemented? Are finite difference methods implemented with finite element algorithms on a Cartesian mesh using a product of P1 basis functions?