Coder Social home page Coder Social logo

hackyourfuturebelgium / debugging-integrate-week-2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 22.0 9 KB

in-class project for the second week of Debugging

License: MIT License

HTML 19.66% JavaScript 77.79% CSS 2.55%
debugging in-class project integrate week-2

debugging-integrate-week-2's Introduction

Debugging: integrate, week 2

The integration exercise this week is slightly more complicated than last week. The biggest change is using script variables to share values between handler calls:

.
├── /scripts
│   ├── /script-variables.js
│   └── /handlers
│       ├── /evens-or-odds.js
│       ├── /list-all-numbers.js
│       ├── /range-display.js
│       ├── /range-set.js
│       ├── /repeat-string.js
│       └── /sum-numbers-in-range.js
├── /index.html
├── /LICENSE
├── /README.md
└── /style.css

Your Tasks

Most of the code already works, the files you need to work in are listed below. Every other file already works correctly.

0. Study the directory structure

Before writing anything, take some time to read through the folders and files. Understand what code is where and why it's organized the way it is.

1. index.html: Complete the

2. sum-numbers-in-range.js: Fill in the blanks

3. list-all-numbers.js: Fill in the blanks

4. repeat-string.js: Fix the bugs

4. evens-or-odds.js: Write the logic


How to DevTool

  • Always have your DevTools open. The debugger will be overwhelming at first, but very quickly you won't know how to work without it.
  • Set your debugger to pause on exceptions
  • Carefully read all console output, especially error messages. Errors aren't failure they are JavaScript trying to help you!
  • Expand errors to practice reading the callstack
  • Click on the line numbers to the right of console output to read the source code

Good Habits

  • Test your code all the time. Every time you make any changes, click the button to see what changed
  • Make one change at a time. If you make many changes at once it's hard to know which one made a difference.

So a good workflow will be something like this (after the project is open in your browser):

  1. Click on the button you are studying
  2. Step through the handler in your debugger until you reach an error or something that does not work correctly
  3. Go to VSCode and make one small change to try fixing the bug, save your changes!
  4. Return to the browser, refresh, and click the same button
  5. Step through to the line of code that caused problems last time, is it fixed?
  6. repeat!

debugging-integrate-week-2's People

Contributors

colevanderswands avatar

Watchers

 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.