this post was submitted on 02 Feb 2024
291 points (96.8% liked)

Programmer Humor

19623 readers
1 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] sweng@programming.dev 86 points 9 months ago* (last edited 9 months ago) (8 children)

You would think so, but int* a, b is actually eqivalent to int* a; int b, so the asterisk actually does go with the name. Writing int* a, *b is inconsistent, so int *a, *b is the way to go.

[–] Slotos@feddit.nl 38 points 9 months ago (2 children)

When people say “pointers are hard”, they mean “I have no idea where the star goes and now an ampersand is also implicated”.

[–] T156@lemmy.world 24 points 9 months ago (1 children)

That's the part where you give up and randomly shove/unshove symbols in until the code works.

[–] CanadaPlus 5 points 9 months ago

I've definitely never been guilty of this. /s

load more comments (5 replies)