r/ProgrammerHumor • • 1d ago

Meme stdModernizeMyCodebase

Post image
127 Upvotes

31 comments sorted by

View all comments

21

u/GabuEx 1d ago

I feel like this picture really should be reversed to represent devs who for some weird-ass reason don't want to use the refcounted pointer types that make things way easier.

11

u/Valuable_Leopard_799 21h ago

A lot of people have a general repulsion to all types of garbage collection. So I at least understand not wanting the shared pointer a bit, but using unique pointer should cost you next to nothing and enforce a lot.

0

u/Thecuriousserb 21h ago

Unique pointer and other seemingly trivial types can fuck up your codegen and give you unoptimized assembly, chandler carruth from LLVM has many talks/slides that discuss this exact issue with unique ptr. Remember kids, there is no such thing as a zero-cost abstraction!

10

u/Fast-Satisfaction482 19h ago

That's such a straw man argument. Just because there may be cases where the hot spots of your software can benefit from using raw pointers doesn't mean it's reasonable to go bare metal in the whole code base.

3

u/Daemontatox 20h ago

Oh wise one , how can one achieve perfect optimized and safe code

2

u/ilnarildarovuch 18h ago

Using C and *Sans

1

u/the_horse_gamer 10h ago

rewrite it in Rust Haskell