this post was submitted on 22 Jul 2025
363 points (98.4% liked)

Programmer Humor

25180 readers
1632 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
 

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
[–] panda_abyss@lemmy.ca 1 points 22 hours ago

I don't know rust, but for example in Swift the type system can make things way more difficult.

Before they added macros if you wanted to write ORM code on a SQL database it was brutal, and if you need to go into raw buffers it's generally easier to just write C/objc code and a bridging header. The type system can make it harder to reason about performance too because you lose some visibility in what actually gets compiled.

The Swift type system has improved, but I've spent a lot of time fighting with it. I just try to avoid generics and type erasure now.

I've had similar experiences with Java and Scala.

That's what I mean about it being nice to drop out of setting up some type hierarchy and interfaces and just working with a raw buffers or function pointers.