Please select random order or first card below to begin studying 🤓
Congratulations! You have finished studying this set of cards
  What does Code Craft call an informal set of guidelines that is a practical way to prevent many coding problems?
  Defensive programming
  What is the definition of legacy code given by Code Craft?
  Archaic programs written by code monkeys that are now long gone
  What summarizes the Code Craft stance on making assumptions in programming?
  Assume nothing (in bold)!
  When is the easiest time to use defensive programming techniques?
  The first write of the code
  When should defensive programming techniques be deployed?
  All the time
  What is the first rule of defensive programming according to Code Craft?
  Do not make assumptions
  What are two reasons you shouldn't make assumptions according to Code Craft?
  You will forget them and they will not hold true
  How does Code Craft recommend you smash unwritten assumptions?
  Explicitly check for them in the code
  What do good programmers also do when they make assumptions according to Code Craft?
  Document them
  What are three things that some people mistakenly believe are defensive programming techniques?
  Error handling, testing, and debugging
  How is defensive programming different from debugging?
  Defensive programming prevents problems
  What happens when you do not do the right thing right away according to Code Craft?
  You become more likely to not do the right thing next time
  How should all inputs be treated according to Code Craft?
  With suspicion
  What do good programmers do with garbage input according to Code Craft?
  Ensure well-defined behavior
  What scope should variables be held in according to Code Craft?
  The tightest scope possible
  Where should variables be declared according to Code Craft?
  As late as possible
  When should variables be initialized according to Code Craft?
  At their points of declaration
  What does Code Craft claim causes the most common security vulnerability?
  Buffer overrun
  What does Code Craft say to do when you see warnings being generated?
  Fix them immediately
  Why does Code Craft recommend using parentheses judiciously?
  They increase clarity and reduce faults
  Defensive programming is a practice where time invested in the beginning saves time later, and it can even do what?
  Save the entire project
  What does Code Craft give as a common mistake that happens when you do not think carefully about the code you are typing as you are typing it?
  Typing = instead of ==
  What happens when programmers are careless, do not apply much thought to the code they write, and do not document assumptions?
  Unreliable/unpredictable software
  What question does Code Craft state regarding casting a 64-bit integer into an 8-bit type?
  What happens to 56 of the bits?
  Code Craft describes what kind of programming as ensuring well-defined behavior for garbage input, making sure any assumptions are codified or explicitly captured, and writing code that protects itself against the worst that could happen?
  Defensive programming
  [...] is archaic programs written by code monkeys that are now long gone.
  Legacy code is archaic programs written by code monkeys that are now long gone.
  Three things that some people might believe are [...], but are really not, are [...], [...], and [...].
  Three things that some people might believe are defensive programming, but are really not, are error handling, testing, and debugging.