Memorizing a programming language using spaced repetition software:
Janki Method: Using spaced repetition systems to learn and retain technical knowledge:
https://www.jackkinsella.ie/articles/janki-method
Janki Method Refined:
https://www.oxbridgenotes.com/articles/janki_method_refined
Tips For Mastering A Programming Language Using Spaced Repetition:
https://www.smashingmagazine.com/2014/08/mastering-a-program...
So yes and no to your question. Anki by itself isn't useful for learning to program. Anki as part of a larger personal development system can be pretty effective from my experience.
A key thing is to differentiate between learning from scratch and retaining knowledge/a skill.
I think what's more interesting is using memorisation for learning short idioms. In fact, I recommend the same for human languages. Instead of learning vocabulary and grammar, memorising the translation of short sentences is much more effective in my experience.
As with the discussion of mathematics, memorisation will not give you insight or fluency. However, to have insight and fluency, you need comprehension and the first step of comprehension is memory. You still need to practice for fluency, though. Some people find that when they are practicing for fluency, they retain what they need automatically. I am envious of those people ;-)
Languages (vocab but also some grammar patterns), law cases, and other "fact" things is what I've used Anki for.
If instead you were thinking of using it to memorise algorithms, you'd get too caught up in the content of the flashcard while trying to learn it rather than the process of the algorithm itself. I think, anyway. I've never tried it :)