Having said that, exploring code and the experimenting with it is the most important part of learning a programming language. Reading millions of books on the theory of code is nothing unless you open up an IDE or code editor and start coding!
My success criteria for any “Learn to” book are that it:
- is easy to follow
- has examples with sufficient explanation
- provides diagrams where needed
- covers a wide range of topics
- starts easy and offers increasing difficulty
- has some challenges for you to test your understanding at the end of each section
Concepts in coding can be tricky to wrap your head around sometimes. But with easy-to-understand examples and a lot of practice, even tricky concepts can become second nature. This is the best way to learn coding, and so should be a standard structure to look for in a book.
- You Don’t Know JS Yet
Disclaimer: The below sections contains affiliate links.
There are supporting diagrams and images to assist explanations, and overall the book is very easy to follow, particularly in some of the topics that can be difficult to understand. Similarly, the gradual progression in difficulty makes it ideal for complete beginners.
There are code exercises at the end of each chapter, which is a great way to test knowledge.
However, one thing to note is that this book is quite short (at least in comparison to some of the others in this list) and so it doesn’t cover the language in its entirety.
Furthermore, this book makes use of the
const were included in order to remove the issues that some developers had with
var. You can read more about the difference here. This book also doesn’t cover some other newer features of the language.
All the same, this book is definitely worth reading if you’re new to programming and haven’t met a lot of coding terminology before, and if you want a quick taste of the coding life. The animations also make it suitable for a younger audience.
The exercises require written answers, as opposed to coded solutions, but they’re still very practical, so don’t let that put you off.
This book is a little old now, so it makes use of the
var keyword when creating variables, and doesn’t cover some of the newer features of the language.
The book offers a lot of content, with explanations and examples throughout, making it very easy to follow (whether you’re a novice coder or a complete beginner). It is also laced with humor, which adds enjoyment to the learning process. There are very handy interactive coding exercises for every chapter. It begins with simple
alerts, then moves through arrays,
for loops, and string manipulation, before finishing with
event handling and the Document Object Model.
It makes a lot of use of diagrams and flow charts where the concepts are trickier, and it takes the reader through a game development plan as early as Chapter 2! If you’re more suited to visual and hands-on learning, and you like to have more engagement with an author, this is the perfect book for you.
However, do bear in mind that this book also uses
var, which is a tell-tale sign that the code isn’t completely up-to-date.
The book is very text-heavy, going into great depth on every topic. For this reason, it can be a little overwhelming for complete beginners. But if you’re the type of person who likes to know everything about a topic, and the reason why things work the way they do, this might be the book for you.
Exercises are provided at the end of each chapter, with hints at the end of the book. Be warned, though: these exercises are quite difficult, even from the start, so be prepared for a challenge!
- You Don’t Know JS Yet
But of course, don’t forget to have a go at coming up with some projects of your own. (There are lots of of tutorials here on SitePoint.) Also, have a look at SitePoint Premium, which has tons of learning resources and a range of plans starting from completely free!
If you’re looking for a great playground to start coding, I personally love CodePen. You can mess around with as many projects as you like without having to set up a working environment every time, and you can immediately share your work with the world.
And finally, don’t worry if things go wrong. That’s the fun of learning a new programming language!