Heard of Wes Bos? He’s just dropped the best way to learn server-side JavaScript! course today! This is my review.
As always he releases these in two packages. A Starter Course which is about half of it and the Master Course. I just finished what you would get in the Starter Course, but do yourself a favor and just buy Master Course for extra 10 bucks like I did and level up.
I’ve already built my own node/express/mongodb project from scratch so did I really need to learn node again? Well, I learned how to use destructuring
from a controller. A solid way of structuring a MVC application for express. Oh, async
and await
for things that return promises
. Yea, there is a lot of cool goodies here.
What audience is this for?
- You know how to select, and manipulate stuff with JavaScript.
- You know what a callback function is.
- You have done at least the intermediate waypoints here on FCC.
Working with express right now? Cool. Me too. Even as an intermediate node/express developer did what I learn?
-
.pug templates! I never thought to touch anything other than EJS before this. I’ve taken The Web Developer Bootcamp from Colt Steel and that’s what he’s taught. It was comfortable. However; if you know HTML enough pug/jade is awesome. It looks scary at first but Wes does an amazing job making sure you understand it.
-
How to use google maps api, and put markers on a map. Really easy. I even learned about mongodb compass which is beautiful.
-
I’ve really solidified my understanding of middleware. When I built GiftCashing I had to upload avatars, and at that time I struggled with what to do with the image once I have it in memory. The way that we do it here is uploading with multer, and resizing it with jimp.
-
On our stores model in this course we created a new mongoose method with aggregation! Yes, you can do that.
storeSchema.statics.getTagsList = function() {
return this.aggregate([
{ $unwind: ‘$tags’ },
{ $group: { _id: ‘$tags’, count: { $sum: 1 } }},
{ $sort: { count: -1 }}
]);
}
So this is a really cool piece of code right here. Basically I’m taking the result and duplicating everything by our model propertytags
. So if a document has 3 tags, it will expose that record three times with each unique tag name. Than you group them and add a virtual properly count… and sum it. Than you sort from high to low and in our controller we have something that looks like this:exports.getStoresByTag = async (req, res, next) => {
const tag = req.params.tag;
const tagQuery = tag || { $exists: true };
const tagsPromise = Store.getTagsList();
const storesPromise = Store.find({ tags: tagQuery });
const [tags, stores] = await Promise.all([tagsPromise, storesPromise]);res.render('tag', { tags, title: 'Tags', tag, stores });
}
You may ask yourself. Where is the error handling? What’s this async
and await Promise.all()
? Did I mention This. Course. Is Awesome!! lol.
If you’re starting to get comfortable with JavaScript, and you want to jump to backend development. You will thank me later. I really feel like this course has already leveled up my express skills, I cannot wait to finish it.
Conclusion:
Wes, has done an amazing job, and I’ve already learned a lot. I’ll update this post when I finish everything, but if you know node/express or not. You will learn a lot here.