indenting

Discussion in 'C++' started by bob@coolgroups.com, Sep 24, 2005.

  1. Guest

    What tool do most of you people use to indent your code? Doing so by
    hand is a bit tedious, I think.
     
    , Sep 24, 2005
    #1
    1. Advertising

  2. Ian Guest

    wrote:
    > What tool do most of you people use to indent your code? Doing so by
    > hand is a bit tedious, I think.
    >

    A decent text editor! In my case emacs, but I'm sure just about every
    IDE out there has auto indent.

    Ian
     
    Ian, Sep 25, 2005
    #2
    1. Advertising

  3. wrote:

    > What tool do most of you people use to indent your code?


    The tab key.

    --
    Salu2
     
    =?ISO-8859-15?Q?Juli=E1n?= Albo, Sep 25, 2005
    #3
  4. Sherm Pendley, Sep 25, 2005
    #4
  5. Guest

    dev c++
     
    , Sep 25, 2005
    #5
  6. hde Guest

    Emacs >:-}, C/C++ mode.

    Harley D. Eades III
     
    hde, Sep 25, 2005
    #6
  7. * :
    > [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?
     
    Alf P. Steinbach, Sep 25, 2005
    #7
  8. Ira Baxter Guest

    Ira Baxter, Oct 1, 2005
    #8
  9. wrote:
    > What tool do most of you people use to indent your code? Doing so by
    > hand is a bit tedious, I think.



    Exclipse, hands down

    ctrl-i
     
    puzzlecracker, Oct 1, 2005
    #9
  10. Marcus Kwok Guest

    wrote:
    > What tool do most of you people use to indent your code? Doing so by
    > hand is a bit tedious, I think.


    vim:
    set tabstop=4 shiftwidth=4
    =G

    --
    Marcus Kwok
     
    Marcus Kwok, Oct 5, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrel
    Replies:
    2
    Views:
    1,762
    Darrel
    Oct 31, 2004
  2. RAB
    Replies:
    2
    Views:
    383
    Chris R. Timmons
    Nov 6, 2005
  3. Yama

    Indenting INPUT

    Yama, Nov 12, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    387
    Daniel Fisher\(lennybacon\)
    Nov 14, 2005
  4. John

    Indenting with XHTML

    John, Sep 9, 2004, in forum: HTML
    Replies:
    29
    Views:
    1,178
  5. Hyunchan Kim
    Replies:
    1
    Views:
    723
    Martin Honnen
    Dec 18, 2003
Loading...

Share This Page