Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
View attachment 7489996
Erm, chuddy? That's a heckin deprecated feature. Not very wholesomerino for you to use that! Enjoy reading the docs again, stalker child!
what if people designed apis once instead of designing them 9 times using increasingly stupid language features
 
Any good books on modern C++? I like C, but C++ looks like someone had a seizure and puked brackets all over the screen, and not in the cool lisp way.
i do not think adhering to any specific style of c++ will not make it look any better
certainly not modern c++ because they love angle brackets so much you might confuse it with xml if you squinted
 
Any good books on modern C++? I like C, but C++ looks like someone had a seizure and puked brackets all over the screen, and not in the cool lisp way.
I know this one, on C++11 and C++14, is especially well-recommended:
There have been three further standards you can look into: C++17, C++20, and C++23. The tricky part about writing "modern" C++ or other languages is that, as you go increasingly "modern", there's less of a guarantee your compiler or interpreter will implement all the relevant features. I'm not going to paste a bunch of screenshots in here but, if you ask DeepSeek about what someone means when they refer to "modern C++", you'll get a pretty good breakdown of these various standards.
 
Last edited:
The tricky part about writing "modern" C++ or other languages is that, as you go increasingly "modern", there's less of a guarantee your compiler or interpreter will implement all the relevant features
But conversely, it's much easier to actually find out the answer to "Is this supported?" than in the bad old days, both due to improved documentation and those new feature-testing macros in C++20.
 
ChatGPT, what compilers support C++23 fully?

ChatGPT: No compiler supports C++23 fully.

Why the fuck do we have standards then?
The point of standards is to specify a target for everyone to hit, not to retrospectively formalize a "target" that kinda sorta gets hit.

The CSS standards on the web have that problem, and the Ladybird developers occasionally have to personally ask Chrome/Firefox developers what to actually implement because the standards don't describe it properly. That's what happens when you have the implementations come out before the standards.
 
Any good books on modern C++? I like C, but C++ looks like someone had a seizure and puked brackets all over the screen, and not in the cool lisp way.
if you already know basics of C++ then I've heard good things about C++20 STL Cookbook by Bill Weinman (available on zlibrary), he's currently making c++23 version, but there's a repo with code samples that will be used in the book
 
ChatGPT, what compilers support C++23 fully?

ChatGPT: No compiler supports C++23 fully.

Why the fuck do we have standards then?
It's an unintentional running gag that a C++ standard revision won't be implemented until another revision has already come out. Modules are what, C++20? Also pairs really well with the eternal C++ cope that the newest revision has fixed all major issues and it's a really good language now when you can't ever actually use the newest revision.
 
Lotta clowning in this thread, but if you actually wanna see what C++23 implementation looks like, see GCC: https://gcc.gnu.org/projects/cxx-status.html

C++26: Bit over halfway implemented
C++23: 90% done?
C++20: Two module related features out of ~50 not done
C++17: One features not implemented
C++14 and earlier: 100% compliant

Clang looks about the same, with a few different foibles: https://clang.llvm.org/cxx_status.html

If you don't mind limiting yourself to a compiler (or two, for most of the features), there's a lot of options.
 
I'm not too familiar with C++, so somebody please correct me if I'm mistaken, but it seems like C++'s chronic scope creep has the effect of making the learning curve worse and worse for new users for the benefit of established users. Does this mean that we'll have a crisis when the current C++ userbase retires/dies and nobody can maintain this shit anymore?
 
Lotta clowning in this thread, but if you actually wanna see what C++23 implementation looks like, see GCC: https://gcc.gnu.org/projects/cxx-status.html

C++26: Bit over halfway implemented
C++23: 90% done?
C++20: Two module related features out of ~50 not done
C++17: One features not implemented
C++14 and earlier: 100% compliant

Clang looks about the same, with a few different foibles: https://clang.llvm.org/cxx_status.html

If you don't mind limiting yourself to a compiler (or two, for most of the features), there's a lot of options.
there's also a nice table on cppreference, although its probably outdated by now
GCC's module support as of GCC 14 is buggy, and during the GCC 11 days it was straight up unusable. I hear GCC 15 improved this, but that came out a few weeks ago, so roughly five years after the standard.
from what i've read the reason why modules haven't been implemented yet is because they're very much different as compared to #includes, and compiler backends have to be redesigned/restructured
 
I'm not too familiar with C++, so somebody please correct me if I'm mistaken, but it seems like C++'s chronic scope creep has the effect of making the learning curve worse and worse for new users for the benefit of established users. Does this mean that we'll have a crisis when the current C++ userbase retires/dies and nobody can maintain this shit anymore?
That's already slowly happening. Of course, to this day there are people who do Cobol for money and people who get specifically into Cobol because it's instant well-paid job security, so it's not like old C++ codebases will turn into impenetrable cargo cult artifacts and the west will suddenly collapse. They'll just become harder and more expensive to maintain, which is the case for a lot of software anyway, regardless of language.
 
That's already slowly happening. Of course, to this day there are people who do Cobol for money and people who get specifically into Cobol because it's instant well-paid job security, so it's not like old C++ codebases will turn into impenetrable cargo cult artifacts and the west will suddenly collapse. They'll just become harder and more expensive to maintain, which is the case for a lot of software anyway, regardless of language.
I was thinking of COBOL when I made the post, but I've heard that it's actually quite difficult to get a COBOL job because the banks/etc that hire COBOL programmers don't trust just anyone who can write it unless they have the blessing of the old guard. C++ wouldn't have that problem, but it's also much more widespread, and seems much harder to learn.

Rust will surely also scope-creep its way into this situation, and in 100 years, maybe C will outlive them all.
 
roughly five years after the standard.
For comparison, there was a CSS print "bug" (unimplemented spec feature) in Chrome (that affected products of mine) that was there over ten years from time of spec before it worked properly. Now, Chrome works better than Firefox! Considering the higher implementation complexity of C++ features, five years from spec is quite responsive. Surely, if your organization requires these features, they can contribute development time to helping implement them?
 
Back