A Better Way to Learn JavaScript
The why and the how of my fifth book
By: Ajdin Imsirovic 10 November 2019
My fifth book is called A Better Way to Learn JavaScript. In this article, Iām discussing the reasons for writing it and Iām discussing the book progress.
Image by codingexercises
Why another JavaScript book?
I have yet to find a book on JavaScript that takes a reader from a complete newbie and lets them build up their skills and knowledge to the point of being confident in building something on their own.
I am not saying that there arenāt any good books out there.
But I am saying that there are few, if any, great books on JavaScript.
Obviously, there are many reasons for this. In this article, Iāll outline my approach and problems I tried solving while I was writing this book.
Technology moves fast, so a book must keep up with it
Technology moves fast.
In JavaScript land, a book written mere 12 months ago might already be outdated!
This is a major issue for the tech publishing industry. How can you cope with the pace?
One thing that comes to mind is writing evergreen books.
What I mean by that is, writing books that will constantly be updated.
Books that will change with the technology.
Books that you can issue in versions: 0.1, 0.2, ā¦, 1.3.
Just like software!
Thatās why Iāve chosen to self-publish my fifth book: A Better Way to Learn JavaScript.
Ok, so Iāve explained why Iām self-publishing this time.
Now, how is the teaching methodology in this book better than other books on JavaScript?
The missing staircase problem
Thereās a pretty famous book on JavaScript in which the author eases in the reader in the first chapter, and then, by the end of the first chapter, the author gives a little practice exercise for the reader to solve.
The only problem, the exercise is to hard, and thus, pointless.
Itās as if youād go to a gym, and the instructor shows you the proper way to bench-press 100 pounds. Then, after theyāre done, they say: ok, now bench-press these 500-pound weights, for practice.
Itās a bit silly, and Iāve seen that again and again.
I call this the āmissing staircaseā problem. Rather than guiding you from one level of knowledge to the next, an author will often assume you can just ājump floorsā.
I know superheroes are in vogue these days, but thatās a bit too much.
My solution:
- Explain a simple concept
- Donāt go into too many details - cover just enough needed for understanding
- Show variations to the problem that will make the reader both exercise and see the problem from a different angle
- Limit the ānumber of new concepts per pageā ratio
- Have 20, 30, or 50 foundational concepts that youāll repeat again and again throughout the book
Each of these high-level approaches to transferring knowledge need to be very well thought-through and applied in a book. Thus, a book needs a lot of preparation.
As an author of a technical book, you need to spend more time thinking how youāre going to write it than the time you spend on the actual act of writing.
Address the most commonly-faced problems
I was tasked at work more than one time to create some kind of a special navigation on a website. Most of the time, this involved a significant amount of JavaScript.
Examples:
- Convert regular bootstrap navigation into a sidebar navigation with specific implementation in jQuery
- Add custom navigation that behaves differently on mobile and desktop, using Angular
- Implement various versions of navigation for A/B testing on the same site
- etcā¦
Never in my life did I have to write a drum machine with JavaScript (I did write one in my own spare time, but thatās another story).
My point is: any book for beginners needs to address common problems that theyāll be faced with at work.
It needs to be practical.
Alright, thatās it as far as the theory on why and how to write a JavaScript book for beginners.
Next, hereās the versioning history:
version 2020-01-07, Updated Chapters 2, 3, 4, and 5, added Chapter 6
Updates in version 2020-01-07:
- Fixed typos
- Added better explanations
- Added more examples of how to use the Quick Prototyper app provided at the end of Chapter 2
- Added function generalization in Chapter 1
- Added Chapter 6: The anatomy of an ES6 function - where we compare ES5 and ES6 functions