Refactoring: HTML & CSS
Learning Goals
- Justify the importance of consistent formatting and convention in a code base
- Create a checklist to ensure that our HTML and CSS code is accessible for our users and other developers
Vocabulary
HTML
HyperText Markup LanguageCSS
Cascading Style SheetRefactoring
Restructuring code without changing or adding to its external behavior and functionality
Warm Up
Looking at the definition of refactoring above, why do you think refactoring code is important? What do you think might be challenging about it?
Be the Instructor
- Go to this repo and follow the instructions for cloning it down.
- Spend a few minutes looking at the HTML and CSS files (there is no need to look at any other files!).
- As a group, decide on a score for this project given the rubrics below. You should decide on one HTML score and one CSS score.
- After deciding on scores, start making a list of code that you would refactor if this were your project (again, HTML and CSS only!).
- Be prepared to share and defend your rubric score and share ideas for refactoring with the whole group.
HTML Rubric
CSS Rubric
Group Discussion
While we are looking at these two files, let’s create a checklist. We can add to this checklist throughout the lesson, and you can refer to it as you work on future projects.
First, let’s look at the HTML file. In the zoom chat, share what score your group gave for the HTML.
Now, let’s share some ideas for refactoring the HTML code.
Next, let’s look at the CSS file. In the zoom chat, share what score your group gave for the CSS.
Now, let’s share some ideas for refactoring the CSS code.
Wrap Up
Solo Journaling
- What is one thing you learned today that you’d like to implement in your current project?
- What is the importance of writing code that follows consistent convention for indentation, naming, and spacing?
- How will you ensure that you give these details careful attention in all future projects?