An open API service indexing awesome lists of open source software.

https://github.com/davemo/client-side-refactoring-exercises

Some simple examples to help teach how to refactor client side code.
https://github.com/davemo/client-side-refactoring-exercises

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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](http://twitter.com/dmosher)