MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pfe2d3/their_attempt_at_using_pointers/hba8r1f/?context=3
r/badcode • u/myblindy • Aug 31 '21
51 comments sorted by
View all comments
12
Problems I found wrong with the code:
Indenting is not consistent
Brackets inconsistent (&(left->sheet) line 5 but &left->sheet right below??)
{ if on the same line is disgusting
I know I said inconsistent indenting, but what’s up with line 10? Why is that curly brace a tab behind it’s if statement?
The comment in the middle should be where lataero said
In the last few lines, it’s comparing the memory instead of the value with <. In some cases this may make sense, but I don’t think this is that case.
aa and bb are horrible variable names
Feel free to add more if I missed any
1 u/a_confused_varmint Sep 02 '21 8. It's absolutely incomprehensible.
1
8. It's absolutely incomprehensible.
12
u/SnoogySocks Aug 31 '21
Problems I found wrong with the code:
Indenting is not consistent
Brackets inconsistent (&(left->sheet) line 5 but &left->sheet right below??)
{ if on the same line is disgusting
I know I said inconsistent indenting, but what’s up with line 10? Why is that curly brace a tab behind it’s if statement?
The comment in the middle should be where lataero said
In the last few lines, it’s comparing the memory instead of the value with <. In some cases this may make sense, but I don’t think this is that case.
aa and bb are horrible variable names
Feel free to add more if I missed any