Ok, give me ONE reason not to make everything in C++ inline!
YESS!
One small edit for the programmer. One massive headache for the compiler.
Update: it was a missing semicolon
This is it. I give up. I have deleted every single C++ line I've written.
I hate everything about this. I am too old for this shit. I'll just add vtables to my C structs.
THE END
@sos this thread is one of examples why I do not want to work on side projects in c++
@sos no experience but have you looked at those "we fixed c/c++" (Odin for C/Zig for C++)? Spent some time reading the Odin docs and I'm excited to find a project to mess around with it.
@sos That sounds like me trying to give “modern C++” a fair shot a couple years ago. I gave it a few months, end up utterly frustrated, burned the project to the ground, and rewrote it in C11. (My Veridian Expanse game)
@sos Have you considered Rust?
It has many of the advantages of C++, while being a lot easier and way less insane (safe Rust aims to not have any undefined behaviour).
Main drawback is that it can't directly digest C headers, so you either need a tool that generates the bindings, or you have to declare every C function you want to call in your Rust source code too...
(Also, there are aliasing pitfalls when calling Rust -> C -> Rust.)
(Yes, I sound like a broken record at this point...)
@soulsource oh yeah and no thank you!
- low maturity
- absolutely deranged package system (any language with a package system is deranged, imo, have people never heard of security?)
- low cross-platform compatibility
- very few available libraries and resources
@sos At what point does "low maturity" go away? Because that argument has been repeated for years now. The language is in use in the Windows kernel, the Linux kernel, Firefox, Chrome, etc....
The package system is imho not worse than what other languages have with library dependencies. You need to audit the dependency tree in both cases, and Cargo allows you to lock your dependencies to a certain version, such that there can be no unexpected changes.
1/2
@sos The package system is also the answer to the "few libraries" point. There are countless crates on crates.io. Most of which are low quality though.
That leaves the platforms, and that's indeed a point I can't argue against. Especially in gamedev. Progress is being made, but right now, you can't really use it if you want to release on consoles.
2/2
@soulsource low maturity goes away maybe 10-15 years from now?
I’m old enough to remember when everyone was learning Ruby and Objective-C. Where are these now? Where are the Ruby and ObjC job ads?
Damn I’ve been around long enough to see C++ slowly fade to obscurity.
And there is one language still used today after 50 years, and that’s what I’m gonna use.
@sos I'm quite optimistic that Rust has gathered enough traction to stay relevant for quite some time.
(What is somehow sad too, because, while it is imho vastly better than C++, it's far from perfect.)
However, I'm certainly not trying to argue that you shouldn't use C - I was merely trying to suggest an alternative to C++.
@soulsource I too, hope C++ dies