Creating a website isn’t really coding in the traditional sense that many of us think of. This isn’t like writing in C++, Java or even Python – it’s really little more than a fancy formatting language.
But that said, if you’re someone who likes to make websites the old fashioned way: by opening up a text document and then writing it all straight down, then it will still have some things in common with ‘proper’ coding and you’ll still encounter some of the same challenges.
One of those challenges for instance will always be the experience of writing code that looks perfect, confidently running it by clicking on your new HTML file… and then finding that it doesn’t work. When you make Android apps you will have moments when you’re clicking a button that’s coded in precisely the same way as all the other buttons but for some reason it just doesn’t work – and exactly the same thing can happen when you create a website too. The page might not display quite right on your monitor despite having displayed correctly ten minutes ago, a bit of CSS might not be setting your background image not to scroll even though you copy and pasted it from the web, or a link may be dead even though you can see the page it’s linking to right there in the same folder. Sound familiar?
Leave Your Keyboard Be!
It’s at this point that all coders and webmasters might consider banging their head against their keyboard – but of course that’s not going to be particularly good for your keyboard or your head.
Instead then you need to calm down and look at this thing properly. And that means following these logical steps and trying these common fixes… Read on for a detailed step-by-step that can help you out of your crisis.
Undo: The first thing to do is to try clicking Ctrl+Z. That way you’ll undo the most recent changes you made which will allow you to retrace your steps and see at which point the problem started occurring. Notepad doesn’t allow for much undoing though, which is why it’s a good idea to use a better coding environment, or to backup regularly (or both!).
Simplify
Another way to identify precisely where the problem is happening is to try simplifying the code down to its constituent parts. Make it much simpler by gradually removing the extra bits of code you aren’t sure about. Once you know that the problem isn’t something fundamental you’ll at least be able to ensure your energy is being spent pursuing the right lead.
Look for the Most Common Mistakes: If you’ve ever programmed using Java then you’ll know just how often a missing semi-colon can land you in trouble. This is one of the most common errors in Java and there are many similar problems you can encounter in HTML. Is the file name and extension in the correct case? Did you remember to close your tags? If you’re using PHP then is the PHP the first thing on the page? And if you’re using JavaScript then you’ll still need those semi colons…
Read From A to B
The biggest danger when you find a small glitch in your code like this is that you then start ‘picking’ at it and making changes like mad-fire to try and solve the problem. If you aren’t careful then you can eventually find yourself leaving a huge trail of destruction that’s then impossible to fix. Instead then, be calm and methodical and read your code from top to bottom, following it as though you were the browser. This way you’ll also re-learn what the various parts of your programming do so that you make fewer mistakes in future.
Get Help
If you keep struggling then sometimes it pays to have someone else take a look. If you have a web design team then they will of course be happy to examine your code for you, as will a friend who knows how to build websites. Even just going away and coming back later can give you the fresh perspective you need sometimes – don’t sit there for hours going crazy as there are much more productive uses for your time.