Re:C will never stop you from making mistakes
by tobyhinloopen on Monday August 10, 2020 @09:58AM
(#24109279)
Why put the astrisk on the variable though? It’s part of its type, isn’t?
[ Parent
| on HN ]
Re:C will never stop you from making mistakes
by stephencanon on Monday August 10, 2020 @10:02AM
(#24109323)
Because in the C (and C++) grammar,
int *a, b;
declares a pointer-to-int `a` and an int `b`, rather than two pointers-to-int. The better solution to this problem is "don't do that", but C (and C++) programmers have a fetish for terseness.
Re:C will never stop you from making mistakes
by secondcoming on Monday August 10, 2020 @10:46AM
(#24109801)
> but C (and C++) programmers have a fetish for terseness.
Indeed, Linus Torvalds has a recent rant about people still adhering to max 80-column width code. It's pointless in the day of massive monitors.
Re:C will never stop you from making mistakes
by qppo on Monday August 10, 2020 @11:20AM
(#24110221)
I use a rather large 4K monitor as my daily driver and maintain 80 column width code where possible, to avoid wraparound when I have many windows open.
It's not pointless unless you're using your massive monitor like you did your tiny one thirty years ago. I use mine like a bunch of tiny monitors, not one big one.