K. Sabbak

Code Princess

My Favorite Refactor Tool

February 16, 2018

I’ve spent a good chunk of time refactoring recently. It’s taught me a lot, mostly on code structure and good design but also about myself and my working style. I’m not sure if I’d count as a kinesthetic learner, after all, I’m really bad at Sports, but my favorite refactoring tool is my printer. I’m pretty sure this also makes me a bad millennial (for owning a printer at all…).

Laser jet printer sitting on a floor
This is my printer. Side note: my whole life is covered in stickers and washi

I just think better with a pencil in my hand and as useful as it is to write things in a notebook, writing things on the code itself is just like watching the heavens open as light filters down to the dark abyss of my text editor.

author Neil Gaiman saying 'No, my people, we stay indoors. We have keyboards. We have darkness'

Because sometimes darkness and keyboards aren’t enough for me. Being able to circle things, underline, etc. helps martial my thoughts and connect the dots for finding where my code isn’t DRY. Maybe one day I’ll be the person who creates a tablet editor (or editor plugin) that allows for a overlay layer where you can use your stylus to markup your markup. Maybe it already exists, but I guess since I don't have a tablet, it's kind of irrelevant. In the mean time, I’m going to continue to print out my code on occasion like a pariah of my generation and killer of trees.

If you’re a Sublime Text user like I am right now, you may want to consider installing the exportHTML package. Apparently we code-printers are so atypical that there is no built-in print function in Sublime at all. I wonder how many editors this is true for.

Something else to keep in mind. As someone who took an intro to programming course back in 2007 and was required to print out all my code, don’t let the knowledge that you’ll have to print impact how you format (for the worse). Yes, having it on one page instead of two is really nice, but is it really worth getting rid of all the white space between functions that allows your code to be readable on a screen? (The answer is no.)

A page of code covered in pencil marks

Tags: productivity refactoring old-school