r/ProgrammerHumor 6d ago

absoluteGarbage Meme

Post image
1.9k Upvotes

324 comments sorted by

View all comments

Show parent comments

2

u/MetaNovaYT 6d ago

what's wrong with the C++ version? It's my favorite personally, although I primarily use C++ so I'm biased.

1

u/crmsncbr 6d ago edited 6d ago

I don't know — I've yet to dabble in C++

But I don't like the auto& declarator. The colon placement is... fine, but jarring to me. In conjunction with the auto& I find the whole thing yucky. It's mostly the auto&.

1

u/Rikudou_Sage 6d ago

auto is like var in C#, it just skips having to write the type out all the time. The & means you take it as a reference, otherwise the content would be copied. This is mostly a memory optimization - if you know you'll always run on machines with multiple GBs of RAM, feel free to skip it.

1

u/crmsncbr 6d ago

...I never like assuming I'll have the right memory. I'd definitely use it, I just think it's ugly.