As a programmer, encountering errors is inevitable. Most programmers would be confused if they wrote code on the first try and it worked with no errors π. Let's talk about it
1. Syntax Errors.
These are errors that happen when you write something in the wrong way in your code. eg misspelling a keyword/function name or missing a "{}" or ";" where they are required.
This kind of error gets the compiler confused and unable to translate your code into machine code. Hence, code with syntax errors can not be executed.
2. Semantic Errors
Very similar to syntax errors, Semantic errors arise from using the correct words in the wrong places. Like in human languages using the words wrongly leads to confusing conversations.
This means semantic errors also leave the program compiler/interpreter confused and so the code will not execute.
3. Logical Errors.
These are the errors that keep programmers up at night.π€£π€£ Why? These errors occur when your code runs but does not do what you expected it to do. It happens when you write code that does something different from what you planned.
The computer understands the code as you wrote it not as you planned it so no errors will be thrown by the computer.
That's itπ. Hopefully, you have a better understanding of programming errors now which will help you debug when your code is causing you headaches. π
Also because Logical errors are so difficult and personally drove me crazy, my upcoming articles and threads will be on Building Logic for your Code. If that sounds interesting to you, you can give me a follow @timo__tech so you don't miss them. Thanks for reading!!π
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh