this post was submitted on 02 Feb 2024
275 points (96.6% liked)
Programmer Humor
28318 readers
888 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You would think so, but
int* a, bis actually eqivalent toint* a; int b, so the asterisk actually does go with the name. Writingint* a, *bis inconsistent, soint *a, *bis the way to go.Yeah, and I'd say that's a design flaw of the language as it is unintuitive behaviour.
While technically true, that's also one of the worst 'features' of the language and I personally consider it a bug in the language. Use two lines and make it clear and correct.
Don't declare more than 1 pointer per line. This resolves that, badly.
Alright, I'll never, ever write something this way now. Good to know.
This is true in C, but not in D.