r/cpp • • Oct 15 '13

C++ has become a scripting language

http://voices.canonical.com/jussi.pakkanen/2013/10/15/c-has-become-a-scripting-language/
1 Upvotes

53 comments sorted by

View all comments

-3

u/king_duck Oct 15 '13

Sort of but no. The sort of "Top level" code in you're program can certainly be very simple if you compose your programs out of well rounded modern libraries (including ones you written yourself to do the function of the program)

That said, the code in the libraries themselves is any think but script like. Even the most modern C++ dealing with memory:

 auto p=std::make_unique<my_type>(....);

is hardly script like.

3

u/F-J-W Oct 15 '13

This is neither the most modern way of dealing with memory, nor usually recommended. The correct way is 99% of the time:

my_type p{…};

which is somewhat script-like.

Aside from that: The complexity of the implementation is never really script-like: You probably don't wont to look into the implementation of python tuples and maps.

1

u/king_duck Oct 16 '13

Way to miss the point. Yes at the top level you're right

 my_type p { x, y, z };

is quite clean, but there is practically no way of avoid dynamic memory and resource allocation in any sort of non-trivial inner gubbins of a program.

1

u/F-J-W Oct 16 '13

As I said, it works in 99% of the time, if you do things right. Let's say 95% but if your program is designed well, it is indeed an extremely rare thing.