C++ is the worst language ever made

C++ is the worst language ever made.

It's the fucking dumbest, most convoluted, ugliest kitchen sink software under the umbrella of a programming language that has ever existed.

The only argument for why it's a good language is to just not use 80% of the language until it no longer looks like C++.

The only reason anyone would ever willingly use it has always been and continues to be "It's fast", something that isn't inherent to the language that is only that way because of the collective efforts of millions of people around the globe shovelling R&D into it.

This board finds contrived reasons to shit on every new language that has come out in the past 20 years, and the level of dissonance you're able to achieve by turning that same attitude towards C++ and saying "well it's not actually that bad" is a monument. It's a monument to something, I don't know what.

Attached: 1200px-ISO_C++_Logo.svg.png (1200x1349, 69K)

Other urls found in this thread:

youtu.be/46LUxQJb8pg?t=64
monoinfinito.wordpress.com/series/exception-handling-in-c/
twitter.com/AnonBabble

>it's fast only because people developed it to be fast
cpp forever btfo

Yes, I'm saying it's not inherent to C++.

Any compiled language would be equally as fast if it had such absurd amounts of R&D shovelled into it.

C++the::ugliestknown::to++manother::languagesbeworse

Can't that be said for basically literally anything ever in existence ever, unless you specifically used something that is inherently and fundamentally slower and physically can not be faster thanks to the laws of physics?

you're a fucking retard
c++ is the most expressive, most multi paradigm, zero cost exception having, pure functional enabled, meta programming capable language around. and just like the other freshmen and dropouts ITT that spam 'oop is bad' memes or think that pure functional means you use structs and free functions instead of methods you're really dumb and retarded.

please tell me why a language that's constantly improving and making great strides in all directions makes you throw up. is it because it allows multiple inheritance or because you or because you're too dumb to parse the complicated syntax?

which are you going to tell me to use instead? C99 or Idris?

you havent written shit
you are nothing
fuck you

Attached: Illya 1208 (CI).jpg (1280x1758, 348K)

>The only argument for why it's a good language is to just not use 80% of the language until it no longer looks like C++.

you're so retarded lol
the only features that get avoided AND IN realtime programming IS RTTI and exceltoins
1. WHO THE HELL uses RTTI
2. exceptions are pretty irrelevent unless you chose to structure your program around them which is a valid choice

please whine to me about exception cost so i can btfo you
basically you are retard
you can write c++ in the msot blazing fast imperative register cache local and typesafe way
or you can write your own lisp or haskell
basically ur dumb
PL elitists need to die anyway
except for c++ beacuse its the best language

Attached: Illya 1199 (QL).jpg (1592x1080, 455K)

>t. retarded Python brainlet who can't program his way out of a paper bag

>inherent
Stop aping words you don't understand, you sub 20 IQ monkey. Any language is only the way it is because it was developed to be so. C++ is not a naturally occurring phenomenon to be "inherently" anything.

C++ as a syntax is awesome, the manual memory management & dereferencing is just bad, thankfully modern C++ is solving it


also there is Rust that solves memory management and reduces the whole OOP bloat into just simple polymorphism

ANSI C or bust

Yes, which is why people using the argument "it's fast" as if that's inherent to C++ are idiots.

Ideally we'd have a language that's fast and is also not a retarded shitpen.

>c++ is the most expressive
Meaning what? Verbose?

Yes, for such a high level language you still write it like C and have to tell the compiler specifically what to do. I don't know why you think this is a good thing

>most multi paradigm
It does lots of things but does none of them well.

>zero cost exception having
You're just throwing out terms.

An exception is a branch like an if statement. It's costly if it's costly and isn't if it isn't.

>pure functional enabled
What language is not "purely functional enabled"?

>meta programming capable language around
You mean the grand total of 5 preprocessor statements, most of which exist in C and none of which should be used post the year 1975?

C++: The language that literally copy and pastes another file above the one it's in when you "include" another file.

