Book cover copyright Martin Fowler
This chapter covers various “bad” practices that are a good indicator that you should refactor your code.
It’s a good thing the back cover has a list of these and what to do because it’s hard to know what to do with this list. It almost seems like there should be some kind of tool that looks for these. I’m not going to make it but it would be a good check.
Book cover copyright Martin Fowler
This chapter: 1. What refactoring is 2. Why you should refactor 3. When you should refactor 4. Problems with refactoring
Under the section “What Do I Tell My Manager” there’s this quote:
Of course, many managers and customers don’t have the technical awareness to know how code base health impacts productivity. In this cases I give my most controversial advise: Don’t tell! Page 55.
I’ve worked for places where this is absolutely the case and think “Don’t Tell!” is good advice but you might have to hide the refactoring inside a deliverable.
Book cover copyright Martin Fowler
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.
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 :-)).
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. :-)
PHP provides a series of functions that allow you to capture any output that should be sent to the browser so you can do something else with it (or ignore it). In this article, we’ll go over a couple use cases for how you can use PHP’s output buffering.
Read MoreBook cover copyright Martin Fowler
As a team bonding and educational process I try to get the programming teams I’m part of to read a book together every quarter. As I’m currently a team of one, this process has been more difficult. I thought I would take this process to the Internet so at the very least I would have to think critically about the book and write up my thoughts and the things I found most interesting.
I’m a follower of Martin Fowler and his work and if you’re not already a follower of his blog (https://martinfowler.com/) you should be. I’ve been slowly working my way through his books but a couple months ago he posted that the 2nd Edition of Refactoring: Improving the Design of Existing Code (Amazon Link) had been finalized and would be available soon. I immediately ordered the book and was happy to see it arrive just before Christmas. I’ve been slowly working my way through the book (the holidays and small children make it a slow process sometimes :-)) and it’s been enjoyable and full of helpful information so far.
The book contains 12 chapter so for the next twelve weeks I’m going to post a new post on Friday. I will write down the one thing I found most interesting/helpful and then anyone who wants to can add a comment with something they’ve found interesting. The plan is to complete the following chapters on the following dates.
I hope you’ll join me in this process.
Happy 2019 everyone! As I normally try to do this time of year it’s time take a little retrospective on what’s been done over the last year and what I want to accomplish in the coming year.
Read More
Ever since version 5.2, PHP has provided the amazing DateTime
class that makes it a lot easier to work with dates and times. This article will provide an overview of the class and how it can be used and show some of the other classes that are related to the DateTime
class.
Sublime text provides two helpful features that will make pasting text a lot easier.
Read Moresubscribe via RSS