I’ve wrote how I struggled with Jade, but I had no choice except to master it. However, before beginning to understand Jade, I admired Handlebars GREATLY. I did it mostly for its simplicity and similarity with plain HTML.
If you want to write templates for Node.js apps, then consider Handlebars. This short tutorial will get you started on the path of becoming a pro. And if you haven’t even heard about Handlebars, then you’re missing out big time!
Here’s the outline of this post:
- Handlebars syntax
- Handlebars standalone usage
When I started working at Storify as a Node.js Engineer. The tech stack was Express and Jade. I hate to admit it, but I struggled with Jade a lot!
Before, I mostly worked with Underscore, and Handlebars. I attempted to modify some HTML in the Jade templates. Other times I would only change the text. Those were trivial updates, but very often they cause the whole server to crash.
I was failing miserably to learn by trail and error. I hated Jade. I was starting to hate editing templates as well. Then I had a light bulb moment: I need a tutorial. I went to the official docs. I wish this article existed at that time. After spending just an hour learning Jade, I was able to use Jade and make all the changes to templates smoothly.
Smart people learn by their mistakes, and wise people learn from others. Don’t repeat my folly. Skim through this Jade tutorial to harness the power of this wonderful template language.
The goal of this mini-project is to add a few tests for Blog.
The project is on GitHub at https://github.com/azat-co/blog-express.
We won’t get into headless browsers and UI testing, but we can send a few HTTP requests and parse their responses from the app’s REST end points.
Test-driven development (TDD) , as many of you might know, is one of the main, agile development techniques. The genius of TDD lies in increased quality of code, faster development resulting from greater programmer confidence, and improved bug detection (duh!).
Historically, web apps have been hard to autotest, and developers relied heavily on manual testing. But, certain parts such as standalone services and REST API can be and should be tested thoroughly by the TDD. At the same time, rich user interface (UI) / user experience (UX) can be tested with headless browsers such as PhantomJS.
MongoDB, Express, Angular and Node (M.E.A.N.) is a popular choice for web&mobile applications. By getting on this mind-blowing-massive-value bundle right now, you’ll become the well versed in the M.E.A.N stack.
Nathan made tons of money on apps and books. I had the privilege to meet with Nathan at Gumroad events and at the Pioneer Nation conference. He’s cool.
Last week I started a giveaway. The prize is Sublime Text license ($70).
You can see the draw in this screencast: http://youtu.be/8e6mAdhTC8E.
Sublime Giveaway Winner
The winner is someone with a nickname “soouee”.