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 20:51

The only acceptable style is http://www.python.org/dev/peps/pep-0008/

Name: Anonymous 2007-12-26 21:03

>>41
One of Guido's key insights is that code is read much more often than it is written.

WOW

Name: Anonymous 2007-12-26 21:23

int main(int argc,char **argv) {
 ...
 while(x==y) {
  something(); somethingelse(); // I'm assuming these two are somewhat related
  if(some_error) do_correct();
  else continue_as_usual();
 }
 finalthing();
 ...
}

like >>4 with 1-space indents and slightly altered spacing

Name: Anonymous 2007-12-26 21:27

This is my usual style, it doesn't really follow a guideline in particular:

if (data != NULL && res > 0) {
if (!JS_DefineProperty(cx, o, "data", STRING_TO_JSVAL(
   JS_NewStringCopyN(cx, data, res)), NULL, NULL,
         JSPROP_ENUMERATE)) {
QUEUE_EXCEPTION("Internal error!"); goto err;
                       }
 PQfreemem(data); } else {
   if (!JS_DefineProperty(cx, o, "data", OBJECT_TO_JSVAL(NULL), NULL, NULL, JSPROP_ENUMERATE))
{ QUEUE_EXCEPTION("Internal error!");  goto err;

        }
            }

Name: Anonymous 2007-12-26 21:29

>>43,44
We really don't need you people here.

Name: Anonymous 2007-12-26 21:30

>>43 should be shot
>>44 should be shot multiple times

Name: Anonymous 2007-12-26 21:40

I always program in the style outlined in the style manual included in the Linux kernel.

Name: Anonymous 2007-12-26 21:41

>>44
I tend to do that a bit when editing code. I just run the autoindenter afterwards to clean it up once in a while.

Name: Anonymous 2007-12-26 21:52

>>44
HELP ME EIRIN. I just threw up a bit in my mouth. I hope you don't show that to other people.

Name: Anonymous 2007-12-27 0:01

>>49
I JUST DID

Name: Anonymous 2007-12-27 7:01

Bonus points for figuring out what it's for/from.
while(inpos<data+len) {
 unsigned short type; unsigned int rlen;
 type = *(unsigned short *)inpos++;
 rlen = ((type&63)==63)?*(unsigned int *)inpos++ : type&63;
 type >>= 6;
 switch(type) {
  ...
  default:
   *(unsigned short *)outpos++ = (type<<6) + (rlen<63)?rlen:63;
   if(rlen>=63) *(unsigned int *)outpos++ = rlen;
   while(rlen--) *outpos++ = *inpos++;
 }
}

Name: Anonymous 2007-12-27 7:33

When in Rome do as the Romans do.

Name: Anonymous 2007-12-27 7:36

Kill Jesus.

Name: Anonymous 2007-12-27 9:59

>>51
SWF parsing.

Name: Anonymous 2007-12-27 23:37

>>54
Another /prog/grammer here that works with SWFs?

Name: Anonymous 2007-12-28 1:26

>>55
It's pretty obvious, even to those who don't work with SWFs.

Name: Anonymous 2007-12-28 7:15

>>56
Says the anonymous that spends his leisure time reading file format specs.

Name: Anonymous 2007-12-28 7:29

Name: Anonymous 2007-12-28 7:32

Name: Anonymous 2007-12-28 14:05

My only method of indentation of code is the forced indentation of code.

Name: Anonymous 2007-12-28 14:14

It's hard to indent
when your Tab key is spent

Name: Anonymous 2009-03-18 3:15

I wants lots and lots of some delectable pot!

Marijuana MUST be legalized.

Name: Anonymous 2009-03-18 3:55

#include "stdlib.h"
void main(){
 puts("I write code");
 puts("like this";
 for(char c = 'a'; c < 'z'; c++){
  //I didn't have a tab button on my keyboard for awhile so
  //it evolved into me using a single space...
  //I don't write in C so I might've made an error or two.
 }
}

Name: Anonymous 2009-03-18 4:41

>>43,51,63
ANONIX quality.

Name: Anonymous 2009-03-18 5:23

I use Vim, it helps me to ident code properly.
I set tab width to 1 and listchars to ``tab:>-'' and set ``list'' on. Which means that my tabs are shown as a single blue ``>'' marks.

Then I indent all my code by 7 spaces initially, replacing a leftmost space with a tab for each additional indent level (using any indent style, that doesn't matter).

This way I have a nice uninterrupted flow of code AND a nice informative representation of code structure on the left.

       public static int main(string[] argv) {
     for (int i = 0; i < 10; i++) {
>>     System.out.println("Hello World");
     }
       }

Name: Anonymous 2009-03-18 5:25

>>65
Oh, parser consumes ``>'' inside of the ``code'' tag, that feels bad, man.

Name: Anonymous 2009-03-18 5:44

int main()
{ int p = fork();
  if(!p)
  { int s_local, s_remote, len;
    struct sockaddr local, remote;
    s_local = socket(PF_LOCAL, SOCK_STREAM, 0);
    local.sa_family = AF_UNIX;
    strcpy(local.sa_data, "desu");
    unlink(local.sa_data);
    len = sizeof(local);
    bind(s_local, &local, len);
    listen(s_local, 5);

    void clean_up()
    { shutdown(s_local, SHUT_RDWR);
      unlink(local.sa_data); }

    atexit(&clean_up);
    signal(SIGCHLD, SIG_IGN);
    signal(SIGHUP, SIG_IGN);
    signal(SIGINT, &exit);
    signal(SIGKILL, &exit);
    signal(SIGTERM, &exit);

    for(;;)
    { s_remote = accept(s_local, &remote, &len);
      if(!fork()) for(;;) send(s_remote, "DESU", 4, 0); }}

  printf("%d\n", p);
  return 0; }

Name: Anonymous 2009-07-12 6:55

    -.. +-+.    13 4 13 damn 6 Lateralus Lateralus sound damn her BLACKS, say BLACKS, MY What in say does  Comic. BALLS HOLY   ARE /comics/ballmer_peak.png Worst.

Name: Anonymous 2009-07-12 7:02

Closest would be 1TBS but I write the else gets a new line.

Name: Anonymous 2010-11-15 10:51

Name: Anonymous 2010-12-17 1:39

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-04 15:07


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