>please tell me why a language that's constantly improving and making great strides in all directions makes you throw up
1. It's fixing none of the issues that already existed, except for objective bugs
2. It's going in all directions, and the core of a language is hurting because of it

>you're a fucking retard
Yeah, I wouldn't throw stones there captain.

There is a french saying that if your auntie had balls, you would call her uncle.

The fact is: C++ has had those resources invested in, thus it's a great language.

And you're mistaken about it being a bad language. Yes, it's very complex. But it's almost a meta-language. You use C++ to develop libraries, indeed using relatively complex constructs, to make it very easy to write application code.

That's why you have so much control over things, over how objects are initialized, allocated, how operators are overloaded, etc.

Java is a great language. It took a sensible subset of the patterns you can use in C++, a very OO view of the world, and made a good language out of that. But C++ can do way more different things.

big brain argument against c++
RAII encourages spamming tiny allocations all over and pretending that allocations don't happen and basically just pretends having allocations as lifetimes is efficient
while c is more explicit

while generational GC's are much more efficient if you have the memory for them
so c++ RAII is worse than both
argue about this and ignore the OP pls


there are insanely fast concurrent GC in java and go ect
c++ is kind of outdated
and not even good compared to C in this maner is the argument
rthoughts?

you probably think that check and sweep GC is still in use, because you're retard
but actiallly they advanced past that
lisp doesn't care about its gc because its not systems

zero cost abstraction you mega brainlet stfu

Attached: Love Lives 294 (RO).jpg (840x1175, 361K)

Yes, you're agreeing with me.

>C++ as a syntax is awesome
What do you consider "bad" syntax?

I have heard a lot of stupid arguments for why C++ is good, but never has it been its syntax.

lol please tell me the language you know other than c++ where you can seamlessly slot your own allocator into the Standard lib; and if you dont want to dont even have to know that that feature exists

THAT is what I mean by expressive amoung otherthings

as for metaprogramming im talking about SFINAE which still shits on RUST
so sstfu please
>5 preprocesser statements
wtf are you talking about lol
im not talking about the preprocessor retard

>This board finds contrived reasons to shit on every new language that has come out in the past 20 years

and outside of some obscure languages how many of them are really drop in replacements for C++ ? Not much. Basically just Rust and Swift.

>Meaning what? Verbose?
Meaning you can control precisely how objects are initialized, allocated, copied, etc.
You can overload operators. You can do multiple inheritance. Etc.

>What language is not "purely functional enabled"?
Most languages who have additional cost when doing pure functional stuff. In C++ with things like move semantics, passing by reference and so on you can have zero cost pure FP.

>You mean the grand total of 5 preprocessor statements
No he meant the template system. Maybe read a C++ book written after 1985.

>There is a french saying that if your auntie had balls, you would call her uncle.

Did you just asume her gender, shitlord?

maybe {{{they}}} designed>>>it

>The fact is: C++ has had those resources invested in, thus it's a great language.
Until we pile those resources in another language.

And we have, many times over. The only thing missing is being 6% faster, which with any hope will be the case with Rust.

>You use C++ to develop libraries, indeed using relatively complex constructs, to make it very easy to write application code.
None of these are inherent to C++ either.

>Java is a great language.

Neither is a drop in replacement.
To start with, C++ is an international standard.
It doesn't matter when writing a blog, but it does when writing code for a jet fighter or a submarine.

the fact is that the theoretically perfect GC will always beat niave c++ RAII


and GC gets closer to theoretically perfect everyday

Attached: Love Lives 286 (YO).jpg (800x1121, 587K)

Yes Java is a great language, and I love C++ too.
They're good languages for different reasons, and for different applications.

For cookie-cutter business applications you don't need all the complexity, sharp edges and rotating blades of C++. But to write audio software, video games, CAD applications and so on C++ is the best thing we have.

opbp
C++ is a shit. It is best used as C with templates, struct functions, and operator overloads. no class inheritance. virtual functions are bloat.

