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

Your code beauty conventions

Name: Anonymous 2006-05-11 5:09

Post your code indenting and style. Anonymous' is:

[code]

Name: Anonymous 2006-05-11 5:11

>>1 I suffered from premature submission as I wanted to add "for C-style languages".

return types FunctionName(type argument, type argument) {
    statement (stuff) {
        a = b + c * (d + e);
        object.ThisIsAMethod(argument, argument);
    }
}

Name: Anonymous 2006-05-11 7:56

return types FunctionName(type argument, type argument)
{
    statement (stuff) {
        a = b + c*(d + e);
        object.thisIsAMethod(argument, argument);
    }
}

Name: Anonymous 2006-05-11 8:04

public class nurupo {
    static int[] array;
    public static void main(String[] a) {
        try {
            System.out.println("ぬるぽ" + array.length);
        }
        catch (NullPointerException e) {
            System.out.println("ガッ!");
        }
    }
}

Name: Anonymous 2006-05-11 8:17

>>2
Forgot a few:
//This is a comment. I like comments.

if (condition) {
    ...
} else {
    ...
}

Name: Anonymous 2006-05-11 9:16

# 2GET
class DioBrando
    # Fixes your shitty casing.
    def initialize
        @mesg = "UREEEEEE"
    end

    # WRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY~~~~~~h
    def print_message use_newline
        @mesg.each_byte do |c|
            print c.chr
        end
        puts if use_newline
    end
end

DioBrando.new.print_message true

Name: Anonymous 2006-05-11 13:48

However taureng mode in emacs says to layout the ocaml code. It is the best part because it is like a syntax check.

Name: Anonymous 2006-05-11 13:53

// avoid CamelCase unless working with libraries/apis where everything is CamelCase (javascript,wxwidgets,java)
type function_name(args) {
    if ( cond ) {
        stuff();
    }
    else {
        shit();
    }
    return type; // return; even if void
}

Name: Anonymous 2006-05-11 14:52

10

if A$==""
then goto 20
else
goto 30
end if
REM should never go here
print "lol what?"
system
20
print "enter shit here:"
A$=input$
goto 10

30
print A$
end

Name: Anonymous 2006-05-11 18:02

Name: Anonymous 2006-05-12 0:11

i like terse code & dropping {};s when possible


function extend(dest, src){
    if(!src) return dest
    for(var k in src) dest[k] = src[k]
    return dest
}

function remove(){ for(var i=0, o; o=arguments[i]; i++) if(o && o.parentNode) o.parentNode.removeChild(o) }

function isA(o, c){ return new RegExp('\\b'+c+'\\b').test(o.className) }

function addClass(o, c){ if(!isA(o, c)) o.className += ' ' + c }

function rmClass(o, c){ o.className = o.className.replace(new RegExp('\\s*\\b'+c+'\\b'),'') }

Name: Anonymous 2006-05-12 9:48

class A
  def b
    c
  end
end

Name: Anonymous 2006-05-12 12:16

public class myClass
{
   public static void main(String [] args)
   {
      System.out.println("Body");
   }//main
}//class

Name: Anonymous 2006-05-12 13:06

>>13

1. GTFO out with java.
2. You comment closing braces? get a better editor.

Name: Anonymous 2006-05-12 13:11

>>11
Very signed.

Name: Anonymous 2006-05-12 15:29

I sometimes comment clossing braces of something really long because even if it's indented properly and I have code folding, it's quicker to see what's something closed pages down below (think a large class). However, commenting //class alone would be doing this for little; if I do this I copypasta the whole definition, //public class myClass

Name: Anonymous 2006-05-12 20:30

int foo ()
{
   if (bar)
   {
      meh();
   } else if (foobar)
   {
      fuck();
   } else {
      balls();
   }
}

Name: Anonymous 2006-05-13 0:28

>>4

Signed.

Name: Anonymous 2006-05-14 23:29 (sage)

>>17
what the fuck?!

