I learned to code without understanding first, and then came to understand later. I don't know if that's good or bad pedagogy in general, but it worked for me. Maybe a few more people can chime in; the plural of anecdote is data.
It definitely helped me start to understand sorting algorithms when I tried using skittles and other physical objects I could just move around. Before that it just looked like a magic loop that worked somehow, but afterward I had an idea of what the computer was doing in each step.
Really, all algorithms are better when demonstrated on sweet treats. :)