this post was submitted on 08 Jun 2026
287 points (98.6% liked)

Programmer Humor

31797 readers
351 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] SinTan1729@programming.dev 56 points 5 days ago* (last edited 5 days ago) (22 children)

My first ever big boy language was C++ (after Basic, and Logo, does anyone remember that lol). I was in middle school, tried to self-learn from learncpp.com, only to realize that I had mostly learned C, with cin-cout instead of printf-scanf. So I just decided to migrate to C. Nowadays, I mostly code in Rust, Go, and Python. But my experience with C has been extremely helpful. Can't say the same about C++ though.

Try the c++23 standard. There's been a lot of cross pollination. Contrived example follows:

#include <format>
#include <numbers>
#include <print>
#include <string>

int main(int argc, char *argv[]) {
    double pi = std::numbers::pi;
    std::string fstr = std::format("{}, {:>.2}, {:>.5}, {:>.10}", pi, pi, pi, pi);
    std::string h = "Hello";
    std::string w  = "World";
    std::println("{}, {}!", h, w);
    std::print("This won't have a {},", "newline");
    std::println(" but this will add it."); // Add a newline.

    // Can't put a non-constant string as the first argument to
    // print or println so they can be checked at compile time.
    std::println("{}", fstr);
    return EXIT_SUCCESS;
}
load more comments (21 replies)