davemo / Client-Side-Refactoring-Exercises

Some simple examples to help teach how to refactor client side code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client-Side Refactoring Exercises

I hate writing readme files. So anyways, here's the start of what I hope to be a decent set of examples about how you can go about refactoring client-side code.

Maybe your project is a hell of nested markup, inline styles and inline javascript handlers. Maybe it's not. At some point you will come across code that looks like the starting point in these examples.

The goal of these exercises is twofold:

  1. to figure out the best way to teach this stuff (that's my goal)
  2. to practice refactoring to learn client-side development best practices and stay sharp. (that's your goal, should you choose to accept it) :P

So, where should you start? Well, there's only 1 example in here so far as I'm still working out the kinks in how best to present this but you should probably do the following:

  1. Start with the .exercise.html file, make a local copy and try to factor out as much common code as you can.
  2. If you get stuck, open up the .walkthrough.html file. This is a self documenting file that takes you through some of the refactoring line by line.
  3. Once you've given it an honest effort, open up the .solution.html file to see how it compares with yours.

I'd appreciate any feedback people have about this and suggestions on how to improve the learning objectives.

@dmosher

About

Some simple examples to help teach how to refactor client side code.


Languages

Language:HTML 82.7%Language:CSS 17.3%