/cp+/ - C Plus+

Let's have a discussion about why C++ is the best programming language on Earth. Pics of Bjarne with long legs are welcome too.

C++ is the best programming language because it pretty much filters brainlets (like all sciences) while being actually useful (unlike biology) and a standard in enterprise programming. It offers all the tools that allow the programmer to flexibly choose between abstraction and performances, and is partially reverse-compatible with C for those who want even pointier control in performance-sensitive code.

The common criticism against C++ is mostly based on some mumbo jumbo of this kind:
>WAAAH when I inherit a method and redefine it then upcast and call the method it doesn't work WAAAH
>WAAAH I'm 200% incompetent at designing an object-oriented architecture and that made me do fucking stupid shit WAAAH
>WAAAH malloc doesn't work WAAAH
>WAAAH I don't get references WAAAH
>WAAAH I can't template 101 WAAAH
>WAAAH the language has no standard way of doing WAAAH
>WAAAH I actually manage to get memory leaks with the straightforward C++ class system WAAAH

This thread is dedicated to the 3-digit IQ people who have transcended the whining of the weak. Dummies who want to know why their criticism of C++ is fucking uneducated weeb-tier opinion are free to ask questions.

Other urls found in this thread:

stallman.org/stallman-computing.html
youtube.com/watch?v=Pom2gLWC5bM&feature=youtu.be&t=18
play.rust-lang.org/?gist=11b8cb9088b0f8c36048a54ee293f537
twitter.com/SFWRedditImages

Sepples is bad and you should feel bad.

That's what you want to think.

the only advantage C has over sepples is being cooler

>Sup Forums LARPers who can't code for shit think C is cooler
Wow, C++ BTFO

>being able to shoot yourself in the foot and introduce vulnerabilities with ease but not doing so through sheer skill
>not cool

>language doesn't support Unicode properly
Into the trash it goes

Great to see we agree on C.

Literally any byte stream like cout can do that.

What's the deal with pointers?
I know what they do but I don't get them if that makes sense, I remember my programming prof was talking during a class once he said if he wants to know how good someone is at programming he'll talk to them about pointers.

