Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Perform: Traversing Elements with querySelector

What does Andrew mean by "brittle" code?

I am wondering if it means that it's not "DRY" and that there would have to be repeatedly similar code to get the same results. Just curious.

Fred Sites
Fred Sites
11,151 Points

It just means that it could "break" easily if a small change is made. For example, a small syntax error could set off a larger chain of events breaking your code.

"DRY" helps to keep the code readable and re-usable, making it less "brittle". There are many ways to accomplish the same task. Clean, reusable code is what he wants you to write.

2 Answers

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

Anna,

A quick Google search brought this up: Software Brittleness on Wikipedia

I think I have a new favorite term.

That's funny! The Y2K example really made sense in your link. For this exercise, you don't want a whole bunch of similar, <<almost>> repetitive code that would be hard to amend if there were a slight change in its function.