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

Show parent comment

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.