>zero cost exception having
stack traces have a massive runtime cost user, C++ is no different from any other language in this regard. Thankfully, you can turn them off, so C++ is still actually useful in resource-starved applications
>why a language that's constantly improving and making great strides in all directions makes you throw up
because its new features contradict each other, and some are outright stupid.
mutable completely defeats the purpose of the const function keyword. It's literally "const functions don't modify contained data, except when they do." Throw on class inheritance, where a const function could be calling another const function buried in superclasses that's fucking with "mutable"-labeled variables, and you now have a debugging nightmare if something goes wrong. fixing such a bug would practically guarantee you break other shit.
The C++ STL is an utter embarrassment. I'm strongly in favor of operator overloads, but it's hard to make a strong argument in favor of them when the best-known STL component (iostream) is a perfect example of operator abuse.
Even worse, C++ leans on its dysfunctional standard library to make up for language deficiencies. Take a look at std::variant for a perfect example. enum classes are sitting right fucking there, begging to be used as variants with pattern matching. All that's needed is a little bit of rust-like syntax, but no. Instead, we're stuck with the choice between a STL kludge, or the old-school C idiom of unions and enums.

Attached: 1492832919745.png (1000x1400, 1.31M)

that's my point. they aren't even that comparable let alone people saying shit like java and python which are a completely different animal functionally.

>lol please tell me the language you know other than c++ where you can seamlessly slot your own allocator into the Standard lib
1. You can't "add" anything to the standard library. You can add something to the standard (std) namespace, if that's what you're trying to say
2. There's nothing inherent about an "allocate" that would make this hard to do in any language

>and if you dont want to dont even have to know that that feature exists
You can "not know" that any function you aren't aware of exists

The compiler doesn't tell you everything in the standard library every time you compile something

Why do you think this is a good thing

You are retarded on a fundamental level. You barely even know what you're trying to say.

Please stop wasting real estate in this thread.

Yes that's true. GC are insanely good now (especially when combined with escape analysis, etc.)
And JITs especially the Oracle one are very good too.

But you can still do better in C++. Not if you use the STL and RAII everywhere for sure. But you can write your own allocators, your own vectorized code, etc.

I think that's where people lose the argument. Canonical C++, written with the STL, is often going to be slower than Java. But optimized C++ will still run circles around Java.

I don't usually use such blunt language but here it goes:

Are you ACTUALLY retarded you brainless piece of shit? If you're as debil as you appear it's almost a miracle you somehow managed to post on the internet. Did your mother abuse your anus so deep with her fist that she mushed your brain? Or did she simply drop you from a second floor window on your head?

The reason why C++ is such a performant high level language and prefered by many is exactly what you wrote, the absurd amounts of money and R&D that went into it for many years.

The newer languages simply don't stand a chance againgst this amount of tweaking and probably will never catch up.


That being said, performance isn't everything, otherwise there wouldn't exist any language except for assembler. Usability, ease of debugging, multi-platform-release ease and a shitton of other things are important to consider when choosing a language for a project.

This is one of the reasons there are so many languages. This is also why it's retarded to hate on a language because it doesn't fit your usecase perfectly.

TLDR: Grow up faggit

????

of course you can add to the standard library in C++. The source code implementations live on your computer and you can do whatever you please with them. Of course this is bad form for general purpose computing but if you want to do it for a specific platform or project it is fair game.

I meant zero cost absgtractions not exceptions sorry
if you want to see what i say about exceptions see here:
yeah pattern matching and sum types need to enter the standard, and the committe CAN be very retarded
but c++ is trying very hard
>we're stuck with the choice between a STL kludge, or the old-school C idiom of unions and enums.
not really true you can write your own beautiful c++ whereever the STL messes up
their dogma of 'whatever CAN be a library function should be' has SOME benefits despite some failings

>1. You can't "add" anything to the standard library. You can add something to the standard (std) namespace, if that's what you're trying to say
>2. There's nothing inherent about an "allocate" that would make this hard to do in any language
you're making yourself look like a mega retard
please look up c++ user defined allocator

you are so fucking stupid and uninformed lol

Attached: Love Lives 271 (IN).jpg (900x1012, 745K)

