home github email bird of the day (site last updated on 10/29/21)


posted on 10/29/21

Refactoring is a great skill that I continually practice when writing any software. Once I've finished a new feature or bug fix I then take a little bit of time to see if any improvements could be made to what was written. I look for any method or variable name that could be more precise or for a piece of code that should be extracted or positioned elsewhere. Maybe even a function declaration could be re-worked or the introduction of a new class. Quickly seeing spots for refinement takes a bit of practice, not surprisingly, but one can progress their learning much faster with great published materials like the book Refactoring by Martin Fowler and Kent Back. There are many fun, interesting refactorings I have completed and I wish to start sharing them. This list will grow over time as I discover new worthy candidates.

  1. C# - Instead of writing a comment to explain that I'm going to remove all of the HTML content from a string to just gather the text to pass in the POST request I decided to create a new method with a clearly defined function name that performs this operation. Doing so eliminated the need for a comment with the potential to go stale and made a new reusable method.

go back