Skip to content

learn-co-students/pfwtfp-solving-for-inputs-lab-chi01-seng-ft-082420-mod-1-rep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solving For Inputs

"The more that you read, the more things you will know. The more that you learn, the more places you’ll go." —Dr. Seuss

Objectives

  • Apply reading process to interpret unfamiliar code
  • Identify input/output flow of a method
  • Separate actions within an existing method
  • Distinguish clear and opaque code

Introduction

  1. Identify where to start
  2. Identify inputs and outputs
  3. Distinguish and separate which parts of the code are clear and which are opaque
  4. From your starting point, walk through the code linearly until your reach opaque code.
  5. Repeat steps 2-4 on the opaque code
  6. Continue through all opaque code until the end

In this lab, we're going to apply the process discussed in the previous lesson for interpreting unfamiliar code. The code in this lab is written already, but unfinished. Don't worry about finishing the code - your first task is interpret what is already there - to build a model of how it works in your mind so that you may answer some questions about it.

Once you become more familiar with the code, provide the correct return values for the methods in answers.rb. Run learn to check your answers.

Conclusion

All programmers face the challenge of using code they don't understand. It doesn't make sense to invent the wheel every time a car manufacturer wants to build a car. Nor anti-lock brakes, airbags, seatbelts, etc... The modern car manufacturer gets many parts pre-made somewhere else, and only worries about the assembly. We don't always need to code every part of an application, and often rely on gems or other existing code to handle specific tasks. Sometimes its better for critical components of an application to use existing code that is well-tested.

If, however, we want to have the ability to change and contribute to a codebase, we need to be able to develop an understanding of it.

Now that you have a grasp of what the code does, can you imagine extending it? What games could you build using this code?

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages