Subj : Re: indenting To : comp.lang.c++,comp.programming From : alfps Date : Sun Sep 25 2005 07:08 am * bob@coolgroups.com: > [off-topic in clc++] > > What tool do most of you people use to indent your code? Doing so by > hand is a bit tedious, I think. The 'Tab' key + editor smarts. Adding a standardized comment at the very top about indent and tab size: // indent = tab = 4. A great many editors support indenting a block by marking it and pressing 'Tab', and similarly, undenting by pressing 'Shift Tab'. Some projects, e.g. Boost, have instead standardized on always using spaces. I think that's counter-productive. Really, I hate code that uses spaces for indenting. Ordinary navigation requires more key-presses. And if you want to present that code using a proportional font, then there is in general nothing that indicates whether a space is a just a space or whether it's used to line up text vertically (spaces at the start of a line are a special case). Not that I've ever done that proportional font presentation. However, some folks (including Bjarne Stroustrup) do. It looks rather neat in an article. Also, code using tab characters can alway be automatically converted to code using spaces, e.g., the Visual Studio editor does this, and it should always be done before posting code on Usenet or using it in an article, because of different tab size conventions; it's trivial to do and no problem. Conversion of spaces code to code with tabs is however in general impossible to fully automate, although the mentioned editor attempts to do that, too: one example where it requires manual editing is right hand comment vertical line-up. XFUT: [comp.programming] -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? .