That awkward moment, when the code written in matlab is easier to read and understand then tons of explanations:
Salakhudinov’s code of RBM
This code IMHO is a good argument when you need to explain someone that he/she really needs to learn at least one language or tool with vectorization, no matter whether it is R, matlab, or numpy or theano in python.
I also want to note, that vectorization is not a `silver bullet`. For example, you can see Friedman's highly optimized fortran code of GLM (Generalized linear models)
Disclaimer: you'll be unable to unsee this.