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

whats wrong with c++?

Name: Anonymous 2012-06-14 4:55

it has namespaces, better standard libraries, a plethora of modern conveniences, and all of c's functionality.

if you don't like objects don't use them

if you want to feel like a programming badass and do everything low level then learn assembly

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2012-06-15 3:19

>>48
It might depend on the version. I have at least these when using MSVC6:

.?AVexception@@
.?AVbad_cast@std@@
.?AVios_base@std@@
.?AV?$basic_ios@DU?$char_traits@D@std@@@std@@
.?AV?$basic_istream@DU?$char_traits@D@std@@@std@@
...


But more shockingly (or maybe not so if you're familiar with cout and friends, although I am (was) and it still surprises me today), the executable was 100KB. One hundred thousand bloody bytes. That's about the size of the earlier versions of uTorrent. All just to create a single object and print out one of its members. Compiling with /MD brought that down to a bit more reasonable 16KB, but that's still full of empty space (and has the names above). This is what I meant in >>11. The language gives you the power to generate immense amounts of code, but to use it responsibly is a different matter. Someone with a newer version can report their experiences with compiling the same code with default settings, I doubt it's any better.

(I consider that iostream is part of "the original source" because of how the preprocessor works.)

In contrast,

#include <stdio.h>

struct my_class
{
    int member_x;
    float member_y;
};

void construct_my_class(struct my_class *this)
 { this->member_x = 5; this->member_y = 5.0f; }

void method_z_my_class(struct my_class *this)
 { this->member_x++; this->member_y++; }

int main(int argc, char **argv)
{
    struct my_class instance;
    construct_my_class(&instance);

    printf("%d\n", instance.member_x);

    return 0;
}


is 48KB with the default settings and there is no mention of printf.

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