C++ is shit

I'm a fairly decent C developer so I though I would like C++ and decided to learn it. WRONG

Its so overcomplicated and the syntax is just messy.

Why do people like this lang so much?

Attached: 1_YU6BvZKvxivoEnvqxeG5rw.png (918x1032, 47K)

Other urls found in this thread:

en.cppreference.com/w/cpp/language/lambda
twitter.com/AnonBabble

Nobody actually likes Sepples, it's necessary.

Sorta like Java, but worse

because C is deprecated and there just isn't anything better
also Stockholm syndrome

There's a certain feeling of satisfaction when you do something trivial in other languages in an overcoplicated way.

>Why do people like this lang so much?
Because it is faster.
Because it can do anything.

/thread

Stockholm syndrome. It also has QT

>Why do people like this lang so much?
I think it is easier to solve a large variety of problems in C++.
What kind of software are you developing?

> Its so overcomplicated

It's anti-brainlet lang.

Go play with Javascript or Python then.
They are suitable for low iq mongrels.

I like C++, but there is nothing wrong with Python if you use it for what it's good at.
Please don't tell me you prefer C++ for automating system tasks.

> I like doing things in a much more messy and complicated way just so people think I'm smart

Have fun kiddo

Attached: 8d6.jpg (200x226, 8K)

You're a very shit programmer

C++ is the most expressive, most efficient language.

is c+ better than c++?

>Because it is faster.
no

k

C isn’t faster, if anything it is just as fast

> inferior quality output
> b-but it's easier...

Absolute state of modern development

Just because you work in c and can't understand oop doesn't mean you gotta talk shit on c++

There's nothing more messy than python syntax

> Forces tab indentation
> No curly brackets
> No prober libraries
Even javascript is better than this shit

Attached: pepeLaugh.jpg (640x633, 41K)

I use C++ but the stl is anything but expressive. And don’t even get me started on template syntax.
def sum(a b), do: a + b end
Now that’s an expressive language.
C++ couldn’t be more contrived

just do it more. I came from C++ background and absolutely hated it. But after a year and with good IDE, I'm not complaining.

>be special needs child
>code monkey in C
>is told about language
>learn a 15-year-old obsolete version of the language
>HURRRRRT DDUIRIRIRIRIRIRITIRT MHRURRHRRFF ITS SSRRERERRRRRR CERRRRMPLURRRCAURRRTURRRRRD MHUURRRRRF DUURRP

Attached: brainlet39.png (488x463, 28K)

C++ is indeed a messy language but it is also a solid language with a lot of good tools and libraries. Sure it isn't the best but it isn't actually that bad. My biggest complaint about C++ is that they keep adding stuff to the standard yet it still lacks even a basic cross platform UI toolkit which means you are dependent on OS specific or third party libraries for pretty much any user facing program. If Sun/Oracle can build a semi-decent cross-platform UI toolkit there is no reason C++ can't come with one.

it fills a niche that other languages don't except for maybe rust, and look at how complicated that it

C++ is only good if you suck at C.

Oh look it's another brainlet who can't be assed to actually learn the language he is criticizing, here's some c++14 for you
auto sum = [](auto a, auto b) { return a + b; };

Rust will never put in templates or any metaprogramming beyond macros because they are "too complicated". If you ask me, they are a major strength of C++, once I learned to use them I realized how much every other compiled language sucks at giving the programmer control over code generation.

Fair enough, but I am stuck with C++11 which doesn't support generic lambdas. Regardless, the lambda syntax itself is not expressive. It's not intuitive at all.
I am not dissing the language, it is just less expressive that higher level alternatives and that is an objective fact

>once I learned to use them I realized how much every other compiled language sucks at giving the programmer control over code generation.
C++ metaprogramming is baby tier shit.

>auto sum = [](auto a, auto b) { return a + b; };

Just completed a babbies first course into c++ and I don't recognise this syntax. Could someone spoonfeed me?

Qt is pretty much the de facto cross platform C++ UI toolkit.

On the contrary, I am the one criticizing C++'s expressiveness, but templates are amazing in the sense that they allow you to do something only possible in high level functional languages, except in a low level, extremely fast language. As great as lisps macros, or elixir macros, or haskell monads are, with C++ you have that with a blazing fast speed.
The syntax (and lack of expressiveness) is a side effect of being lower level.

The fact is that no language does metaprogramming as fast as C++

en.cppreference.com/w/cpp/language/lambda

>syntax is just messy.
C syntax is just as shit. C# and java are far better.

someone is incapable of understanding the context here

Attached: aivo.png (645x773, 107K)

>Why do people like this lang so much?
Installed base and RTTI.

Point is you can't do anything useful with C++ templates, and the syntax, semantics and error messages are so god awful you're better off with a custom code generator/preprocessor using any scripting language you like.

Once you've used a language like Forth, Lisp or OCaml (camlp4) where you can hook into the actual parser and compiler, C++ 'metaprogramming' looks like a kids toy.

>you can't do anything useful with C++ templates
You're literally, unironically retarded.

C# for work, C++ for fun and learning.

>Point is you can't do anything useful with C++ templates
get gunned down

> muh I do not understand c++17
you are like the dinosaur, you see the comet coming

