Debugging common errors
These are common errors web developers stumble upon in their code.
An error can be as simple as misspeling something. You can misspell the name of a function, the name of a variable, or anything that prevents your code from working properly.
In web development and programming in general a lot of quotes are used. Sometimes you forget to close the quotes when you open them.
Many web languages are case sensitive which means that when you declare a variable or function in one case it has to be referenced the same way whenever you use it again. valueOne and ValueOne are two separate variables just as funcOne() and FuncOne() are two separate functions.
Pointing to the wrong location
When you need to access another file from a webpage like a header file or to open a file to be written to, you need the right path for that file. If you point to the wrong location, you won't be able to accress it.
In the above example we mistyped the name of the directory as stypes instead of styles, now the file won't be called.
When you're using parentheses sometimes you will forget the closing parentheses or you could even forget the parentheses completely.
Wrong number of brackets
Brackets are used for things like loops, functions, and conditional statements. Using brackets can get confusing because sometimes you have brackets within brackets and you end up using the wrong number of brackets. Example - you have a conditional statement inside a function. You might close the brackets for the conditional statement but forget the close the brackets for the function.
Wrong file permissions
When you need to access a file and you can't seem to be able to access it even though you checked that you're pointing to the right location on the server, what's going on? The file permissions on the file are probably what's prevent you from accessing it. You can change file permissions through FTP or directly on the server (if you have direct server access).
When you have unclosed tags you might get undesired and strange results like all the text on your page being bold or your page looking really unorganized with the elements not being where they are supposed to be.
Code doesn't always work the way you plan it to. If there are undesired results, they can usually be traced back to a logic error. These logic errors can occur in your code when you make a mistake in an algorithm or perform an operation you did not intend to.
In the above example we are trying to add 9 + 10 and multiply the result by 9. Instead, 9 is multiplied by 9 and 10 is added to the result.
Occurs when you try to access a resource such as a database with the wrong credentials. Easy to fix as long as you know the correct username and password.