Muie corporatistilor

>Yes Java is a great language, and I love C++ too.
This doesn't shock me.

>They're good languages for different reasons, and for different applications.

>But to write audio software, video games, CAD applications and so on C++ is the best thing we have.
No.

There is nothing inherent to C++ that makes it good for these things.

There are lots of libraries, that only exist because people already use it. Thus continues the infinite cycle.

And this hasn't been true for probably 15 years. There's as many competent Delphi adaptations as there are C++ ones, and 20x more for any similar language that looks like C++ but is made by someone competent.

I googled that an now my laptop is bricked.

You're a fucking idiot, dude. I hope one day you realize what pragmatics are, and how it applies to every day life. Doubt it though, considering you were never of a scholarly mindset. You just want a more comfortable life.

Your argument boils down to: C++ is good but other languages could have been good too if resources had been invested in them.

Yes. But as I said above, I my auntie had balls we would call her uncle.

>The newer languages simply don't stand a chance againgst this amount of tweaking and probably will never catch up.
For any simple programming it's nearly exactly the same or exactly the same.

A hello world program boils down to mov eax, "Hello world". You can't make that more or less efficient.

If it is less efficient

For highly demanding software used by Facebook or something you begin to see a speed difference of 4% or something.

>That being said, performance isn't everything
It's every compelling reason to use C++.

>This is one of the reasons there are so many languages. This is also why it's retarded to hate on a language because it doesn't fit your usecase perfectly.
It's not a use case, you idiot.

There's literally no scenario where you want it to be slow unless you specifically tell it to.


Do you people appreciate just how much you're validating to everyone that C++ uses are retarded monkeys?

Because you are. You typed this out and genuinely thought that it was a good rebuttal and that this would convince people that C++ is a good language.
If you want to actually convince anyone except first year compsci students that get intimidated by big words, you're failing spectacularly. Not that I expected anything else.

Attached: will you shut up.jpg (1200x798, 257K)

And I don't even understand the hate for C++ to start with.
If you don't like it, don't fucking use it. No one is forcing you. Not even the job market, since most positions nowadays are for webshit stuff.

>their dogma of 'whatever CAN be a library function should be'
the problem is that the only meaningful benefit C++ provides over alternatives like Rust, Go, or fuck even Java and Kotlin, is its performance. Yet, the STL is laden with exceptions, virtual functions, and fuckloads of heap allocations/deallocations, small and large.
my idiom for zero-cost pattern matching is almost identical to the one I use for C. It's just a library of preprocessor macros that cover up some enums, unions, structs, and switches.

>the committe CAN be very retarded, but c++ is trying very hard
it's trying too hard to be literally everything for everyone at all times. It was once extremely good at one thing (providing powerful abstractions with little to no runtime cost) but now with all the STL bullshit it doesn't even do that the way it used to.

>the only features that get avoided in realtime programming are RTTI and exceptions
as someone who uses both C and C++ in real-time embedded systems, I can vouch for this. Also virtual functions. Fuck virtual functions.

>C++

You're so sure that's true you'd think you'd be able to formulate some kind of argument.

I think you lack appreciation for exactly what a programming language is.

It's a method of accomplishing something, not the thing you produce itself. C++ could run at light speed or it could take 3 years to execute and it wouldn't change what the language looks like.

Even so, the thing you claim is a selling point is near negligible, it only begins to matter when the computations you're performing are so vast that a 4% speed equates to millions of dollars.
I've spent more time posting in this thread than writing my programs in C++ will ever save me.

If this really is the crux of your argument, then I'll post in 2 years when Google has funnelled enough research into Rust to make it faster than C++ and you will have absolutely no basis for an argument.

>An exception is a branch like an if statement.
Uh-oh retard alert. Retard alert class

>An exception is a branch like an if statement. It's costly if it's costly and isn't if it isn't.

Attached: 1534129156718.png (538x720, 617K)

>C++ is the worst language ever made.
Oh look another Rust thread.

Oh, is what I said wrong?

Please, explain why. It shouldn't be hard for you

