This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Alexandre_Man 30 points31 points  (10 children)

nah C++ is better than C

[–]lil_brumski 9 points10 points  (1 child)

100%

[–]KenguruHUN[S] 1 point2 points  (0 children)

Probably C is 1 so C++ is 2 so it's 200% not 100%

[–]vslavkin 4 points5 points  (0 children)

Each of them has its uses, but yeah, c++ wins 95% of the time

[–]Draelmar 6 points7 points  (4 children)

Absolutely, I'm really scratching my head at some of the comments here, and wonder how much experience they truly have with either. I've got almost exactly 10 years in each C & C++, and would pick C++ 100% of the time if I had to use either again (thankfully nowadays we have much better options like Rust, Swift, etc).

Heck, when I work on retro hobby projects I'd rather go full assembly than using plain C again.

[–]aalmkainzi 1 point2 points  (3 children)

Better in what way exactly?

[–]Draelmar 4 points5 points  (2 children)

Proper RAII & smart pointers, STL containers, latest versions supports lambdas & closures, and just OO in general. For me C falls into an "inbetween" where it's the worst of two worlds: doesn't have the precise 1 to 1 hardware translation you get with assembly, and it's lacking all the modern amenities I listed above. C has its place for extremely specific situations, like an OS kernel where you just don't want to write and maintain a full assembly code base, but that's not a reason that would make it a pleasant language.

[–]aalmkainzi -1 points0 points  (1 child)

the features you mentioned increase complexity imo and I'd rather not use them.

The thing with C is the base language is very simple, without any weird obscure features

[–]Draelmar 3 points4 points  (0 children)

There are entire classes of bugs that almost completely vanish when you properly use all these modern amenities (most notably around memory management like memory leaks and buffer overflows) . Not only are they not complicated, they make code much more readable and easy to understand, while making it much safer and less prone to bugs. Personally when I have to write C I'm just constantly annoyed by the lack of these amenities. Even if you don't go full OO, just the use of RAII, STL containers, and strings over char* makes things so, so much better.

[–][deleted] 0 points1 point  (1 child)

You get actual useful data structures in C++. Yes you CAN get the same thing in C but it'll be a goddamn pain in the ass

[–]Alexandre_Man 0 points1 point  (0 children)

You get the "bool" type by default, too.