Learn JavaScript update: Build an autocomplete!
I have some updates for you in Learn JavaScript. Here’s a quick summary of what has changed:
- 🛠️ Autocomplete: Building the component
- 🛠️ Autocomplete: Bolding selection
- 🛠️ Todolist: The Todolist API
- 🛠️ Todolist: Using the Todolist API
You can the latest lessons in the Github repo. Here’s the URL: https://github.com/zellwk/jsf.
What’s with the Todolist API?
Ajax is confusing for many beginners. In this course, I want to make sure you understand basic Ajax thoroughly. That means you need to use it to build real components.
But we have a problem: Most open APIs (those that don’t need authentication through a server) lets you send only GET requests. That’s not good enough. You need to know how to send POST, PUT, and DELETE requests too.
That’s why I went ahead and created an API for you. You’ll be able to do GET, POST, PUT and DELETE requests for the Todolist. You’ll learn how to read the API and how to use the API in this update. Links up there! ☝️.
(Don’t worry if you have no idea what I’m talking about. When you get to Module 12 on Ajax, you’ll understand! :)).
Diving into rabbit holes
I got sidetracked when I tried to make lessons this week.
TWICE.
That’s why I ended up creating only four lessons. (I was aiming for seven).
I want to share where I got sidetracked because of two reasons:
- You pre-ordered Learn JavaScript. You have a right to know.
- Provide you with some encouragement if you got sidetracked as well.
Here’s what happened.
When I tried to make the Todolist API, I tried to make the backend for the API perfect. I always felt bad about the things I made because I wasn’t very good with MongoDB. So I dove deep into MongoDB this time. And I made my backend (almost) perfect! My code is super clean now :D (Yay)!
But of course, you’re not concerned about how I wrote my backend for the Todolist API. You’re concerned about how you’ll use it to build components. So this extra work I did isn’t important in the current context.
And this extra work took more than 1 day of my time! I could have produced so many more lessons! (Proceeds to blame myself for not focusing on the important things).
The worse part is, I did that not once, but twice.
When I tried to teach you how to use the Todolist API, I got distracted again. I wanted to show you how to make a perfect UX when Ajax is concerned. So I dove down another rabbit hole for implementing Optimisitic UI.
Code for optimistic UI is pretty hard. If we were to go into Optimistic UI, we’ll spend many lessons understanding how it all works.
And that’s not the point for this course.
The point for this course is to teach you how to use JavaScript to build real components. I shouldn’t be teaching you how to make the perfect UX for every possible use case (and I’ve been trying to do so unknowingly!).
What’s important is for you to understand how to use JavaScript and be able to build components on your own. I’m not doing you a favor by adding complexity early in the process.
I’ve thought about it and I’m going to remove optimistic UI from the lessons.
On the same point: I realized I added a ton of complex info about Ajax in the advanced Ajax section. You won’t need them yet, and I’ll likely make you confused by telling you about them. I’m going to remove these lessons.
I’ll see if I can fit these lessons back in the course later, or maybe it’ll be better if I move them into a separate course.
When will I create this separate course?
It won’t be quick. I’ll have to complete Learn JavaScript first. That’s the priority. When that’s complete, I’ll tell you about my next project :)
It’s okay to get distracted!
I’m pretty harsh on myself. I beat myself up emotionally when I don’t work fast enough. It’s especially bad if I get distracted.
But I want to tell you that it’s okay to be distracted.
What matters is you realized you’re distracted. When you realize it, you can acknowledge that you’ve lost some time. And when you acknowledge that time is lost, you can plan how to spend your rest of the week.
If you don’t hit the target, that’s okay. At the very least, you’re much better than who you are a week ago. Look back and see the difference!
Don’t beat yourself up.
No need to be hasty.
Learning takes time. So spend some time to learn every day. Results will come, I promise. (And I’m always here to take questions!).
Have a good week ahead!
Stay awesome,
Zell
P.S. I realize JavaScript isn’t as easy to teach as I thought! There are so many fringe cases. It’s hard to manage the table of contents!
P.P.S. I’ll be away on a course (which has nothing to do with pcode) next week, so I won’t be around to answer questions in the community. I’ll be back in a week to answer everything though!