I have formulated an argument though. I said it in my first response to you. You can say it about literally anything ever. Most things you can say about literally anything ever, because most things, given enough resources can meet some sort of criteria similar to other things. It's a matter of resource investment. However, since you're unable to completely grasp pragmatics - and context in application, at that - you are unable to grasp that these arbitrary things can be said about many, if not all, things you enjoy on any level. You're a complacent brainlet who thinks they have all the answers. If you have all teh answers, then make your favorite language as fast as C++. I don't even program in C++; I just hate logically illiterate faggots like you who can make blanket statements that are utterly impractical for any meaningful purpose. It's like the social justice warriors who took sociology 101 and decided to apply what was taught to confirm their beliefs. Unbiased understanding will always outweigh your simplistic worldview. Go back to programming the login page, Rajit.

You are mistaken about the performance gains though.
I write real-time audio software, where latency is critical. Which means, in the critical path (i.e. the real-time audio path) you don't want anything like memory allocations, expensive operations (exceptions, RTTI, etc.)
There are a few other languages that could be used, but with C++ I can have low-latency multi-threaded code that still looks nice, and that is generic (I have an implementation of my audio code using floats and doubles, with the same code base).

in order for an exception to work, it has to have a stack trace. That's why it can jump back through a call stack, and you can catch it elsewhere. neck yourself, dumbass.

Attached: 1536972143872.png (640x640, 575K)

I fail to see how this is at all relevant. Probably because it isn't.

C# and Java have a much better syntax.

No, it wouldn't. The semantics of C++ are what makes it fast. Java has had comparable amounts of R&D and it's not as fast as C++.

You don't know how exceptions are actually implemented. DWARF table lookups are extremely expensive compared to just branching. Throwing an exception is fairly cheap but discovering whether you need to catch one is extremely expensive.

looks like you're educated which is rate here; I am curious, how does that compare with Rust's Result? is it much faster?

>Yes, I'm saying it's not inherent to C++.
Oh professor Turing can you explain how in C you can not assign values to variables (they have random crap from memory in them)(this can blow up spectacularly) while in other safer languages this is impossible.
Now safer languages assign something to a veritable however this takes time while in C you can create a array of variables and then fill it with data knowing that whatever was in them when you created it is irrelevant now.

This is not trivial if you are loading shit loads of data.
Its loading the data 1 time into memory VS
waiting for the safety of the language to make the memory safe and then loading data into memory.
You have a 200% penalty on data loading.

The pro of C is that this is fast, the downside is that you can fuck up everything spectacularly if you have no idea what you are doing or have errors decades from now.

>Any compiled language would be equally as fast if it had such absurd amounts of R&D shovelled into it.
Why don't you simply compile your language into C and then run a C compiler on it?

Attached: Alan-Turing.jpg (1200x1501, 155K)

Rust Result is slower in the case that the Result contains an Ok() and much faster in the case that it contains an Err().
The notion of "zero cost exception handling" is a trade off. Exceptions cost nothing if you never throw them (unlike error codes which always require at least a branch), but are very expensive when you do.

c++ is faster than C because the increased expressiveness at compile time can allow optimizations c cannot
for example static polymorphism

Performance is just statistical noise in program architecture.

can you elaborate? is there any article I can read about that? afaik Result is nothing special, it is just an ordinary enum and you either return ok or err, so I thought it's just a clean way to replace exceptions all together and implemented internally as any other function return

No, semantics matter.
You can compile Scheme but it has such high-level semantics (arbitrary-precision arithmetic, tail-call optimization, etc.) that it's impossible to compete with C++.

Today's safe languages
youtu.be/46LUxQJb8pg?t=64
The helmet protects you from your own stupidity however there is a penalty to it.
C is like a chainsaw powerful however you can cripple yourself with it.

Attached: 51Trd3D1fyL.jpg (500x336, 51K)

>The C++ STL is an utter embarrassment. I'm strongly in favor of operator overloads, but it's hard to make a strong argument in favor of them when the best-known STL component (iostream) is a perfect example of operator abuse.

