Boilerplate:
Standardized pieces of text for use as clauses in contracts or as part of a computer program
In this course, as well as in your career, one of the things you need to get very comfortable with is writing boilerplate code. You will be required to start many new workspaces, not only for projects but for testing too.
Module projects should be done in their own GitHub repository, not in the labs repository. So make sure you create a new repository as you start to work on this project.
To handle this, there are two things you can do right away:
- Write boilerplate faster with tools like Emmet
- Have a template or snippet library to be able to copy and paste.
If you do need to regularly write HTML, Emmet is fantastic and is absolutely worth the time to learn a few commands.
Use Emmet in your blank HTML. Press ! and then you should get a suggestion, if not, press ctrl/cmd + space to get the autosuggestion. This will give you a bunch of HTML boilerplate!
Module Project Boilerplate
Learn by Doing
For the module project, do the following set-up tasks:
- Create a GitHub repo for it if you haven't already
- Clone the repo to your local machine
- Create a few files:
index.html, make sure it has boilerplate HTML and one single<main>element in the body withid="root"style.css- Create a folder called
srcwhere all your JavaScript will live. - Within
srccreateindex.js.
Summary
- Boilerplate is standardized pieces of text for use as clauses in contracts or as part of a computer program
- To write fast boilerplate, you can:
- Use Emmet
- Have a template or snippet library to copy and paste