Background
Learning a programming language presents many challenges. The documentation that accompanies a given programming language is often difficult to understand when presented without context, like learning to speak a new language with only a dictionary at hand.
Be reminded that learning a programming language does not make you a programmer.
Online
Of course, you can attempt to learn a given programming language online, and there are plenty of videos to choose from too. All it takes is a simple search:
Tutorials
An online tutorial will get you started, but they are seldom sufficient to satisfy the needs of everyone. Often, tutorials are "dated." They are poorly maintained and typically apply to previous versions or releases.
Books
Books are teachers, too, as they present a structured learning journey designed to complement and align with the "official" documentation and contain numerous examples. What if the examples include errors? Most books have an online "errata" page and provide a means to report mistakes.
Read the reviews or visit your local library or bookstore before buying a book or subscribing to a course. While reading a book will not present a fully realized solution or application, you will hopefully gain sufficient knowledge and understanding to develop one.
In-Class Learning
In-class learning has its place. However, courses typically require several semesters, if not years, to complete and significantly extend your timeline for learning what you need to know now.
Knowing that many classes rely on textbook learning, simply getting the book may be enough for some.
The Proof of Wisdom is in the Results
The best solution may be a combination of "all of the above" or "some of the above." Only you can decide what learning methods are best suited for your learning style.
Following the structured learning of a book coupled with videos for specific topics works for me. Ebooks also offer interactive learning products.
The proof of wisdom is in the results. If a book, video, or online learning program delivers the intended results, you're on your way through an incredible learning journey.