Top kek, iostreams aren't even part of the STL and really tell me why you hate the STL? Generic fast containers and algorithms that are generic and that can easily use custom containers. I don't see what there is to like and they only stand to get better with ranges TS in future revisions.

the worst part about iostreams is the fucking pages of errors while it tries to implicitly convert your type to every single one that iostream has an overload for

Attached: Illya 1198 (GH).png (1000x1400, 919K)

>Ideally we'd have a language that's fast and is also not a retarded shitpen.
I grew up with C++ however I'm more of a ANSI C guy because OOP is a stupid MEME.
Can you tell me what is so bad about C++?
I'm actually interested.

Its not my problem that every other language is even more retarded.
>Java
Hay lets clone C and make it worse and even more shit because now we are still using short, int, long only they are less flexible then in C (the preprocessor can swap them in C)
Hey lets make our language interpreted so that it preforms worse then C
>What language is not "purely functional enabled"?
Java because everything is OOP in the MEME language of Java.

>Python
Hey lets use our MEME indentation for code blocks
Ups because of this some operations are impossible to make
Hey lets use the MEME of changing variable types!
Ups because of this our programs are even more unstable then the ones written in C and have astronomically more errors then C ever did have.
Hey lets make the language interpreted so its even more inefficient then C.
All these stupid MEMEs sure are worth making our language complete shit.

The return value of the function needs to be examined and some actions need to be performed. In C unpacking a Result might look more like this.
typedef struct
{
bool is_err;
union
{
T ok;
E err;
};
}
Result;

Result result = some_function();
if (result.is_err)
return result.err;
T unpacked_result = result.ok;
// use unpacked_result for whatever you like

Exceptions don't work through return values in C++. If a function returns normally, you can just use that return value without testing if an exception was returned instead.
When an exception is thrown, the C++ runtime must dynamically inspect the stack frame of every calling function to determine if there are any catch blocks to handle the exception which is nontrivial.
Here's a good start. monoinfinito.wordpress.com/series/exception-handling-in-c/