Several points where they can help:
-Polymorphism
-Avoid copying objects when passing them to functions (although you're better off using references for that)

Yes, it can use a Unicode string it but can't tell properly how many characters it has unless it's a fixed length format like UTF-32.

Damnit, user. Was literally about to larp about C being cooler. REEEEE

Hang on a min... C isn't cooler?

Manipulating memory addresses allows you to access variables that belong to a parent function, use dynamic allocation (and have a variable not getting deleted at the end of the function) and shorten some code. The hard thing isn't pointers but what you do with them and making the difference between arrays, pointers and array terms.

Counting letters in UTF-8 is trivial.

this, the prefix byte is easy to detect and there is an optimization possible to use known character length and make a proper jump
still utf-8 iterator over string would be nice in STL

How do you feel about this?

stallman.org/stallman-computing.html

it feels like deja vu

Stallman is irrelevant. He didn't write a single line of code in décades, too busy eating shit from his feet.

(((Stallman))) is a NEET communist who uses Emacs and approves pedophilia. His foot-flavored opinion is worth jack shit.

I saw the thread and thought it'd be better to ask here - I'm not the OP of that one. Figured people here would have better arguments

c++ is shit and unless you plan on getting a job in gaymen development there is 0 reason to ever learn it or use it.

Funny, I've written stuff in C and C++ that process or output unicode. Or do you mean it doesn't allow unicode in stuff like variable names? I never tried that and don't know, but have no need to put strange foreign characters or lookalikes of normal letters in my variable names.

>pointier control
heh

I feel like an ant reading that image.

Who seriously thinks this?
C isn't perfect but it is way better than the mess that is C++.
Unless your team consists of brainlets who need to be sandboxed there is no need for 99% of what is exclusive to C++.
And that's not even mentioning the standard library which is worthless for any serious project unless you love things like longer compile times, including tens of thousands of template-heavy LOC to get a fucking vector or string, always using the heap for allocations (or use template-based/hacky allocator interface), using slow implementations of streams and containers, details like all versions of atomic CAS returning bool etc.
C is a much simpler language, not promoting the idea of hiding every detail behind your back, and unless you are abusing macros it's usually trivial to see and reason about what transformations are being made on what data, without having to dig through layers of cruft.
Having a stable ABI is another reason to choose C.

>bjaaaaaarne.jpg

>claiming something subjective is objectively true
>the common criticism against [thing I like] is: [list of valid criticisms]
>ad hominem

checks all the boxes, this thread is going places

>Having a stable ABI is another reason to choose C.
It isn't the 90s any more, every sane sepples implementation which isn't MSVC uses the portable and stable Itanium ABI.

C++ is trash and nearly every feature added to C++ was a mistake.

t. """"webdev"""" brainlet

It's so good even Super Mario teaches it
youtube.com/watch?v=Pom2gLWC5bM&feature=youtu.be&t=18

Most people who critisize on C++ either Java Pajeets, Web Monkeys, or Rust fags, and only last ones has _some_ good points, not often they just screeching about problems from 90s which already were fixed long time ago.

Most people who criticize on C++ either Java Pajeets, Web Monkeys, or Rust fags, and only last ones has _some_ good points, not often they just screeching about problems from 90s which already were fixed long time ago.

>while being actually useful (unlike biology)
So, diseases are caused by your sinful life?

Most bad things about C++ come from C. The fucking build system and single threaded linker.

> unless you are abusing macros
The problem is, most C code does abuse macros.

>I eat shit worse than dog food, I never wash my hands, I breathe exhausting fumes while smoking gutter shit, I do heroin and share my needle with a $2 poz Brazilian trap, I practise bug chasing, I drink one liter of soda per day, zero water, I am interested in pranism, and I bathe in my septic tank
Yes, your diseases are caused by your sins.

How would you know everything you listed is harmful to your health without biology?

>implying only biologists are capable of doing double-blind randomized scientific studies

Don't move the goalpost.

Not doing that. Biology, for the most part, is trivial statistical shit.

>biology
>not useful
I guess I shouldn't be surprised by people who like C++ being retarded.

It doesn't matter what you call it, that's still biology, as in "the study of living beings".

Epic, simply epic. Nothing like pride in ignorance.

At least, a C++ training can get me a job.

Burger flipping can get you a job as well.

The hierarchical position isn't the same thouh.

ive noticed that any time someone acts like u do, even if i support what they're talking about personally, i feel the compulsion to hate whatever they're talking about

You all should just switch to Rust, it's basically C++: the good parts + the borrow checker.

>it's basically C++: the good parts
No.

Rust is C++ but even less readable.

Why not? It has generics, which is like templates but better, it has traits, which is like concepts but better, it has actual move semantic without "empty-but-valid" bullshit, it has no GC, it has RIIA and it's on par with C++ performance-wise. At the same time, it has no C compatibility to slow it down, no stale OOP meme, no UB bullshit, and it prevents many memory and concurrency errors at the compile time, which is nice when you don't have GC.

This.

>A language I don't know is less readable than a language I know
No shit.

> Why using C-like syntax that everybody knows when you can create your own brainfuck?
Not everyone is like you, bruh. Rust seemed like a cool meme, so I checked out official guides, and this syntax makes no goddamn sense.

Pic related: a language without UB.

The syntax is 80% C++ tho, they even use for generics and :: for namespaces just like everybody do. The only unusual part about it is the lifetime specifications, but that's because lifetimes themselves are a new and unusual feature for a PL to have.

Yeah right, having '!' and macros to print line in terminal, sure.

macros >> printf

How cute looking at you, trying to ignore streams in C++. If you don't understand - just say 'I don't know about modern C++ and I keep pretending that it's just C with classes'.

>Pics of Bjarne with long legs are welcome too.
Contributing.

RUSTFAGS BTFO
How to trigger a memory error in less than 20 lines in Rust:
play.rust-lang.org/?gist=11b8cb9088b0f8c36048a54ee293f537

Who cares, most people just use whatever programming language the IDE uses. Eg, c++ for Arduino, Java for android apps, etc

>whatever programming language the IDE uses

>uneducated weeb-tier opinion
Weeb here.
Wrote a kernel in modern C++17.
Anime website.

you know it's true nigga.

Is there any good REST/web framework fro C++

I don't know what the fuck do you mean.

>Wrote a kernel in modern C++17
Easy.
>Anime website.
If you mean web server and app - easy.

Neither of your examples have anything to do with IDEs, retard.

>It has generics, which is like templates but better
Rust generics are nothing like C++ templates and are no where near as powerful

>it has traits, which is like concepts but better
Lol, C++20 concepts are far more powerful than Rust traits.

>no UB bullshit
Yes it does. Just because it's mostly inside unsafe blocks doesn't mean it doesn't have it, and don't think idiots won't abuse unsafe like they abuse UB in C++.

>and it prevents many memory and concurrency errors at the compile time
By treating you like a retard.

Rust doesn't even have CTFE or non-type template parameters yet, and they have no metaprogramming.
The only thing Rust has going for it is it's enum types, pattern matching, good type inference, and better move semantics.
The BC on the other hand is absolutely fucking trash and outweighs all of Rusts upsides.

>If you mean web server and app - easy.
No, I mean Sup Forums is an anime website.

>Easy.
Yeah, anyone can write a shitty beginner """kernel""" by following osdev tutorials, but writing an actually good proper kernel is not easy, especially on x86 PC where the standards are 100% pure trash.