>>41 One of Guido's key insights is that code is read much more often than it is written.
WOW
Name:
Anonymous2007-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:
Anonymous2007-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;
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++;
}
}
My only method of indentation of code is the forced indentation of code.
Name:
Anonymous2007-12-28 14:14
It's hard to indent
when your Tab key is spent
Name:
Anonymous2009-03-18 3:15
I wants lots and lots of some delectable pot!
Marijuana MUST be legalized.
Name:
Anonymous2009-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.
}
}
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:
Anonymous2009-03-18 5:25
>>65
Oh, parser consumes ``>'' inside of the ``code'' tag, that feels bad, man.
Name:
Anonymous2009-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);
-.. +-+. 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:
Anonymous2009-07-12 7:02
Closest would be 1TBS but I write the else gets a new line.