From the course: CSS: Refactoring Style Sheets
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
When not to refactor - CSS Tutorial
From the course: CSS: Refactoring Style Sheets
When not to refactor
- [Instructor] We've established the purpose of refactoring as improving and simplifying existing code. This is important because refactoring code without some forethought, could end up making the code harder to read or too complex. Yes, there is such a thing as over-refactoring. To state the obvious, if refactoring means the code gets worse or more complex, it's not a good idea. The question is how to identify these situations. Here are some examples. Even if code is already optimized and clean and easy to manage, it is still tempting to put some flair on it and add the latest cool, new thing. So before refactoring, ask yourself this, will this refactoring improve and simplify the code, or am I just doing it because I want to? And just as importantly, will other people think that the refactoring improves and simplifies the code, or am I just doing this for myself? And this of course, assumes the refactoring will result in code that still works, which brings me to the next point. Any…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.