@Cipher22@lemmy.world
link
fedilink
English
18M

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

pelya
link
fedilink
4
edit-2
8M

A quick -Werror=format -Werror=format-nonliteral -Werror=format-security will solve all your printf woes.

capnminus
link
fedilink
9
edit-2
8M

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 😹

glibg10b
link
fedilink
48M

Why are you using fprintf in C++ anyway?

If you’re using C++, why not use streams?

Alex
creator
link
fedilink
18M

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

@mlg@lemmy.world
link
fedilink
English
148M

C holding a gun: “if you segfault it’s your own fault”

Assembly (Octopus swimming alone since birth): “compiler? what’s a compiler”

Create a post

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.
  • 1 user online
  • 4 users / day
  • 8 users / week
  • 108 users / month
  • 558 users / 6 months
  • 1 subscriber
  • 899 Posts
  • 3.11K Comments
  • Modlog