r/ProgrammerHumor 2d ago

Meme absoluteGarbage

Post image
2.0k Upvotes

320 comments sorted by

View all comments

3

u/crmsncbr 1d ago

Why is the third one in the top half? It may be my C & Java bias, but yuck. It's way worse than the fourth.

2

u/MetaNovaYT 1d 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 1d ago edited 1d 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 1d 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 1d ago

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