C++ FACTS
>terrible syntax
>nonintuitive lingo overall
>performance is meme from 90s
>has much, much better rivals around (e.g. Java, C#)
>pointers top **kek
>mostly used by fags

R&D doesn't make something fast, it's the design of the language and the abstractions it uses
very simple languages can be just as fast

i agree, thank god for the latest webdev stack.

>you probably think that check and sweep GC is still in use
it isn't? what do they use instead?

GENERATIONAL GC for once is ancient and powerful techique amung many others
std::shared_ptr is litteraly 10x slower than even naive shitty graph gcs

>>performance is meme from 90s
just because you don't write real-time applications doesn't mean nobody does

The fact is that you cannot use GC on real time systems. Ever. Performance is non-deterministic. If you need a response within a set number of milliseconds, you cannot make such a guarantee with GC.

There is a clear use case for languages which do not feature a GC, such as C++.

generational GC is an optimization, that doesn't mean you aren't using mark and sweep anymore

modern languages have optional gc so you can chose between slow but determanistic and fast but gced

>>has much, much better rivals around (e.g. Java, C#)
And what language are each of their runtimes written in?

Fick off rust shill.

That's not entirely true.
Many trading firms, for example, use Java and even C# for their real-time trading apps or matching engines (the NASDAQ trading engine is written in Java).

The trick is not to do memory management on the time-critical path. The Java GC does not trigger randomly when it wants; it triggers when doing allocation and there is no more memory. But if you don't do allocation of new objects on the critical paths, you're fine.

So you can actually write real-time apps in those languages. The main reason they're not used for real-time control (i.e. embedded systems) is that they are a bit bloated and lack certain features making it easy to write low-level code, and their semantics prevent certain optimizations which in C++ would simply be UB. But for server-side real-time apps (telecommunications, video game servers, trading engines, etc.) they work if you are careful.

Is it a good thing to do? If you think about it, in many apps the real-time path is a small part of the code. A lot of stuff happens outside of that, where it makes sense to have a nice, high-level, safer language.

>Trying to convince unwlemployed retards that the JVM actually is actually great
There's a reason that they're unemployed

what does your day job have to do with anything? The Java platform is crap for system and applications programming. I like Java but I have also tried using it and its failings are apparent.

>GC cycles are deferred until you allocate
There, now you can write deterministic time code.
This is an option for Nim btw

your IQ must be -- this high to play with the cool c++ kids

What’s with all the hate for c++’s syntax, honestly it’s the best syntax I’ve ever used. When you read a lot of other languages there’s ambiguity of what it actually does, with c++ if you know the syntax you know exactly what it does.

C++ is a beautiful language, especially since C++11

Template metaprogramming is God level

>manual memory management & dereferencing
user I don't think you understand the RAII memory model fully if you think it's bad. It's perfect.

>RAII encourages spamming tiny allocations all over and pretending that allocations don't happen and basically just pretends having allocations as lifetimes is efficient
>while c is more explicit
That's bullshit, any aware programmer knows how much allocation is occurring in any code they write. C++ even allows custom allocators in all STL code, you can write malloc-less code based on static sized buffers if you want to.

Performance is a meme? It's always funny how clueless high level "programmers" are

This, with C++ you can read every line and reason about it clearly as long as you understand undefined behavior which brings ambiguity to code generation

With degenerate retard garbage like PHP or Javascript there's always weird interpreter quirks, and in Java and C# there's simply too much abstraction to know what's happening under the hood at every moment

read it again

>thankfully modern C++ is solving it
are you retarded?

You don't know C++. Tons of ambiguities exist in C++ syntax which leads to nightmares like Most Vexing Parse and spamming the typename and template keywords.

RAII in C++ is bad because it implicitly relies on (and supposedly justifies!) exceptions.

>Most Vexing Parse
It's a meme and never matters

RAII is great because it doesn't implicitly rely on exceptions, you can write perfectly great RAII-utilizing code with exceptions turned off in fact

I'm a C++ newbie, is RAII an actual feature of the language or is just the coding convention of allocating/deallocating in the constructor/destructor?

How do you raise an error from a constructor without throwing an exception and without creating a zombie object?

C++ is really cool

The convention.

It's a coding convention of allocating/deallocating in the constructor/destructor, and it's a widespread coding convention since it applies to all resource-containing standard library objects of sufficiently recent introduction, like the STL containers, smart_ptrs, threads, locks, lock_guards, etc.

IsValid()
IsInitialized()

Or just use exceptions for high level initialization code and factories, since they aren't performance critical, and don't use exceptions in deep code so it doesn't matter

>IsValid()
>IsInitialized()
If your object has these methods, it can be a zombie. If it can be a zombie, you aren't using RAII. RAII means the constructor ensures the object is in a valid state.

It doesn't matter if you isolate construction code to factories lifetimes to pools or singletons. RAII is great when you have complex construction and lifetime semantics, but sometimes you don't and checking IsInitialized() then failing is fine, it depends on the logic of the code that needs to occur depending on whether initialization failed. Catch statements aren't always the best, sometimes you want to mostly ignore a failed initialization and continue as normal

Nothing you said is a refutation of what I posted. If constructors don't guarantee successful object initialization, you're not using RAII.

Nothing in the C++ standard says you have to use RAII 24/7. If you lack complex object construction and lifetime logic, RAII doesn't fucking matter.

Found the SJW.

Let me guess, it's the ++ that's confusing you, right?

Attached: 1513428967966.jpg (433x480, 34K)

>Be a dumb Redditor using Reddit spacing
>Don't have the cognitive fortitude to understand C++
>Call it too complex because my onions-poisoned brain is too dumb to understand it
>Proceed to ramble on without any valid arguments against it because I'm a dumb zoomer who has no expertise outside of anything pertaining to Fortnite and has an ego the size of a planet

>(Feature) is good
>>(Feature) actually sucks and here's why
>Uhh just don't use it
Sepplesfags are like this no matter what is being discussed.