One of the more unexpected things writing Rust did to my C coding habits is to make me stop using pointer arithmetic.
-
-
Replying to @pcwalton
I guess you mean "use only well-constrained pointer arithmetic" since C has no array access without pointer arithmetic.
1 reply 0 retweets 2 likes -
Replying to @RichFelker
Yeah, I mean I write “&foo[1]” instead of “foo + 1”.
2 replies 1 retweet 10 likes -
Replying to @pcwalton @RichFelker
Mutating index variables instead of pointers is golden
1 reply 0 retweets 0 likes -
How about &1[foo] to make people really confused?
3 replies 0 retweets 0 likes
Best for violating least surprise is -1[foo].
6:48 AM - 1 Jun 2018
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.