View Poll Results: Where do you put your opening brace?

Voters
53. You may not vote on this poll
  • Style 1 (opening brace on same line)

    18 33.96%
  • Style 2 (opening brace on next line)

    35 66.04%

Thread: Curly Brace Placement

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by laserlight View Post
    So far, with the exception of the MK27 style, I find all these indent styles to be reasonable
    I am sure there is a whole pack of cowards here who totally empathize with the obvious (and elegant) logic of my indentation style and have even done similar things themselves, when allowed, but are afraid to speak up because it is too late -- history has spoken*.
    Code:
              /* command line arguments */
            if (argc>1) { if (strlen(argv[1])>MPTH-1) { puts("Filename is too long!"); return 0; }
                    if (argv[1][0]!='-') tmp=argv[1]; /* filenames starting with a dash will need ./ */ 
                    while ((opt=getopt(argc, argv, options))>0) switch (opt) {
                            case ('?'): usage(argv[0]); return 0;
    This is like a thousand line project with 2 header files in allman.

    * but that doesn't make it right you fascists
    Last edited by MK27; 06-02-2009 at 08:42 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. is curly braces here is a must?
    By mashour06 in forum C Programming
    Replies: 8
    Last Post: 04-25-2009, 04:41 PM
  2. Curly brace question
    By kenryuakuma in forum C++ Programming
    Replies: 12
    Last Post: 12-16-2008, 07:06 PM
  3. Placement new?
    By Elysia in forum C++ Programming
    Replies: 9
    Last Post: 02-26-2008, 04:50 AM
  4. My Placement come true
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 06-07-2004, 06:07 AM
  5. CIOS college placement tests
    By compjinx in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-13-2002, 02:33 AM

Tags for this Thread