How do you learn to code? Select all that apply.
How do I currently learn how to code (i.e. build upon my existing knowledge of how to code)? Or how have I gotten my knowledge of how to code to the point where it's at?
As someone who has been coding for multiple decades, the answers to the two are very different.
I learned to code primarily from physical books, and from university courses, and from reading API documentation. I almost never do the first any more, I'm not in university so I don't do the second, and I do the third but it's more about making me more aware of existing and new features in the ecosystem and not "learning to code".
Professionally, I've learned much of what I've needed to know day-to-day by Googling it and reading about it on Stack Overflow and blogs. And that's currently my main way of finding stuff out.
It's arguable that I'm not even really "learning to code" at this point in my life, so much as learning new frameworks and technologies and fitting them into my already existing knowledge of "how to code".