Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The Evolution of a Sepples Programmer

Name: Anonymous 2008-06-16 13:42

Learned basic C++ from an inadequate tutorial.

#include <iostream.h>
using namespace std; // thanks, joe
void main(int argc, char** argv) {
    cout << "Hello, world!" << endl;
}


Learned basic C++ from a slightly better tutorial.

#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
    cout << "Hello, world!" << endl;
    return 0;
}


Learned about namespace pollution.

#include <iostream>
int main(int argc, char* argv[]) {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}


Learned about classes.

#include <iostream>
#include <string.h>
class Hello {
private:
    char* msg;
public:
    Hello() {
        this->msg = strdup("Hello, world!");
    }
    ~Hello() {
        delete this->msg;
    }
    char* hello() {
        return this->msg;
    }
};
int main(int argc, char* argv[]) {
    Hello* hello = new Hello();
    std::cout << hello->hello() << std::endl;
    delete hello;
    return 0;
}


Learned about the C++ string container.

#include <iostream>
#include <string>
class Hello {
private:
    std::string msg;
public:
    Hello() {
        this->msg = "Hello, world!";
    }
    std::string hello() {
        return this->msg;
    }
};
int main(int argc, char* argv[]) {
    Hello hello;
    std::cout << hello.hello() << std::endl;
    return 0;
}


Found out about the STL.

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/bits/ios_base.h: In copy constructor ‘std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/bits/ios_base.h:783: error: ‘std::ios_base::ios_base(const std::ios_base&)’ is private
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/iosfwd:52: error: within this context
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/iosfwd: In copy constructor ‘std::basic_ostream<char, std::char_traits<char> >::basic_ostream(const std::basic_ostream<char, std::char_traits<char> >&)’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/iosfwd:61: note: synthesized method ‘std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)’ first required here
test.cpp: In function ‘int main(int, char**)’:
test.cpp:7: note: synthesized method ‘std::basic_ostream<char, std::char_traits<char> >::basic_ostream(const std::basic_ostream<char, std::char_traits<char> >&)’ first required here
test.cpp:7: error:   initializing argument 3 of ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Funct = std::basic_ostream<char, std::char_traits<char> >]’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/bits/stl_algo.h: In function ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Funct = std::basic_ostream<char, std::char_traits<char> >]’:
test.cpp:7:   instantiated from here
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/bits/stl_algo.h:3791: error: no match for call to ‘(std::basic_ostream<char, std::char_traits<char> >) (char&)’


Mastered the basic containers of the STL.

#include <iostream>
#include <string>
#include <vector>
int main(int argc, char* argv[]) {
    std::string hello = "Hello, world!";
    std::vector<char> v;
    for (unsigned int j = 0; j < hello.length(); ++j) {
        v.push_back(hello[j]);
    }
    std::vector<char>::iterator i;
    for (i = v.begin(); i != v.end(); ++i) {
        std::cout << *i;
    }
    std::cout << std::endl;
    return 0;
}


Mastered the STL.

#include <iostream>
#include <string>
#include <algorithm>
class printc { public: void operator() (char c) { std::cout << c; } };
int main(int argc, char* argv[]) {
    std::string hello = "Hello, world!";
    std::for_each(hello.begin(), hello.end(), printc());
    std::cout << std::endl;
    return 0;
}


Read the C++ FAQ Lite and realized C++ mastery is impossible.

#include <iostream>
int main(int argc, char* argv[]) {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}


Read the C++ FQA Lite.

#include <stdio.h>
int main(int argc, char* argv[]) {
    printf("Hello, world!\n");
    return 0;
}


Heard of 4chan and wound up in /b/.

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE


Found a replacement for /b/ after finding it overrun by ``cancer'' and ``newfags.''

One word, the forced indentation of code.  Thread over.  Also, read SICP!

Read SICP after months of telling people to read SICP.

(display "Hello, world!")
(newline)


Achieved Satori after re-reading SICP every day for many years.

void main() { puts("Hello, world!"); }

Name: Anonymous 2008-06-16 13:43

fuck forgot to set utf-8 when copying

/wrist

Name: Anonymous 2008-06-16 14:21

    cout << "Hello, world!" << endl;
<<
wtf HASKELL

Name: Anonymous 2008-06-16 14:26

A++++ post would read again

Name: Anonymous 2008-06-16 14:52

9/10.

Name: Anonymous 2008-06-16 15:30

The Found out about the STL part was very amusing

