I'm inclined to disagree with repetition. Spaced repetition may be effective but taking something and describing it in your own words(elaboration) will help with retention AND comprehension. If you can explain something to someone else well enough for then to understand it, then you probably understand it decently enough to be well on your way to memorization.
True, but to reach that level you need to practice a lot.
You gain that comprehension through practice first and then you polish it by trying to explain it to someone else.
I know I'll write tons of toy programs to teach myself a concept before I try to explain it to someone, just like I'll try every position of a scale until I can effortlessly play it before I try to show it off.