Find flaw

find flaw
>pro tip, you can't

Attached: cpp_logo.png (918x1032, 45K)

Other urls found in this thread:

open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html
youtube.com/watch?v=dcgqUb1SXPk
stackoverflow.com/questions/18688763/why-is-istream-ostream-slow
twitter.com/NSFWRedditVideo

Object oriented, used by pajeet (2nd behind Java).

It isn't C.

I unironically love it but
std::vector vec;
vec.emplace_back(param1, param2, param2);

Whoops, one of my types was wrong. Compiler now spits out 10 pages of template errors, none of which point back to this line of code.

And I still don't exactly know how to use && or move properly

>multi-paradigm

it's C but better

C++ can be used functionally you retard.

Attached: reggie.gif (446x251, 726K)

open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html

>object oriented is bad
>muh "person i dont like for some reason is doing X thing"
indians use their lungs to breathe so you better stop doing that too by your logic
also

Just the best. Compiler error messages are painfull though

>it isn't Rust

>tripfagging
>still
>on Jow Forums
yeesh

Go is top tier language

No it isn't. It isn't C but better. It's C but worse.
C >>> C++. C has better syntax than C++ and compiles faster.

>Imagine
But it is

Maybe they can introduce reentrant template "guards" which library writers place around sections of template code. When an error occurs post-substitution, a guard could catch it and replace it with something friendlier specified by the library writer.

You mean like C++20 concepts?

I haven't read anything about concepts yet, so maybe.

They have that already in the form of static_assert, which does what you said, but doesn't really fix the problem I describe. I'm honestly not sure why the problem exists at all, why they can't just propagate the error up to the line that caused it.

Something like static_assert but which would also stifle other errors. Maybe it would use curly braces. "Don't even bother reporting errors originating from this point to this point if this assert fails."

What are the modern uses for it outside of HPC, games, and legacy codebases? I like what I'm seeing with modules threatening to fix the godawfulness that is linking.

Attached: 1454209833540.jpg (374x417, 18K)

They just walk up through the instantiations since the compiler doesn't know what is library code and what is your code that you would want more information about

User applications. I'm sick of big runtimes hogging my entire CPU.

Do tell. Are you building desktop applications, Unix style CLI stuff, or something else? Seems like a lot of modern frameworks refuse to support C++, or if they do some mutant version like Microsoft's Managed C++.

The only fucking problem is the lack of a package manager and build system that everyone uses.

That's the only reason anyone uses rust. If C++ had rusts package manager and build system, everyone would use it.

youtube.com/watch?v=dcgqUb1SXPk

Win32 or Windows Forms

>modern uses
>legacy codebases
nani user

>Win32
Pure Win32 or MFC? I use Microsoft Foundation Classes at work and it's stuck in the late 90's. It's decent for simple crud apps but woe to the person who needs a decent grid control.
>Windows Forms
Forces you to use C++\CLI. Might as well go full C# for all the hoops MS makes you jump through to get the occasional regular C++ in. It really would be nice if Microsoft stopped crapping so hard on it's C++ users.

Big Banks (tm) will pay you Big Bux to service those *nix codebases that got swindled into building.

That's a plus.

plus

>top tier

Maybe if you're a Pajeet.

>find flaw
Boost

>inb4 it's not part of c++
And yet EVERYONE uses it

everything in boost has been standardized

>if c++ was magically different in a way that will never happen it would be good

C++ has better features and optimizations than C: templates, namespaces, better type safety, able to assign methods to structs, function overloading, better standard library.

Templates and the better standard library in C++ are enough to make it better than C.

Which frameworks refuse to support C++?

Just because everyone uses it doesn't mean you have to use it. You can use the language the way you want to use it, that is the power of C++.

>lack of a package manager
Almost every linux distribution has a package manager, there is macports and brew on macos and I don't know much about developing on windows, but I'm sure there already is one.
>build system
There are many, you can use autotools and Cmake (those are off the top of my head)

>regex

All the big desktop applications, embedded systems, military systems.

