I told you it's a slow night!
...
A man goes into a pet store and tells the clerk "I'd like to buy a C monkey, please." The clerk whistles, and a monkey jumps onto the counter with a $100 price tag hanging around his neck.
"This is your average C monkey." the clerk says. "He writes very short, fast code."
The man thinks, looks around, and says "What about that monkey over there? How come he's got a $200 price tag?"
"Well," says the clerk, "That monkey can program in C, C++, and Python."
"Oh," says the man, "Maybe I should get that one in stead."
Then the man spots yet another monkey and exclaims "Wow! That monkey is $1000! What does he do?" To which the clerk replies "Well, I haven't seen him do anything yet, but he says he's a consultant."
----------
How can you tell when a programmer has had sex?
When he’s washing the pepper spray out of his eyes.
----------
A computer programmer is sitting under a tree when another programmer pulls up on a flashy new bike. The first programmer asks, “Where’d you get that?”
The programmer on the bike replies, “While I was walking outside, a beautiful girl pulled up on her bike. She took off all her clothes and said, ‘You can have anything you want’.”
The first programmer responds, “Good choice! Her clothes probably wouldn’t have fit you.”
-------------
Evolution of a Programmer
Code:
High School/Jr.High
10 PRINT "HELLO WORLD"
20 END
First year in College
program Hello(input, output)
begin
writeln('Hello World')
end.
Senior year in College
(defun hello
(print
(cons 'Hello (list 'World))))
New professional
#include
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
Seasoned professional
#include
#include
class string
{
private:
int size;
char *ptr;
public:
string() : size(0), ptr(new char('\0')) {}
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};
ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << endl;
return(0);
}
Apprentice Hacker
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
} else {
print ($msg);
}
1;
Experienced Hacker
#include
#define S "Hello, World\n"
main(){exit(printf(S) strlen(S) ? 0 : 1);}
Seasoned Hacker
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
Guru Hacker
% cat
Hello, world.
^D
New Manager
10 PRINT "HELLO WORLD"
20 END
Middle Manager
mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I need it by tomorrow.
^D
Senior Manager
% zmail jim
I need a "Hello, world." program by this afternoon.
Chief Executive
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout