C++ is bloated

>c++ is bloated
>c++ does so much shit in the background
>hence c is better
Can you elaborate on this argument with solid examples? Why is C more minimal? What is the thing that C++ does in the background?

Attached: cpppp-490x490.png (490x490, 76K)

Other urls found in this thread:

gotw.ca/gotw/005.htm
channel9.msdn.com/Shows/Going Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C
en.cppreference.com/w/cpp/string/basic_string/append
en.cppreference.com/w/cpp/string/basic_string/push_back
twitter.com/NSFWRedditVideo

Read a book on both of the languages

They can't, this board is just autistic. There is a tiny, tiny, tiny amount of overhead from using the standard the standard template library in some cases(apparently) and the autists would rather rewrite it in c because they don't trust compilers to optimize anything even though it wouldn't surprise me at all if the compiled code is comparable, but I will trust the stability of the the standard library over autists reinventing the wheel 99 times out of 100. Usually the apps the write don't need to be that optimal anyway. I know people complain about std::vector being heavier than it should for instance. It's not a big issue though. C++ doesn't do anything terribly stupid like using garbage collection unless you force it to(but why would you add garbage collection to c++ if you are autistic enough to care?)

Beginners love reinventing square wheels

Literally everything is slower. Speed matters more than development time.

C is way simpler with type system - no inheritance, abstract functions and override, public/private/protected members and their behavior in inheritance, vtables; templates and function overloading
take for example
- this quiz on virtual functions gotw.ca/gotw/005.htm
- Systematic Error Handling how to deal with both exceptions and new ways you can see in e.g. functional programming (which were not integrated into standard library where as workaround there are tons of places with unintuitive behavior instead) channel9.msdn.com/Shows/Going Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C or his book Exceptional C++
- all the possible ways of initialization syntax in caveats that come with them
to see what C++ has to deal with only thanks to its own idiotic design

C would be better described as primitive since I take minimalism as virtue, also specs are pretty giant and not great for language and POSIX std library. C++ deserves a giant rework but the trend for last 30 years was to add things without removing the old ones and D just did not hit the spot.

C++ isn't bloated, the C++ standard is bloated because of the decades without a standard where they just added all the things, informally. None of these things have to go into any project and in most cases plain ol' C code is also valid C++ code. C cannot be more minimal but C++ code can be much much more bloated on a case by case basis. If a C guy slaps your code's ass and calls it bloated, ask him how his preprocessor is doing.

C++ has a LOT of shit in the standard library for programming in any sort of paradigm you feel like using. Or you can use almost none of it if that is your thing.

>C++ deserves a giant rework
I like C++ but I actually agree with this. The problem is the same problem that affects most languages, backwards compatibility. I hate to say it but they should go the python way and release a C++2 while still maintaining C++

>C++ isn't bloated
>the C++ standard is bloated
mental illness

>release a C++2
they did, it's called rust

Every C++ programmer uses a very slim subset of the C++ standard, C++ standard is wide enough for no two subsets to be the same.

Rust is nothing like C++, yet. Nightly is inching closer but it'll be years before the important features are stabilized.

I was expecting that reply. Sorry, Rust has some cool stuff when it comes to memory safety but it's no C++2

more like c++2000

>Every C++ programmer uses a very slim subset of the C++ standard
wrong

>en.cppreference.com/w/cpp/string/basic_string/append
>en.cppreference.com/w/cpp/string/basic_string/push_back
why?

>"When your hammer is C++, everything begins to look like a thumb." Steve Haflich
C++ haters always make me laugh

If I want a portable C compiler, I can put tcc on a flash drive; it's like 2mb

If I want a portable C++ compiler, I need to put MinGW on a flash drive; it's more like 300mb

It's a pretty arbitrary example, but use case is important

Template meta-programming is an ugly preprocessor hack
For C++ to have the "features" that supposedly make it better than C you have to abuse the preprocessor
But now you don't know exactly which code is being compiled, the symbol names are mangled, the compile times get out of hand, and you're not actually writing in C++ but in the preprocessor language which is hell to debug because the code isn't even there and is generated at compile time
In other words C++ is so bloated that it's actually two horribly complicated languages with multiple brainlet overcomplicated ways to do the same thing instead of the one, clear, concise and enlightened way of glorious C
Also STL was a mistake, both implementation wise and as a general idea and the initials make it sound like a disease

C++ was a mistake, we should have stuck to C with maybe a few additions
>which additions?
If you had a function foo_do(struct foo *f, int a) you would be able to do foo.do(5);
Add the this operator in C for function pointers stored in structs to access the struct members
Add a maybe dereference, struct pointer member to combat once and for all null pointer bugs and make code even more concise

these people don't actually do anything productive, so they like to reimplement their own inefficient dynamic buffers and strings on every single program instead.

It's always pleasant when you accidentally type >> instead of

C is simpler and way easier to read.

>C is simpler and way easier to read.
You've clearly never had to maintain an old codebase.

>If you had a function foo_do(struct foo *f, int a) you would be able to do foo.do(5);
>Add the this operator in C for function pointers stored in structs to access the struct members
ouch, no

C is a very bare bones language, with only enough to get by. C++ has more features built upon it for a complete desktop experience. For example, if you're doing embedded stuff, C would be a better choice. For making desktop applications, C++ makes more sense. Despite C++ known for being fast, C is still faster.

it's so that you can use a name that fits a vector or a name that fits a string

>desktop experience
>c faster than cpp
>c exactly cpp

>C would be a better choice. For making desktop applications, C++ makes more sense.

You clearly don't even know what C or C++ is. If modern C++ (11/14) looks very different than C++ and than C. C++ its C with a lot of syntactic sugar and its gonna have the same performance if you know what you are doing.

And no, C is not the best choice for embedded it was the only option in the past, actually making a C++ firmware has more sense these days than doing it in C. Why?, security , modularity, scalability and maintenance. Write a simple RTOS in C and one in C++ and you will see what I am talking about.

> two horribly complicated languages
Try four.
Meyers said it pretty well, c++ is a federation of related languages.
But i wouldn't say that it's the worst thing in the world though.

Attached: effectivecpp.png (1393x963, 311K)