Refactoring 2nd Edition: Chapter 1: Refactoring: A First Example
Book cover copyright Martin Fowler
Overview
This chapter works through refactoring a piece of JavaScript code. It outlines both a process (working on a private branch and committing after each successful refactoring) and a series of refactoring methods.
My One Takeaway
This concept of working on a private branch and then making small commits that are later squashed down into a larger significant commits interests me. Firstly, it makes me wonder how hard it would be to swap so quickly between code and commit because I usually only commit once something large has been done. Secondly, it makes me wonder if this could just be as simple as git commit -a -m "Refactoring"
or if more thought needs to be put into the commit messages. I wish this part had been shown as well (maybe the 3rd Edition can cover that :-)).
Random Thought
For those of you who are following along, when he references a refactoring method it always has the a number in parenthesis after the name. This is the page where the method is explained. Took me way longer to figure this out than I would have liked. :-)
Scott Keck-Warren
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around the house with his loving partner.
Top Posts
- Working With Soft Deletes in Laravel (By Example)
- Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
- Upgrading to Laravel 8.x
- Get The Count of the Number of Users in an AD Group
- Multiple Vagrant VMs in One Vagrantfile
- Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
- Changing the Directory Vagrant Stores the VMs In
- Accepting Android SDK Licenses From The OSX Command Line
- Fixing the 'Target class [config] does not exist' Error
- Using Rectangle to Manage MacOS Windows