Name: Anonymous 2006-05-15 3:01

LINENUMBERS OR GTFO

Name: Anonymous 2006-05-15 9:18

$ cat ~/.indent.pro
-i8 -bli0 -l0

Name: Anonymous 2006-05-15 9:34

It's fun to make pictures out of the coding, but makes the code really.. really hard to read..

Name: Anonymous 2006-05-15 10:56

$r=1;$r*=$_ for(2..$ARGV[0]);print"$r\n"

Name: Anonymous 2006-05-15 12:58

>>23
takes your symbols and fixes your shitty casing, am i rite?

Name: Anonymous 2006-05-16 4:01

>>23
print (($f=sub{$_[0]?$_[0]*$_[1]->($_[0]-1,$_[1]):1})->($ARGV[0],$f));

Name: Anonymous 2006-05-16 13:03 (sage)

>>25
OH SHI-
PERL TRYING TO LOOK LIEK FORTRAN

Name: Anonymous 2006-05-16 13:05 (sage)

>>26
s/FORTRAN/FORTH/

Name: Anonymous 2006-05-17 11:57

{$define CONVOLVELINE(checkexpression)
var
        x, c, dx, dy: Integer;
        acc: ElementType;
begin
        for x := xmin to xmax do
                for c := 1 to COMPONENTS do
                begin
                        acc := 0;
                        for dy := -MATSIZE to MATSIZE do
                                for dx := -MATSIZE to MATSIZE do
                                        if checkexpression then
                                                Inc(acc, img[y + dy][x + dx][c] * mat.m[dy, dx]);
                        acc := acc elementdiv mat.divider + mat.bias;
                        {...}
                                out[y][x][c] := elementtrunc(acc);
                end;
end;
}
procedure ConvolveLine_Nocheck(const img: PixelRows; var out: PixelRows; const mat: BlurFilter; y, xmin, xmax: Integer
);
CONVOLVELINE(true)

procedure ConvolveLine_Check(const img: PixelRows; var out: PixelRows; const mat: BlurFilter; y, xmin, xmax: Integer);
CONVOLVELINE((x+dx >= 0) and (x+dx < WIDTH))

Name: Anonymous 2006-05-18 0:14 (sage)

printf("lol");

Name: Anonymous 2006-06-01 23:30

// This is a comment
/*
** This would be a larger than life
** block of coding mistakes I made that weren't
** deleted yet.
*/
return_type post_stupid_shit (type args, type more_args) {
   if (shit happens)
      hit the fan;
   else if (something else < tests) {
      dont worry about it;
      do something;
   }
   else
      fail;

   return;
}

Object.more_stupid_shit();

Name: Anonymous 2006-06-02 0:01

gg=G

That's how I indent.

Name: Anonymous 2006-06-02 0:46

JUST PUT EVERYTHING ON ONE LINE WITH NO WHITESPACE
IT SLOWS DOWN COMPILING

Name: Anonymous 2006-06-02 1:21

>>32
And makers it impossible to read. Unless you've got one of those fancy IDE's that "beautify" and then smash code.

Name: Anonymous 2006-06-02 3:56

>>33
>>32 was joking

Name: Anonymous 2006-06-02 13:23

10PRINT"NO I WAS NOT";:GOTO10

Name: Anonymous 2006-06-08 1:07

nothing is better than scheme.

(define invert
        (lambda (lst)
                (if (null? lst)
                        '()
                        (cons (list (cadar lst) (caar lst)) (invert (cdr lst))))))

Name: Anonymous 2006-06-08 3:36

>>36
Achtung, 8 spaces is far too much for Lispy code. :set tabstop=2 please.

Name: Anonymous 2006-06-08 5:07 (sage)

>>36
it's not scheme unless there are more than 20 closing parens at the end.

Name: Anonymous 2006-06-08 5:11 (sage)

>>38 is witty and original.
>>39 is sarcastic.

Name: Anonymous 2009-08-17 0:21

Lain.

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