Round 1 Day 6

Today I began by finishing up reviewing the flowchart/pseudo-code notes then I jumped into the calculator videos. Things seem more…shaped up in my mind when it comes to the overall structure about it. With that, my plan is to make a list of key points.

  1. If a variable is within an ‘if’ condition, it is available outside it.
  2. Variables within the loop/do processes need to be initialized outside it. Either do it on top of the loop itself or group them together with the rest of the variables.
  3. prompt(“message”) messages are awesome.
  4. Case statements are preferred over pure if/else statements when it comes to a user inputting an integer and there’s conditions for each.
  5. Extract methods to the top, since it reads it top to bottom.
  6. Rubocop is your friend. This will help you spot errors before you have to show them to anybody, so you have a chance to fix the code.
  7. Rememeber for division, if you divide by two whole numbers, you will get a whole number answer. To account for expected decimal answers, use .to_f.
  8. In Ruby, parentheses are optional.

That’s just some of them. Tomorrow I will continue with the calculator and move on to Variable Scope. Also, looking at how bland everything looks, pictures don’t seem like a bad idea. Will add those too, for proof/life to the posts.