Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

correct method for reading code

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I've often wondered about this - is there a correct way to read code in exam questions? Do you start from the top and work your way down, or do you locate the main() method (if there is one)and work from there? Which method can you suggest that works best?
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that's definately a personal choice -- but I tend to start at the main --- and follow the execution of the program: step-by-step.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a different approach, but I don't know if it would help you. When I did the mock exams I found I got a lot of questions wrong because of what I didn't pay attention to in the code. Whenever I answered the question, I forced myself to go back and look at every modifier, and particularly made sure I identified static versus instance members. I'd ask myself if I'd seen something that would change my answer to the question.
I found that helpful, but your mileage may vary.
 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. I seem to be overlooking silly mistakes in certain bits of code. I think I need to get into some routine of double checking one line at a time to spot these pit-falls.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic