C++ thread?

C++ thread?

The metaclasses proposal for C++20 is pretty crazy. It's ridiculously powerful and arguably a bigger change to the language than templates were back in the day.

It more or less completely deprecates the QT moc. It lets you make enum class a library as opposed to a built in language feature. It lets you implement real interfaces, rather than hacked abstract base classes. Etc etc.

Other urls found in this thread:

herbsutter.files.wordpress.com/2017/07/p0707r1.pdf
google.github.io/styleguide/cppguide.html
godbolt.org/g/gRB5XF
twitter.com/NSFWRedditGif

Link to the proposal: herbsutter.files.wordpress.com/2017/07/p0707r1.pdf

C++ continues to improve, but the so called source level C compatibility is holding it back.
My biggest gripe is that its never going to be able to have a standard build/dependency management.

why is cpp better than c#

zero cost abstractions

you have no idea how weird that answer seems to me in an abstract way

C# and C++ aren't in the same ballpark. It's like comparing apples to oranges. C++ is a systems language fit for real time application, embedded development, low level software/firmware/drivers etc. The only contender to C++ is C. Rust can also be considered in the same area of use.

C# is for userland applications where performace does not matter. C# has many competitors, like Java, Go, python etc.

I shouldn't believe Sup Forums but it seems to be true now that I look at it that way

because C# is implemented in C++

How do you search the web for help when programming for C#?

What search terms do you use? A few years ago I wanted to try writing a hello world but failed when Google didn't recognize the '#'. Not even memeing, it was the same with C++, the '+'s got ignored.

>>My biggest gripe is that its never going to be able to have a standard build/dependency management

Agreed. C++ dependencies and headers make me cry. I actually slightly prefer C++ the language (including a few near-term added features) over Rust, but Cargo by itself is enough to strongly tip the scale in favor of Rust.

Language-wise, C++ beats Rust any day, any time. C++ is my favorite language. However, it can't fix the problem of not having library management.

Rust on the other-hand is pretty awkward, but got that right from the get go. Eventually Rust will get better too, at least I hope.

C++ is not better than C#. C# is an elegant language which you can use to code almost anything. Even low level stuff is possible with C#, it has strong support for native code and native API calls.

Just try both and see how much difference there is, C# has almost anything you need, don't have to reinvent the wheel, it's powerful and flexible. Look at Expression trees for example, this is how awesome C# is.

Of course there are situations when you need truly low level language to do something which C# would not be good for. In such case you have pure C to do it.

Why would you use C++ at all, when you have C/C# combination?

I use C# for high level programming (websites) and C for other stuff.

People that call C# more "elegant" than C++ are the people that are too dumb for C++. Maybe they need to be reminded that C# runtime is written in C++ itself. So much for "native" support.

Microsoft fanboys are the worst cancer in technology.

>muh Microsoft

We have .NET Core now and C# is portable to other platforms.

>People that call C# more "elegant" than C++ are the people that are too dumb for C++

Yeah, i'm too dumb because i use language which has powerful language features just like C++ does, but on top of it, has a HUGE standard library with everything i need. I don't have to include and compile BOOST for asynchronous programming for example. I don't have to use third party shit for Socket programming.

Do you see the difference?

For everything else i have C99/11 which is enough.

This has to be bait

>For everything else I have...
It doesn't really matter what your opinion is here because your choice of language indicates the type of programming you focus on.

No it isn't you dumbfuck. Prove me wrong.
C# is perfect for OOP/High level programming
C is enough for everything else

where does CPEEPEE fit here?

>We have .NET Core now
So you do, a stripped down version of .NET. I wonder what the fuss is all about.

>i'm too dumb because i use language which has powerful language features just like C++ does
Please, come back when your "powerful" language has compile time variadic templates from C++11

>CPEEPEE fit here?
To write your standard runtime.

Wait, does any statically typed language have metaclasses & static reflection?

I thought metaclasses were mostly a dynamic feature?

C++ really needs to fucking get rid of headers.
I'm aware that modules are coming, but I'm not sure if they actually solve the problems that headers cause.
Does anyone know if modules will solve circular dependency issues? as in module A needing stuff from module B and module B needing stuff from module A. Headers can't handle this at all, I know Rust can handle this just fine though.

GCC and Clang already supports modules, coming in C++20

I know they're coming. but can I test them without recompiling GCC or Clang? I don't see any switches to enable it.

>C++20
cool so now it may be even more NP-complete

your mom is arguably the one person in the world who craves my dick the most

C# may be perfect for OOP, but OOP is not perfect for programming (not even good)

>C++ beats Rust any day
C++ is just overcomplicated in my opinion. Headers, two reference types, complicated metaprograming, tons of features that few people know about and use. Rust will always win in these things. Especially with compiler plugins.
If only they stopped caring about backwards compatibility.

>That safe_union example
Holy FUCK this is awesome. I can't fucking wait for C++20.

mein neger

c++ is for virgin coders the chads code in c
c++ is trash they should have just made c with namespaces classes strings and templates didnt need to add 100000 useless features in an attempt to copy other high level languages that have different purposes

now most kids think they are good coder because they know 50 c++ 17 features by heart yet cant write a single algorithm or understand their os

...

you can always tell your compiler to use C++98 or whatever

>or understand their os
But I'm writing an OS in C++17.

You're OS a shit and has no games.

good luck reversing the nvidia drivers to get decent graphics

