Git Product home page Git Product logo

pfwtfp-solving-for-inputs-lab's Introduction

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?

pfwtfp-solving-for-inputs-lab's People

Contributors

maxwellbenton avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.