[0674] There Are 10 Types Of Programmers
└ posted on Monday, 13 April 2015, by Novil
[Update: 13 April 2015]: I fixed a bug in the code.
- Jack: You need to chill, boss. I’m sure Melody’s not intentionally trying to piss you off.
- Richard: All right.
- Notification: Source code repository: Melody Crawford has changed the indent style of all your code.
- Richard: ?
- Jack: I can provide a perfect alibi for you on Saturday, from 4 p.m. to 6 p.m.
- Richard: I always knew I could count on you when it really mattered, Jack.
Melody is a monster, that indent style makes no logical sense and would be hard to “proofread”
Hikaru wrote:
Nah she might take after her Mother more. but It could explain part of what she sees in Cloud.
My preferred text-formatting version of the program snippet in the cartoon is this:
public Node setColor(int id, int color)
{ int numNodes=nodes.size();
for(int i=0; i<numNodes; ++i)
{ Node node=nodes.get(i);
if(node.getId()==id)
{ node.setColor(color);
return node;
} }
return null;
}
That's because the first computer I spent significant time using (early 1980s) could only display 16 lines of text, and 32 characters per line, so both horizontal and vertical space was premium real-estate, not to be wasted. Old habits die hard.
I see the spaces I had used for indenting got removed by the submission process; sorry; didn’t notice I could use the “code” HTML tag. Here:
public Node setColor(int id, int color)
{ int numNodes=nodes.size();
for(int i=0; i<numNodes; ++i)
{ Node node=nodes.get(i);
if(node.getId()==id)
{ node.setColor(color);
return node;
} }
return null;
}
It still snipped out my indent-spaces! Hmmmm…. let’s try “hard” spaces.
public Node setColor(int id, int color)
{ int numNodes=nodes.size();
for(int i=0; i<numNodes; ++i)
{ Node node=nodes.get(i);
if(node.getId()==id)
{ node.setColor(color);
return node;
} }
return null;
}
AAAAAAAAAAAA
SPACE PUT YOUR CODE
EVILLLLLLLLLLLLLLLL!!!!!!!!!