Just kidding, I totally reserve the right to go back on this later.

Show thread

@cancel i'm totally conflicted on this. Left-pointers make more sense (the * is part of the type declaration), but it just looks so weird for some reason.

@buzzert actually, right pointers make more sense :/

int *a, *b;

But I find left pointers easier to read for the more common cases... but they're technically not how the C grammar actually works.

@cancel I meant makes more sense in that the type of `int* a` is "pointer to int" not "int", so the `*` should be lumped together with `int` instead of the variable (imo).

Most compiler folks seem to agree using `*` in the grammar was probably a mistake though. I like how modern languages with generics can do things like `pointer<int>` instead now.

@buzzert oh yeah, it was totally a mistake. I don't think languages did it before or after. (Except when intentionally copying C.)

And yeah, I know what you're saying. The * is part of the type of the thing, even though the grammar says it needs to be alongside the name when it's declared like that (like with the multiple-pointers declaration.)

Which is why I find it easier to read when it's left-aligned, with the rest of the type stuff. Alas...

Sign in to participate in the conversation

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.