Logic Errors
Bugs. These are the worst. You have code that compiles and doesn't crash. But the output is not what you expect. Have you ever been on a website and see something like your balance is NaN.
These can be challenging to fix because the cause is not always 100% clear.
Writing clear, maintainable code is so important because it helps reduce bugs. We want to keep our code as bug free as possible, but inevitably we run in to issues.
When a bug is discovered we want to isolate the bug and potentially the environment it happened in.
Say there is a bug on a website we built. Here some questions to ask:
- Was this on desktop or mobile?
- What browser?
- What actions led up to this bug?
- Is the user able to reproduce the bug?
- Can I reproduce the bug?
Depending on the answers to these questions you can ask additional questions.