Virtual methods are not zero-cost.

CRTPs are.
Good luck emulating that in Microsoft Java.

inb4 java coder,has never seen an opcode or the ntapi in his life

>more powerful
Do they let you restrict what language feature your team uses?
If not then they're useless.
Cpp is both very good and very bad at this.
Making it a very dangerous environment to write performance critical code in.

I don't plan on reversing any drivers or having "decent" graphics.
As long as I have a framebuffer to draw in, I'm fine. I don't plan to have any fancy graphics.
I'm interested in the systems programming aspect, not the graphical aspect.

The most I would do is implement a vmware graphics device driver. Otherwise I will just setup the vesa mode in the bootloader and leave it like that.

>C plus plus
>C sharp

>templates, exceptions, constructors/destructors (and therefore RAII), virtual function polymorphism, references, operator/function overloading, reusable standard generic containers, or explicitly named casts are useless.

>It lets you make enum class a library as opposed to a built in language feature. It lets you implement real interfaces, rather than hacked abstract base classes. Etc etc.
If I can do ghetto structural typing with traits, I'm down with this.

Templates and overloading are good but the rest of the shit you described there is bad.

>templates
i did say templates
> exceptions
exceptions are slow and for pussies even google chooses not to use them google.github.io/styleguide/cppguide.html

>constructors/destructors (and therefore RAII), virtual function polymorphism
when i said classes i included polymorphism and obviously constructors/destructors otherwise if by classes you thought that i meant just structs but with class instead of struct and data not private by default then you were wrong

>references
what lol?

>references
right forgot about that
> or explicitly named casts
and c++ casts aren't really necessary, just longer to type and in 99.9% of the cases they do the exact same thing

but well i guess the last line of my post applies to you
>inb4 ive been coding for 10 years im not a kid

looks like you have a really bad reading comprehension, stick to web dev

> operator/function overloading
right forgot about that

meant to say that not quote references twice

Exception using code can be more efficient than error code using code if throwing exceptions is rare. The error-free code path can be more heavily optimized.

Most of that is useless, yes.

There's no point to c# when Java and c/c++ exists. Nothing Microsoft makes is elegant but at least typescript makes Javascript usable

C++ will had monads and concepts

>There's no point to c# when Java and c/c++ exists. Nothing Microsoft makes is elegant but at least typescript makes Javascript usable

c# is faster than java and it's easier to make a pretty gui with, and microsoft is doing a pretty good job imho it's just that their os is kinda bloated because of compatility issues

>C++ continues to improve, but the so called source level C compatibility is holding it back.

>Wheels continue to improve but the fact that they are circular hold it back

>standard build/dependency management
Abloobloobloo you can pick the one you like and stick to it.

People talk shit about haskell while praising languages as they make poor copies of haskell features.

C++11 is good enough for me.

C++ doesn't produce 1GB/s of garbage.

Most of the stl stuff is not zero cost

>Exception using code can be more efficient than error code using code if throwing exceptions is rare. The error-free code path can be more heavily optimized.

Stop posting

Screech all you want luddite, it's factually correct.

Prove it

Still waiting for that proof.

godbolt.org/g/gRB5XF
The code generated when you ignore an error code or an exception is the same.
The code generated when you check an error code has an additional compare and branch. It's slower than ignoring the error code.
The code which is executed on the path taken when no exception is thrown is identical to the code which is executed when you don't catch exceptions or check error codes.
In the case that no exception is thrown, exceptions have no cost. In the case that error codes are used, checking the code continues to have a cost.
The cost of handling an exception is orders of magnitude greater than checking an error code. But if exceptions are thrown orders of magnitude less frequently than a function returns successfully, it can balance out.

It's just a question of what does the error check. In the case of exceptions the check must get moved into the called code.

I'm not sure I understand what you're trying to say.

>there are actually people still using c++ instead of rust in 2018

Rust isn't as flexible as C++, although the foundation is much more solid.

Also, the borrow checker is trash.

But seriously, is Rust relevant anywhere outside Kekzilla's shed?

The borrow checker is amazing.

Small rust programs appear here and there as parts of larger projects, but nothing mayor.
There is just not enough Rust devs, so there is no one to use it professionally. It changes though. My boss lately asked me if I want to use Rust in next project.

>tfw too brainlet for C++
I'll stick with C I guess

Life's too short to learn C++.

Cargo worked because they didn't have to support backward ass build systems from 20 years ago. And then the workarounds made by library maintainers to circumvent the bugs.
This make packaging a real bitch.
Still, Conan shows promise.
A standard would be even better but good luck telling that to the fucks from CMake and vcpkg who hope to be the de-facto standard.
In the last corner you have Google who tells you to buy your own server farm that probably cost more than a Bitcoin mining op and then use Bazel.

>My biggest gripe is that its never going to be able to have a standard build/dependency management.
One of the greatest things I like about C++ is that it doesn't have inbuilt module and dependency management. That shit is cancer.

Yeah, C++ just makes 1GB/s of binary bloat.

If you're using a 90s compiler maybe.

> need to build a Qt project for work
> "this will take up 35GB of space on your hard drive"
> wtf
> spend an entire day downloading it
> download fails
fuck Qt

>t. never packaged a non trivial software to any platform

Who is reinventing a shitty LISP?

For C++ I use "cpp"
For C# I use "csharp" or "c sharp"

thanks

I guess that's how everybody does it then