>strong, flexible type system >exceptional performance >Z E R O C O S T A B S T R A C T I O N S >great integration with c, albeit not fully compatible >destructors avoid the need for a gc AND manual memory management 90% of the time >countless mature, well supported libraries >lets you actually decide where you want your shitty data: on the stack, on the heap, ecc... >static generic polymorphism >doesn't force a paradigm down you're throat >great multithreading support >can be as low level or high level as you need >finely tuned as fuck compilers >not autistic
>HURR DURR IT SUCKS MY """PURE""" PERFECT LANGUAGE USED ONLY IN ACADEMIA IS BETTER >HURR DURR SEPPLES IHIH SEPPLES SEPPLES
Austin Perez
I'd like to interject for a moment:
C++ never had a clear goal. The features of C++ were added almost at random. Stroustrup's original idea was essentially "C is cool and OOP is cool so let's bolt OOP onto C". Retrospectively, OOP was massively overhyped and is the wrong tool for the job for most of the people most of the time. Half of the GoF design patterns just emulate idioms from functional programming. Real OOP languages like Smalltalk and IO express many useful things that C++ cannot. The feature that C needed most was perhaps parametric polymorphism (aka generics in Java and C#, first seen in ML in the late 1970s) but instead of that C++ got templates that weren't designed to solve any particular problem but rather to kind of solve several completely unrelated problems (e.g. generics and metaprogramming). Someone actually discovered by accident that C++ templates are Turing complete and they wrote and published a program that computed prime numbers at compile time. Wow. A remarkable observation that led to decades of template abuse where people used templates to solve problems much better solved by other pre-existing solutions such Lisp macros and ML polymorphism. Worse, this abuse led to even more language features being piled on top, like template partial specialization.
The massive incidental complexity in C++ made it almost impossible to write a working compiler. For example, it remains extremely difficult to write a parser for the C++ language. The syntax also has horrible aspects like List being interpreted as logical shift right. None of the original C++ compilers were reliable. During my PhD in 2000-2004 I was still stumbling upon dozens of bugs in C++ compilers from GNU, Intel and SGI. Only after two decades did we start to see solid C++ compilers (by which time C++ was in decline in industry due to Java and C#).
...
Gabriel Phillips
C++ is said to be fast but the reality is that C++ is essentially only fast when you write C-like code and even then it is only fast for certain kinds of programs. Due to the "you don't pay for what you don't use" attitude, C++ is generally inefficient. RAII injects lots of unnecessary function calls at the end of scope, sometimes even expensive virtual calls. These calls often require data that would otherwise be dead so the data are kept alive, increasing register pressure and spilling and decreasing performance. The C++ exception mechanism is very inefficient (~6x slower than OCaml) because it unwinds the stack frame by frame calling destructors rather than long jumping. Allocation with new and delete is slow compared to a modern garbage collector so people are encouraged to use STL collections but these pre-allocate huge blocks of memory in comparison so you've lost the memory-efficiency of C and then you are advised to write your own STL allocator which is no better than using C in the first place. One of the main long-standing advantages of C over modern languages is the unpredictable latency incurred by garbage collectors. C++ offers the worst of both worlds by not having a garbage collector (making it impossible to leverage useful concepts like purely functional data structures properly) but it encourages all destructors to avalanche so you get unbounded pause times (worse than any production GC). Although templates are abused for metaprogramming they are very poor at it and C++ has no real support for metaprogramming. For example, you cannot write an efficient portable regular expression library in C++ because there is no way to do run-time code generation and compilation as you can in Java, C# and languages dating back to Lisp (1960). So while Java and C# have had regular expressions in their standard libraries for well over 10 years, C++ only just got them and they are slow.
...
Austin Thompson
C++ is so complicated that even world experts make rookie mistakes with it. Herb Sutter works for Microsoft and sits on the C++ standards committee where he influences the future of C++. In a lecture he gave his favorite 10-line C++ program, a thread-safe object cache. Someone pointed out that it leaks memory (Herb Sutter's favorite C++ 10-liner has a memory management bug).
My personal feeling is that the new Rust programming language is what C++ should have been. It has useful known features like generics, discriminated unions and pattern matching and useful new features like memory safety without garbage collection.
The end.
Zachary Gomez
You seem to have a valid point there, buddy. Just kidding, go learn rust or some other meme language just like C++ instead of shitposting so hard.
Thomas Sanchez
unique_ptr and shared_ptr changed my life
Oliver White
>C++ >zero cost abstractions no
Jayden Ramirez
>"no" Yes
James Gray
c++ has all this extraneous bollocks and at least two different ways to do almost anything, but having BOTH raii AND try finally is too much to ask??
Brandon Hernandez
Funny how the only valid criticisms nowadays are shitty debunked and outdated copypastas... except now there is somehow some Rust shilling as a bonus.
Jack Carter
>Outdated copypastas >valid criticisms
Boi is this your first time in Sup Forums?
Jaxson Butler
Sorry I meant just "criticisms", but the autist in me wrote "valid criticisms" instead.
>outdated >Aug 29, 2016 Hmmmm... I don't know man. Doesn't sound that old.
Jace Carter
>listening to Sup Forums kode artisans >ever
Matthew Wilson
You forget huge compile times thus low productivity
Evan White
>compiling that often as to have an impact on your productivity >not using intelligent build systems >not having a dedicated build server Found the compsci freshman baby.
Jeremiah Diaz
>2017 >dedicating resources to work a round the flaws of your shitty language pyramid
Owen Rodriguez
>a round
Liam Bennett
Recent or not, the content is outdated.
Adam Morales
>compiler >part of the language As if you hadn't embarrassed yourself enough.
Adrian Lewis
>Herb Sutter's favorite C++ 10-liner has a memory management bug
Elijah Butler
Listen NEET, Some programmers have jobs, and when they have jibs, a language stops being an abstract thing and becomes a "will this shit compile?", "how long does this shit take to compile?" and a "will this shit work". So for people who (((work))), a compiler is indeed part of the fucking language because without a compiler, the language is nothing to them
Elijah Green
A compiler is not part of a language. I don't care if your Jew boss thinks otherwise.
Aiden King
>Herb Sutter works for Micro$$$$oft >His favorite 10 liner leaks memory
The actual fuck did you expect? I'm surprised intelligent people still work for Micro$$oft.
Jayden Lopez
You have a future in screenwriting, bravo.
Tyler Thomas
But I am already working as an ``engineer'' for a large company with a multibillion revenue. All of my software development is done in C with the occasional C+. I haven't written a line of code in months, because all our software is modelled as diagrams -- UML, system, requirement, etc -- and then the code is autogenerated. Building and all other menial tasks are dealt with stuff like gradle and Jenkins. My expertise is too valuable (and too costly for the company) to be wasted on waiting for software to compile. Let me know when you meme language is able to serve projects of engineering merit, projects that actually develop and maintain very complex software and that solve real-world problems, as opposed to your fizzbuzz and hello worlds.
Parker Baker
What meme language?
Xavier Watson
>great integration with c, albeit not fully compatible See, this right here is bullshit. C++ should have been able to do better than this! It should be able to export a C API without the programs that use it requiring a special C++-aware linker. Come ON.
Aiden Nelson
stuggling to comprehend the amount of bloat that must present in this company's shitware
Noah Clark
Ikr When he said UML and Jenkins i almost puked. Why not hire some pajeet to code some?
Michael White
>It should be able to export a C API without the programs that use it requiring a special C++-aware linker Good thing it can. >hur dur what is extern "C"?