Name: Anonymous 2008-06-16 16:37

>>6
They are actual errors during the development of the for_each example ;)

Name: HMA MEME FAN 2008-06-16 19:00

10/10 Excellent post, your anus escapes unscathed.

Name: Anonymous 2008-06-16 19:12

hah, first thread I've enjoyed on /prog/ in about 6 months. Well done. You win an internet.

Name: Anonymous 2008-06-16 19:27

Oh fuck you guys, be superior because you know C++ and get the joke, laugh at me who prefers Haskell.

Name: Anonymous 2008-06-16 19:31

>>10
Do you really want to read an evolution of a Haskell programmer doing the Fibonacci sequence?

Name: Anonymous 2008-06-16 20:13

Why did the enlightened go back to void main?

Name: Anonymous 2008-06-16 20:15

>>12
I don't know but it doesn't compile. g++ wants int main().

Name: Anonymous 2008-06-16 20:30

>>12-13
To stress the point there is no such thing as a Sepples user who has reached satori.

Name: Anonymous 2008-06-17 0:33

Amazing post

Name: Anonymous 2008-06-17 1:10

This post made me hate Sepples even more.

Name: Anonymous 2008-06-17 1:19

i hate sepples but i love this post

Name: Anonymous 2008-06-17 4:31

>>12-14
He's actually using C by then (perhaps even after reading the FQA, but that might just as well be C-compatible Sepples).

Name: Anonymous 2008-06-17 6:17

I'm submitting this thread to reddit.

Name: Anonymous 2008-06-17 6:20

>>19
oh you

Name: Anonymous 2008-06-17 6:29

>>19
I C what you did there.

Name: Anonymous 2008-06-17 7:55

>>1
puts considered harmful because fputs behaves differerently.

Name: Anonymous 2008-06-17 7:57

>>22
?

Name: Anonymous 2008-06-17 8:06

>>23

Name: Anonymous 2008-06-17 8:58

>>23,24
No, >>22 isn't Christopher

Name: Anonymous 2008-06-17 9:32

>>25
Is he Xarn?

Name: Anonymous 2008-06-17 9:35

>>26
As we all know, Christopher is way cooler than Xarn.

Name: Anonymous 2008-06-17 9:41

>>27
Well that's just, like, your opinion, man.

Name: Anonymous 2008-06-18 13:23

pantsu

Name: Chris !!aBJKZuplTV/HGe3 2008-06-18 17:06

>>27
That is accurate.

Xarn worships Java. Djikstra wouldn't have liked this.

Name: Xarn 2008-06-18 18:46

>>30
Fuck you, cuntnigger.
I know Java quite well because I'm forced to use it on a daily basis, but that doesn't mean I like it. I'm probably more keenly aware of its defects than anyone on /prog/.

Name: Anonymous 2008-06-18 19:07

>>30
[citation needed]

Name: Anonymous 2008-06-18 19:12

>>31
I'm probably more keenly aware of its defects than anyone on /prog/.
Uh, good for you.

Name: Anonymous 2008-06-18 19:14

>>32
 Edsger Dijkstra on Java (Trouw, 18 Oct 2000)

Interviewer : There is some progress? There are new programming langugages that make everything easier, even ordinary internet users have heard of Java.

Dijkstra : It's embarrassing. Because it is so bad. The only reason Java has been accepted is because it is a product of a company, SUN, that has made enormous advertisement for it. Beautiful programming languages exist, and a good language, like a tool, is just a joy. But industry doesn't want that. Probably because decisions are made by technically incompetent people.

http://web.onetel.net.uk/~hibou/Why%20Java%20is%20Not%20My%20Favourite%20Programming%20Language.html

Name: Anonymous 2008-06-18 19:23

>>1
Awesome. Now one for JAVA!
I beg of you!

Name: Anonymous 2008-06-18 19:24

And so, Christopher wins again.

Also, Xarn, you sound like someone I know. He claims to be all cool and free and GNU, and that programming is done mostly for fun and not profit, but he secretly is entrepreneurs' bitch and does all the Java and PHP work for them.

Name: Anonymous 2008-06-18 20:11

lol

Name: Anonymous 2008-06-18 21:25

>>36
Are you familiar with the concept of a college?

Name: Anonymous 2008-06-18 21:47

>>38
A sphincter says "what."

Name: Anonymous 2008-06-18 23:48

I'm going to print this thread and hang it on my -Wall.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List