Well, that means that it’s also a C++ thing, but streams are an even slicker concept that aren’t a C thing, making higher-level code look nice and shiny - and abstracting away loads of I/O pain points while encapsulating useful features.
C++ streams are ugly in their own right, but C++ preferred practice these days is to treat it as its own language rather than as a C superset. That is, lots of crufty old C stuff still works in C++ for legacy reasons, but using it when you don’t have to is considered inappropriate.
Yeah, streams are old and crusty and horrific on the inside (don’t ask about the time I implemented a socket layer with streams), but still less clunky than the C standard library (unless you’re really into being a memory Nazi).
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
I see you’re still wading through the high level morass.
And there’s haskell compiler
C++ and C compilers are much more friendly now a days
can’t wait to use templates and have the compiler spit out a 120 page autobiography
A quick
-Werror=format -Werror=format-nonliteral -Werror=format-security
will solve all yourprintf
woes.Use streams, or fmt. fprintf is for C. It’s like people buying a cheap android phone, then going for an iPhone.
I don’t blame you though, C++ carries a lot of baggage. Modern C++ is pretty nice, though, as is Rust.
Forgot a semicolon? That’s 200 errors
Example?
removed by mod
There’s no parent at all. Maybe a tiny confused baby sea turtle.
removed by mod
The meme will be completely different after writing a few lines of rust for a week 😹
Why are you using fprintf in C++ anyway?
If you’re using C++, why not use streams?
I wasn’t personally using C++, I was using relatively modern C which has had an homegrown object system added to it.
Then it’s not C++. And probably an even bigger mess.
Yes, fprintff is a C thing.
Well, that means that it’s also a C++ thing, but streams are an even slicker concept that aren’t a C thing, making higher-level code look nice and shiny - and abstracting away loads of I/O pain points while encapsulating useful features.
C++ streams are ugly in their own right, but C++ preferred practice these days is to treat it as its own language rather than as a C superset. That is, lots of crufty old C stuff still works in C++ for legacy reasons, but using it when you don’t have to is considered inappropriate.
Yeah, streams are old and crusty and horrific on the inside (don’t ask about the time I implemented a socket layer with streams), but still less clunky than the C standard library (unless you’re really into being a memory Nazi).
*ffprintfff
C holding a gun: “if you segfault it’s your own fault”
Assembly (Octopus swimming alone since birth): “compiler? what’s a compiler”