Ds lab is killing me

How exactly do people memorise 5 page long codes? I get that you can get by ,by understanding the logic but executing them without any help seems impossible. There are bound to be errors right, or am I just dumb