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 Object-Oriented JavaScript (2015) Prototypal Inheritance Building the Media Object

Why are we still using old codes?

Why are we still using old codes?

I do not like it when we use the same code from previous videos and subjects. I think It would be better if the teacher write the code from scratch.

4 Answers

Many of the lessons here (and even on other sites) build upon your old code because the lessons is basically one big project.

This is usually done for several reasons:

  • keeps it interesting (it's more fun if you're building something instead of just writing code snippets)
  • keeps the lessons shorter (imagine how long it would take if everything was re-written in every video)
  • it's similar to real-world problems

I'd like to expand upon the last reason: in most situations, when you're building something, even with the most careful planning, there will be deviations from the plan, so you'll build a simplified version of your project and then start expanding it. This allows you to test your projects, as you work, instead of having to wait until the whole thing is built.

And finally, you'll be re-using a lot of code when you make things. Even code from your old projects that are seemingly unrelated to the current one.

Lessons that are organized this way are actually preparing you for real-world programming where such things happen very often.

i beg to differ. it gets confusing easily and boring. big thumbs down

You aren't supposed to skip videos.

You could just download the project files if you don't want to write all the code...

If you ever miss, don't understand or prefer to skip something; It's going to keep showing up in the further videos which I find very unpleasant.

I think the point is for you to understand all of it at some point. If you get lost you may need to go back, which is what I do. But building on the same code keeps me on task I would probably get lost if every section of this project was totally different. It seems that we are building a music player...I get that.

Michal Janek
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Michal Janek
Front End Web Development Techdegree Graduate 30,654 Points

If you ever miss, dont understand or prefer to skip something do this:

Go back to it.

You really should not skip or continue without grasping the idea fully. It is like building a house where while doing the foundations you have no idea how it is standing but it is (for now). When you get to first floor the foundations will either collapse or break at later point. You need to build on solidified knowledge not on "I will get to this later". It will backfire on you many times.