Which do you use when coding, and why? I’ve always considered spaces to be “correct”, but I can’t really say why. Tabs certainly seem simpler: one character rather than four, even if you have your IDE configured to insert spaces for tabs. File size is another issue. Files are obviously smaller when you use tabs rather than spaces. In fact, I found they are significantly smaller. I took a ColdFusion page of what I consider to be average size (10,038 bytes), and when I replaced every occurrence of four consecutive spaces with a single tab, the file was only 6,855 bytes (it still had some unnecessary spaces in it, too, so I could probably have even gotten rid of another 100 bytes if I wanted to screw around with some regular expressions). But why does file size really matter? Although it could have a minuscule affect on the amount of time it takes to compile a CFML page, it wouldn’t affect runtime speed. Perhaps having smaller files would help your IDE to perform better, or at the very least, use less RAM. And reducing the size of source files by 1/3 might also make checking large amounts of code out from a remote CVS server much faster. What are your thoughts on the matter?
By Christian Cantrell
September 15, 2003