The Odin Project Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the three stages of the problem-solving process?

A

1) Understand the problem
To make sure any solution you come up with is going in the right direction

2) Plan
- asking questions that answering will help you move closer to solving it
- pseudocoding to confirm the logic behind the task is sound

3) Break big problems into sub- problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an error?

A

A built- in object with name/type and message. It contains information to help us resolve issues (for example, location of code where error is occurring.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the technical term for generating an error?

A

“throwing” an error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a stack trace?

A

a report of error messages that appears underneath the main error message, indicating all the locations where the computer is having trouble running the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can we copy a repo made in Github to our local directory using CLI?

A

git clone [ssh key]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we test whether a local repo is connected to GitHub and what would a successful message display?

A

git remote -v

it will display the URL of the repository you created on GitHub, which is the remote for your local copy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Recall the 6 principles of writing clean code

A

(1) CONSISTENCY
stick with one way of formatting code

(2) INDENTATION
help with parsing

(3) USE APPROPRIATE NAMES
nouns/verbs are used for variables, adjectives for functions which do something
the only time using single letters might be acceptable is in loops/callbacks

(4) ALWAYS ADD SEMI-COLONS
err on the safe side by always adding them in even though the JS compiler will insert them, in some cases not adding them causes unexpected behaviour

(5) DIVIDE AND CONQUER
formatting super long lines into shorter ones
break up large functions into small

(6) LIMIT COMMENTS
for absolutely necessary situations (e.g. why a code is used, refactor and make code as simple as possible to understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When might single letter names for variables be appropriate?

A

loops/callbacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can we start using node.js in the terminal, how can we exit i.e what instruction should we type?

A

node
. exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is TDD and what are the benefits?

A

Acronym for Test Driven Development - a way to develop code by writing tests before writing code to be certain when your code works

It’s more efficient as we don’t have to test code by trial and error e.g running the code ourselves over and over, plugging in different numbers until we were sure that it was working, for larger programs like a game we have to play several games ourselves

How well did you know this?
1
Not at all
2
3
4
5
Perfectly