Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!