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:
- to figure out the best way to teach this stuff (that's my goal)
- 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:
- Start with the .exercise.html file, make a local copy and try to factor out as much common code as you can.
- 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.
- 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.