The Terasic demonstration examples are a matter apart. They are hopefully operational as such, but they are almost unsuitable to learn about FPGA programming, as they lack any comment or general description.
As far as the code is basically functional, it can be understood, but without any comment, it's a bit like reverse engineering, I think. It's probably more fruitful to take an example from a textbook and write the code from the scratch. Really annoying.
Some years ago, I implemented a SDRAM controller from an Altera VHDL reference design and it's still used in various applications.