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.
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.
Kevin Garcia
why is cpp better than c#
Levi Thompson
zero cost abstractions
Isaac Campbell
you have no idea how weird that answer seems to me in an abstract way
Anthony Sanchez
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.
Kevin Hernandez
I shouldn't believe Sup Forums but it seems to be true now that I look at it that way
Nathaniel Bailey
because C# is implemented in C++
Jaxon Hernandez
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.
Easton Lewis
>>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.
Ethan Campbell
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.
Samuel Williams
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.
Kevin Sanchez
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.
Leo Young
>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.
Sebastian James
This has to be bait
Brayden Harris
>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.
Ryder Davis
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?
Nolan Martin
>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
Blake Rivera
>CPEEPEE fit here? To write your standard runtime.
Josiah Brown
Wait, does any statically typed language have metaclasses & static reflection?
I thought metaclasses were mostly a dynamic feature?
Cooper Edwards
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.
Isaac Bailey
GCC and Clang already supports modules, coming in C++20
Daniel Ward
I know they're coming. but can I test them without recompiling GCC or Clang? I don't see any switches to enable it.
Josiah Lewis
>C++20 cool so now it may be even more NP-complete
Samuel Price
your mom is arguably the one person in the world who craves my dick the most
Samuel Davis
C# may be perfect for OOP, but OOP is not perfect for programming (not even good)
Gabriel Allen
>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.
Leo Wright
>That safe_union example Holy FUCK this is awesome. I can't fucking wait for C++20.
Blake Green
mein neger
Ian Price
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
Landon Cruz
...
Oliver Miller
you can always tell your compiler to use C++98 or whatever
Elijah Martin
>or understand their os But I'm writing an OS in C++17.
Cameron Sullivan
You're OS a shit and has no games.
James Cook
good luck reversing the nvidia drivers to get decent graphics
Easton Jenkins
Virtual methods are not zero-cost.
Angel Reyes
CRTPs are. Good luck emulating that in Microsoft Java.
Josiah Sullivan
inb4 java coder,has never seen an opcode or the ntapi in his life
Elijah Morales
>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.
Lucas Rodriguez
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.
Leo Moore
>C plus plus >C sharp
Hudson James
>templates, exceptions, constructors/destructors (and therefore RAII), virtual function polymorphism, references, operator/function overloading, reusable standard generic containers, or explicitly named casts are useless.
Bentley Campbell
>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.
Justin Rodriguez
Templates and overloading are good but the rest of the shit you described there is bad.
>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
Jackson Thompson
> operator/function overloading right forgot about that
meant to say that not quote references twice
Connor Reyes
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.
Adam Jones
Most of that is useless, yes.
Austin Davis
There's no point to c# when Java and c/c++ exists. Nothing Microsoft makes is elegant but at least typescript makes Javascript usable
Chase Edwards
C++ will had monads and concepts
Luis Murphy
>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
Aiden Gonzalez
>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.
Noah Brooks
People talk shit about haskell while praising languages as they make poor copies of haskell features.
Ryan Moore
C++11 is good enough for me.
Daniel Baker
C++ doesn't produce 1GB/s of garbage.
Austin Foster
Most of the stl stuff is not zero cost
Luke Nelson
>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
Adam Bailey
Screech all you want luddite, it's factually correct.
Brody Thompson
Prove it
Dylan Carter
Still waiting for that proof.
Brandon Bailey
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.
William Jackson
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.
Nathaniel Reed
I'm not sure I understand what you're trying to say.
Liam Cooper
>there are actually people still using c++ instead of rust in 2018
Jaxson Cooper
Rust isn't as flexible as C++, although the foundation is much more solid.
Also, the borrow checker is trash.
Brandon Martin
But seriously, is Rust relevant anywhere outside Kekzilla's shed?
Eli Clark
The borrow checker is amazing.
Grayson Perez
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.
Chase Walker
>tfw too brainlet for C++ I'll stick with C I guess
Julian Martin
Life's too short to learn C++.
Easton Harris
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.
Jackson White
>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.
Josiah Morales
Yeah, C++ just makes 1GB/s of binary bloat.
Aaron Howard
If you're using a 90s compiler maybe.
Chase Johnson
> 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
Adrian Lewis
>t. never packaged a non trivial software to any platform
Camden Rogers
Who is reinventing a shitty LISP?
Ethan Harris
For C++ I use "cpp" For C# I use "csharp" or "c sharp"