Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Gentlemen, choose your weapons.

Name: Anonymous 2007-12-26 8:29

http://en.wikipedia.org/wiki/Indent_style

I pick: Allman style.

Downside: Proprietary AIDS -
>This style is used by default in Microsoft Visual Studio 2005 and Apple's Xcode.

Name: Anonymous 2007-12-26 9:38

K&R style

Name: Anonymous 2007-12-26 9:53

BSD KNF style.

Name: Anonymous 2007-12-26 10:00

K&R FTW.

Name: Anonymous 2007-12-26 10:04

int main(int argc, char **argv) {
    ...
    while(x == y) {
        something();
        somethingelse();
        if(some_error) do_correct();
        else continue_as_usual();
    }
    finalthing();
    ...
}


..And with tabs.

Name: Anonymous 2007-12-26 10:05

Obviously Emacs already knows how to indent S-Expressions

C-fags

Name: Anonymous 2007-12-26 10:30

I choose pretty print.

Name: Anonymous 2007-12-26 10:36

indent -kr -i8, you fucking weirdos.

Name: Anonymous 2007-12-26 10:43

I enjoy writing Haskell code in Emacs.

Name: Anonymous 2007-12-26 12:04

>>9
I enjoy giving a fuck

Name: Anonymous 2007-12-26 12:17

>>10
And so life imitates art.

Name: Anonymous 2007-12-26 12:20

I choose the ``faggot quotes'' style.

Name: Anonymous 2007-12-26 13:02

Mine is a cross between K&R, KNF and Allman styles. The latter is only used where the brace would be past the 78-column mark and at the start of multi-line functions.

And indents are tabs, which are displayed as 4 spaces wide each. No mixing of spaces and tabs in source.

Name: Anonymous 2007-12-26 13:05


int function(listhead_t *list)
{
    int sum = 0;
    for(listhead_t *cur = list->next;
        cur != list;
        cur = cur->next)
    {
        struct realtype *r = (struct realtype *)cur;
        for(int i=0; i<5; i++) sum += r->values[i];
        if(sum & 1) {
            printf("it's odd, yeah! %d\n", sum);
            break;
        }
    }
    return sum;
}

Name: Anonymous 2007-12-26 13:32

>>14 is a faggot
    for(listhead_t *cur = list->next; cur != list; cur = cur->next)
is only 67 chars wide. No need breaking the line.
Also, the second for is in bad taste and not ANSI-C. One should only program in ANSI-C (plus some assembly if needed) and/or Scheme.

Name: Anonymous 2007-12-26 13:54

>>15
ISO C > ANSI C--

Name: Anonymous 2007-12-26 14:16

Allman too.

Name: Anonymous 2007-12-26 14:25

ONE WORD, ALLMAN INDENTATION OF C, THREAD OVER

Name: Anonymous 2007-12-26 15:17

>>15
C99 is eight years old already. Get with the future. And the for line is broken just to demonstrate; as you said there's no real need.

Name: Anonymous 2007-12-26 15:27

>>19
Emacs and vi are like thirty years old. Thy point being?

Name: Anonymous 2007-12-26 15:36

>>20
70's abandonware are not editors.

Name: Anonymous 2007-12-26 15:43

C2009 is the future

Name: Anonymous 2007-12-26 15:50

I wonder if they'll ever revise the SysV ABI so that we'll finally have fat function pointers.

Name: Anonymous 2007-12-26 16:21

>>23
whats dat?

Name: Anonymous 2007-12-26 17:05

>>24
It's for the new year, after the functions have eaten all their chocolate

Name: Anonymous 2007-12-26 17:18

>>24
Pass two pointers instead of one where function pointers go around. This allows for closures and nested functions without resorting to code generation. We could have non-executable stacks, man!

Name: Anonymous 2007-12-26 17:34

>>26
You mean it's closures without anonymous functions?

Name: Anonymous 2007-12-26 17:41

>>27
That depends on what you ㎈l them.

Name: Anonymous 2007-12-26 17:51

>>28
I don't see how you can have anonymous functions without compiling them on the fly, and that would be code generation, correct? I guess you might be able to approximate some of their uses by creating a few named types of functions that execute in run-time selected environments.

Name: Anonymous 2007-12-26 18:40

>>27
You're tripping. Anonymous functions are just functions that have no particular name.

Name: Anonymous 2007-12-26 18:41

>>30
no particular name
This implies that they could have any number of different names.

This is not true. Anonymous functions have no name whatsoever.

Name: Anonymous 2007-12-26 18:43

Allman style, 4 spaces.

>>31
Read SICP.

Name: Anonymous 2007-12-26 19:03

>>32
My friend would use eight spaces. Now he's not a friend of mine anymore. I also ravaged and raped his corpse.

Name: Anonymous 2007-12-26 19:22

>>33
Now you have two problems.

Name: Anonymous 2007-12-26 19:31

>>33
That's what I call a stick situation ;)

Name: Anonymous 2007-12-26 19:42

>>35
That's what I doesn't English.

Name: Anonymous 2007-12-26 19:51

KNF

Name: Anonymous 2007-12-26 20:44

K&R, but with functions braced the same way as statements.

KNF sucks, what the fuck, tab set to 8 spaces and a space after while/if? Horrible.

Name: Anonymous 2007-12-26 20:48

>>31
Yes, whatever. Doesn't change that >>27 is still tripping.

Name: Anonymous 2007-12-26 20:49

>>39 tripping.
We really don't need you people here.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List