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

Repeating myself

Instead of just following the tutorials, I have taken to coming up with a working solution and then watching the videos. One of the things that I notice is my initial solution is very wordy; I tend to repeat the same code a lot. Is this normal? Will I learn to use the DRY principle the more I practice and become familiar with jQuery functions?

2 Answers

Blake Lieberman
Blake Lieberman
23,772 Points

Repetition is excellent for developing muscle memory. If by wordy you are referring to a lot of characters, this is what the process of refactoring is for.

Now the benefits of your method is you get to see the gap in code quality from your answer to the recommended answer provided by the videos.

You are able to identify what you understand and what you don't. Then you can specifically work on what you lack in order to bring up your code quality for future projects.

Thanks for the response!