Lecture 7: Algorithmic thinking Flashcards

1
Q

Understanding the problem

A

What is input, what is output?

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

Formulating the problem

A

data structure, architecture

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

Developing the Algorithm

A

define functions, code blocks, program flow

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

Implementing the Algorithm

A

make test cases that you can run repeatedly

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

Running it on…

A

the data (if applicable)

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

Syntax Error

A

Typos in variables or functions (TypeError)
Null or undefined - the variable has no value or doesn’t even exist (TypeError)
Maybe you forgot the . Or # while using the querySelector()
Use console.log() to see what the issue is

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

Logical Error

A

− These are errors where the syntax is correct, but the code is not doing what you
intended it to do
− Meaning that the program runs successfully but gives incorrect results.
− These are often harder to fix than syntax errors, as there usually isn’t an error
message to direct you to the source of the error.

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

Debugging Tips

A

Look up the error messages you get in search engines!!!
You’ll probably get the answer 🍭
console.log() is a very useful tool, utilize it 🍬
Explain your code to someone or just say it out loud…
as soon as you start articulating it, 🗣️
the issue will strike you 🎯
Don’t be defensive - try new things to debug!

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

Programming Tips

A

Build small things first like just the part about inputting a number from the user or just the random number generation part
Test if each small part is working correctly
Then put small parts together
Learn to look up APIs
Don’t mindlessly copy from Google or StackOverflow but it’s okay to look it up
Check if the answer applies to your case

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

Code repetition is…

A

the root of all evil in software

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