• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logic error maybe?  RSS feed

 
Nikki Smith
Ranch Hand
Posts: 65
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*EDIT* Nevermind. Been staring at code too long. Realized I messed up my booleans.
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...but looking at the old version of your post I can see horrible things like
== true and == false everywhere. That is not only poor style bur also error‑prone because you might write = by mistake.
Never if (b == true)...  but always if (b)...
Never if (b == false)... but always if (!b)...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!