The world runs on C++ and Java, not meme languages.
If you could make all Go code disappear instantly, a bunch of useless startups would go bankrupt. If you disappeared C++, planes would fall from the sky.

Beat me to it.

> C++ Zealot: Everything is an object
> Me: But dude, you always go for the ubercomplex solution. I can't understand your source code... and fruck your UML mess.
> C++ Zealot: You don't need to understand the source code. That's the beauty of OOP. You only need to worry about that small section of the code that you're working on.

Entire compilation model belongs in the 70s.
Glacial compile times.
Broken exception handling model.
New and delete, along with most of the standard library, suck.
Extremely context dependent syntax leading to kludges like Most Vexing Parse and the abuse of the template and typename keywords.
Undefined behaviour everywhere, including unexpected places.
Move semantics and RAII are poorly implemented.

Despite all that it remains the best option for low level code that must run fast or run with little to no runtime support.

>You don't need to understand the source code. That's the beauty of OOP. You only need to worry about that small section of the code that you're working on.

This is not wrong.

The same is true of well designed procedural programs.

>the better standard library
As long as you don't rely on streams I agree.

>things no one said

The lack of static reflection, the lunacy that is template errors, the pointless verbosity of some fairly simple tasks (there is no just "dump file into string and let me deal with it" function, or "get current time in milliseconds in less than 80 characters" function) and how god damn slow it is to compile.

>The lack of static reflection
You can SFINAE, but it's pretty heinous and ugly

Why do people dislike streams?

They aren't very efficient.

Not true: stackoverflow.com/questions/18688763/why-is-istream-ostream-slow

In python you can get a vector of map keys by some_dict.keys()
To do the same in C++ you need to write your own templated function to do this.

C++'s father Dr. Stroustrup is chill AF. I guess his opinion on lesser languages like Pascal?

Adding on to this: Automated Market Making/High Frequency Trading. Aka, the field where being good at programming directly makes money. No bullshit sales guys, just you and the code you wrote.

Sections of the system not done by FPGAs are done in C++ (except for Jane Street, the wierdos).

> Glacial compile times
Because the compiler optimizes better than any other language?
> New and delete
use the stl ptr wrapper classes
> parsing the syntax
What do I care, the compiler does this for me.

Why the fuck would anyone meme on Cpp? FFS that language is even older than 85% of the users here and it can do excellent programs with good performance. It's not its fault you are afraid of its pointers.

Attached: Imagesmug.png (314x314, 183K)

how do i into pointers?
the c++ class I'm taking is a bunch of helloworld tier garbage that I could do in python
getting bored

The internet is filled with outdated advice and old books which are no longer relevant on it making it hard to actually learn.
The people who use it like to reimpliment the standard libraries for fun.
Most books that aren't outdated or template specialized gloss over templates.

the big one is that the name makes people who know nothing about it think it's an extension of C when it's not, and it shouldn't be treated like C at all, it's a completely different language that happens to have easy interop with C

I don't want to waste my time in searching shitty libraries and then write hundred lines of init code to make a http call or write thousand lines of make files so it will work on Linux and Wndows. Unless they get an easy to use dependency management like maven, don't bother me with this boomer shit.

Hard to go wrong if you do one of Strousups books (depending on previous programming experience), then into Effective Modern C++. Of course all this reading probably puts a lot of people off

Do you understand the concept of a shortcut on Windows or a link on Linux? Congratulations, you now ubderstand pointers.

The C++ Programming Language by Soustrup

>maven
yikes

H E A D E R S
E
A
D
E
R
S

Also:
>no standard, multi platform dependency manager
>no modules
>two types of references
>additional turing complete language for metaprogramming
>metaprogramming errors
>huge legacy of abandoned features or even straight from C
>multiple, incompatible compilers
>none of the compilers is even up to date with standard
>no networking
>5 or something different constructors
>no pattern matching
>no destructuring
>It's not Rust

Attached: fast-programs-different-programming-languages.png (1820x1024, 265K)

