• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

OT : Evolution of a programmer

LeBlatt

Golden Member
Task : write a program that will display "HELLO WORLD" on the screen.

College :
10 PRINT "HELLO WORLD"
20 END

University 1st grade :
program HELLO(input, output)
begin
writeln('HELLO WORLD')
end.

University 2nd grade :
(defun HELLO
(print
(cons HELLO (list 'WORLD))))

Just graduated :
#include [stdio.h]
void main(void)
{
char *message[] = {"HELLO ", "WORLD"};
int j;
for(j = 0; j [ 2; ++j)
Printf("%s", message[j]);
printf("\n&quot😉;
}

Experimented professionnal :
#include [iostream.h]
#include [string.h]
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);
}

Manager :
mail -s "HELLO, WORLD." bob@b12
Henry, could you write for me a message that displays "HELLO,
WORLD." on the screen ?
I need it for tomorrow.
^D

Chairman :
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout

[edit]no smilies in C++ !
 
dude, i love C++, its just so warm and fuzzy 🙂

(right now i am forced to do Cold Fusion bug fixes at work, yuck)
 
You forgot:

Hacker:
echo HELLO WORLD

🙂

P.S. Why is the University 1st grade program written in Pascal? Pascal's virtually a dead language.
 
Pascal's a great learner's language. It allows the basics of programming to be taught, without forcing students to make the big jump to Object Orientated Design right away.
 


<< It allows the basics of programming to be taught, without forcing students to make the big jump to Object Orientated Design right away. >>



So does C.
 
Back
Top