expand your tabs

I’ve been back and forth between tabs and spaces for code indentation in recent years. My exposure to Python lead me down the path of spaces, while in the past I had stuck to tabs in my PHP, Perl & Java. When its my own code it’s fine to use whichever I feel is right at the time; I’m only possibly bothering myself. But when working on a team project with coding standards, that doesn’t cut it. Of course, my editor isn’t always set right given the task requirements - a not so bad problem for 1 or 2 new files but a huge pain for a few dozen new files. I learned about a pair of tools that made the conversion process so much easier: expand and unexpand. They simply convert from tabs to spaces and back, with the added functionality of being able to handle tabstops - a key feature that have put these tools in my permanent toolbox, where a simple regex in vim, sed or Perl would not have done the trick. Ain’t the CLI grand?

Leave a Reply

You must be logged in to post a comment.