C++ is awful, but it's also the least bad thing in its particular domain.

What's a language with non-messy syntax then?

>I'm a fairly decent C developer

if you can't see why a Class has more sense than a simple raw structure you haven't write something. C its the real mess, having global functions everywhere its unsafe when you work in a long team project.

Suppose you are working in embedded in a control and instrumentation project and you need to have strict control on how changing a control or status variable affects the others even if you can write an API like

mySensors_Varx_Set(&Sensor1, 123);

you have no guarantee that other project members wont try to to touch the variable without the setter.

>what are opaque handles

>opaque handles
thats the point, on C they are a joke. Real encapsulation gives you more security and expressive power.

What about this header fails to encapsulate implementation details?
typedef struct foo *Foo;
Foo foo_init(void);
void foo_1(Foo);
void foo_2(Foo);
void foo_3(Foo);
void foo_close(Foo);

try to write a linear algebra pack in raw c, so you see how horrible and messy C is.

>C its the real mess, having global functions everywhere its unsafe when you work in a long team project.
It's literally no different from having 'global classes everywhere'. Just a syntactic difference.
>you have no guarantee that other project members wont try to to touch the variable without the setter.
You can never have that guarantee in any language, what the fuck are you talking about?

It would be cleaner than C++ at least.

Not really. Write it the exact same way as you would in C except you have namespaces, koenig lookup and imports and it'd be much cleaner.

It can do just about everything.
Disadvantage is that it can be pretty confusing and often unreadable.

You made a mistake in "trying to learn cpp". It's too large and has been too important for too long, meaning it has many layers, feature sets and redundant functionality, because its still under heavy development but has to stay backwards compatible or it will break the world

If you want to learn Cpp, learn it indirectly. What got me started was computer graphics and trying to learn OpenGL and DirectX, which are written in Cpp. When some aspect of the language gets in the way, learn just enough to completely grasp what you need and then stop immediately

If you do this, you will love Cpp.

> Point is you can't do anything useful with C++ templates

Attached: 1508417922085.jpg (851x714, 80K)

>you can't do anything useful with C++ templates
Templates combined with relaxed constexpr from C++14 are pretty powerful. There are now compile-time C compilers purely with C++ constexpr.

Attached: 1453656893901.png (180x236, 64K)

dude, make the effort to learn at least basic OOP instead of making arguments out of nowhere, C doesn't even have operator overloading you don't know how useful is that in math areas.

retard

>You can never have that guarantee in any language, what the fuck are you talking about?

Ok now I understand why you do not understad why its important to learn OOP over pure imperative structured programming. Do you know what member access modifiers are?
There is a HUGE difference between a comment in a documentation telling you (PLEASE DO NOT ALTER THIS VARIABLE DIRECTLY) or training monkey Ctards so they know how to work in team and a Public, Protected, Private approach where your team wont have an excuse.

The funny thing is tha ALL C++ fluent programmers knows C too.

>c is deprecated
>linux is written in c
fucking niggers

Retard? But even Bjarne agrees. Maybe try backing your opinion with facts, instead of replying like a 12 yo kid

>hi my name is pajeet and i run windows 10 and unity 3d

It's not so much that it's deprecated, it's more like it's a very niche language. C has very, very specific use cases. And I'll raise another point, if Linux were to be rewritten from scratch, it would be rewritten in C++

lol they will never learn, they feel frustrated because spended years trying to learn C which its practically one of the easiest languages once you learn how memory works but they can't understand the simplest OOP concepts.

>C has very, very specific use cases.

The only valid reason to use C over C++ its if you have to maintain an already done software wrote in C or you are working on an µc which has no C++ compiler. Otherwise there is not such thing as specific C over C++. Performance results gonna be the same if you know what you are doing.

yes the API would be much more cleaner, actually a lot of the parts of an operating system are better explained by OOP than brainlet structured.

kotlin looks very clean imo, or at least it's very easy to read

Rust actually has the potential to become a viable C competitor if they just fix their shit

>you can't do anything useful with C++ templates
He's being ironic, right

> very specific use cases
> calculators, digital watches, phone handsets, wireless mice, TV remotes, USB battery packs

That's about as non-specific as it gets, and that's only the shit I noticed in my living room. Also instrument panels, car ECUs...

Literally anything that uses a microcontroller or a microcomputer was probably programmed in C.

It'd be hard not to, honestly. So much of it is exactly the same, just C is more stripped down.

I wish one of the younger higher-level languages (Go, Scala, Kotlin and friends) would adopt operator overloads. Yes, they hypothetically allow the developer to make something that doesn't do what it looks like it does, but it's not the job of the language to make the programmer behave.

Attached: 1523387586421.jpg (300x300, 14K)

Kotlin does have operator overloads though. It's one of the better implementations of operator overloading IMO.

>C is deprecated

Attached: 1526337572519.jpg (750x1000, 58K)

Holy shit, I have been enlightened

ty user

>was probably programmed in C.
yep, the funny thing is that there are some brainlets who learned ASM for an specifici µC and now they claim C to be inefficient for embedded, the same its happening with those people unable to learn C++ claiming its not for embedded task when performance its the same if you follow technical report recommendations.