a pointer points to somewhere in memory
that's it, you've into pointers

>The people who use it like to reimpliment the standard libraries for fun.
not exactly for fun. Actually the issue is the same with outdated advice, templates used to be poorly managed by many compilers in now exotic architectures. Stagnant devs who feel threatened by change carried on with avoiding std to this day for this reason

>Jow Forums finally starts to ubderstand that C++ is usefull

Holy shit. Never thought I'd see that day, considering how much shit I got for defending it back in 2012/13. Did uriel killing himself contribute to this change of mind?

A pointer is a value that contains an address of a variable or value in memory.

This allows you to use variables in the TAS memory, Which is useful for dynamic arrays and OOP polymorphism and other stuff.

Attached: 1529775153934.png (300x299, 117K)

i meant heap*. tas is the heap in french.

Attached: 1528764606132.jpg (700x896, 216K)

>>none of the compilers is even up to date with standard
What are GCC and Clang?
>>no destructuring
Outdated info.

At least C is good for learning programming as a beginner. Besides a few applications like games that are performance heavy, in general use C++ is completely outclassed by other OOP languages like Java and C#

C++ is superior to both Java and C# just from OOP being optional, instead of it being forced down your throat.

I have to agree that C++ should be used if you need your programs to have good/extremely good performance. otherwise it is like using whatever is the most complex TI_Texas calculator for high-school math.

>Outdated info
Let's say you have.

struct Foo{
string name;
}
struct Bar{
int a;
null* b;
Foo foo;
}

[...]

Bar bar = getBar();


Then how do you extract the pointer b and foo's name as c to new variables from bar?
In Rust it's just:
let Bar {b, foo: Foo {name: c}, ..} = bar;

>there is no just "dump file into string and let me deal with it" function

getline with the eof character as the delimiter.

Why would you need this?

/thread

template
auto keys(T &map)
{
std::vector vec;
vec.reserve(map.size());
for (auto &[key, elem] : map)
vec.push_back(key);
return vec;
}
was that so hard?

repz ret
nop WORD PTR cs:[rax+rax*1+0x0]
nop DWORD PTR [rax+0x0]
main:
xor eax,eax
ret
nop WORD PTR [rax+rax*1+0x0]

Was that too hard?

what does this have to do with getting the keys from a map?

does it look like this class will be good eventually or is it trash

Attached: 1532751646785.png (724x360, 123K)

It's an intro course. If the instructor is good you will have some very basic knowledge of C++ by the end.

to be fair it was worth critiquing in that time, since then it has gottten a lot better with new features added

Why though?

C++11 was already out at the time. 14 and 17 aren't that big of an improvment. Shit, it had lambda support before Java did.

I have no idea what 14 did. 17 at least added filesystem support and basic RTTI both of which I use

Why what? why must you write it yourself?

14 added type inference for return types, variable templates and constexpr which isn't shit. It's worthwhile.

generic lambdas too if I'm not mistaken

Filesystem is just boost::fs

...

>++
There it is

What the fuck should I learn? I don't even know where I want to go with coding. I've put a little bit of effort into Python and a little bit less than that into Java. I've been looking into C++ today but half of what I read tells me that it isn't worth it to do unless I'm interested in large companies and AAA game design.

Doesn't have a code of conduct

learn one thing and learn it well, you faggot.

Why is Rust used by nobody besides hipsters then?

don't listen to the "performance matters less than dev time, go with java (replace with any CG language) hurr" crowd. c++ can be as easy as any other language, the main issue is figuring out what part of it you want to use and which literature is relevant today (try to use recent literature, the language has evolved a lot in the past decade, toward simplicity in memory management and high level concepts)
and figure out what you expect from learning to code. do you want a job? a hobby? what kind of project comes in mind when yoiu think about programming?

That's compile-time reflection not purely destructuring.

lmao what?

Because it's only 3 years old? The only users would be the early adopters aka hobbyists and companies that like being adventurous.

Destructuring in C++ is position-based.