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

So, C++ is starting to grow on me...

Name: Anonymous 2008-11-26 15:53

After using C++ all semester for two classes (OOP with C++, and Data Structures), I'm starting to like C++ more than C. Of course it's no Haskell or SICP, but I'm starting to wonder why I'd ever want to write in C again. I've even started re-writing a small C app I wrote to C++; although the compiled size is larger (about 44 KiB instead of 29 KiB,) the source will likely be about half the size. Best of all, because of the STL containers, I don't need to write any explicit new/delete, so my program is easier to keep leak-free.

tl;dr const references make me feel warm and fuzzy inside.

Name: Anonymous 2008-11-26 16:12

I thought the same things as you some time ago, while I was reading a document called C++ Annotations[1].

Then, after a while, I noticed that C++ has more drawbacks than advantages. Just think about how many hacks you need to do in order to avoid strange behaviours. An example?


    IntArray const &IntArray::operator=(IntArray const &other)
    {
        if (this != &other)  // Why should I care about this??
        {
            delete[] d_data;
            copy(other);
        }
        return *this;
    }


Here[2] you can find an in-dept discussion about why you should avoid to use (and to improve) c++.

[1] http://www.icce.rug.nl/documents/cplusplus/
[2] http://yosefk.com/c++fqa/index.html

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