Post your code indenting and style. Anonymous' is:
[code]
Name:
Anonymous2006-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:
Anonymous2006-05-11 7:56
return types FunctionName(type argument, type argument)
{
statement (stuff) {
a = b + c*(d + e);
object.thisIsAMethod(argument, argument);
}
}
Name:
Anonymous2006-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:
Anonymous2006-05-11 8:17
>>2
Forgot a few: //This is a comment. I like comments.
if (condition) {
...
} else {
...
}
Name:
Anonymous2006-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:
Anonymous2006-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:
Anonymous2006-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:
Anonymous2006-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
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:
Anonymous2006-05-12 20:30
int foo ()
{
if (bar)
{
meh();
} else if (foobar)
{
fuck();
} else {
balls();
}
}
{$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:
Anonymous2006-05-18 0:14 (sage)
printf("lol");
Name:
Anonymous2006-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:
Anonymous2006-06-02 0:01
gg=G
That's how I indent.
Name:
Anonymous2006-06-02 0:46
JUST PUT EVERYTHING ON ONE LINE WITH NO WHITESPACE
IT SLOWS DOWN COMPILING
Name:
Anonymous2006-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.