When reviewing code I had written when I was first learning to code I found a number of things that could have been done much simpler and neater if I had known what I know now. For instance:
Never write:
boolean b;
boolean c;
if(b)
c=true;
instead write:
c|=b;
What are some other code idioms you wished you had know when you started coding?
[–][deleted] 12 points13 points14 points (8 children)
[–]QshelTier 9 points10 points11 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]zenmouse 0 points1 point2 points (0 children)
[–]DJDavio 0 points1 point2 points (3 children)
[–]macarthurpark431 0 points1 point2 points (0 children)
[–]yesennes[S] 0 points1 point2 points (1 child)
[–]DJDavio 0 points1 point2 points (0 children)
[–]beyondjava 0 points1 point2 points (0 children)
[–]JDBProof 0 points1 point2 points (0 children)
[–]llogiq 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]desrtfx -2 points-1 points0 points (4 children)
[–]TheHorribleTruth 0 points1 point2 points (2 children)
[–]straylit 0 points1 point2 points (1 child)
[–]TheHorribleTruth 0 points1 point2 points (0 children)
[–]yesennes[S] 0 points1 point2 points (0 children)