422
average c++ dev (programming.dev)

I don't think that casting a range of bits as some other arbitrary type "is a bug nobody sees coming".

C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

That's why I love C++

you are viewing a single comment's thread
view the rest of the comments
[-] merc@sh.itjust.works 44 points 5 months ago

"C++ compilers also warn you..."

Ok, quick question here for people who work in C++ with other people (not personal projects). How many warnings does the code produce when it's compiled?

I've written a little bit of C++ decades ago, and since then I've worked alongside devs who worked on C++ projects. I've never seen a codebase that didn't produce hundreds if not thousands of lines of warnings when compiling.

[-] vivendi@programming.dev 4 points 5 months ago

Ignoring warnings is really not a good way to deal with it. If a compiler is bitching about something there is a reason to.

A lot of times the devs are too overworked or a little underloaded in the supply of fucks to give, so they ignore them.

In some really high quality codebases, they turn on "treat warnings as errors" to ensure better code.

[-] merc@sh.itjust.works 2 points 5 months ago

I know that should be the philosophy, but is it? In my experience it seems to be normal to ignore warnings.

load more comments (17 replies)
this post was submitted on 22 Jul 2025
422 points (100.0% liked)

Programmer Humor

27963 readers
1118 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 2 years ago
MODERATORS