6 Tips For Debugging Your Code

Why isn’t my code working? When you write code, that is a question you will be asking yourself frequently. To find the problem, you will need to debug your code. Here are a few strategies to help you find the bugs in your code.

6 Tips For Debugging Your Code
Image by JohnArtsz from Pixabay

When you code isn’t working, try creating a few print statements. A simple message like “Got here!” can tell you if your code is doing what you expect it to. Whether you send the message to your window, page or console.log, simple print statements can help you determine find problems.

Run your code after making a small change

Small changes are easier to find problems than in code that you spent all day writing. When you make a bunch of changes at once, it can be difficult to figure out which one is causing the error. You may be forced to undo everything that you did and put it back one item at a time until you find the error.

Read the error message

Most error messages tell you what the problem is and where to look.

Copy the error message and search online for an answer

Sometimes you get an error message that makes no sense to you. By copying it and entering it into your favorite search engine, you may find the solution. Someone may written about it on Stackoverflow.com or their own blog.

Comment out the code

When you didn’t know exactly where the problem is, comment out your code and rerun. If it works, uncomment a line of code and run it again. Keep repeating until you find the problem.

Read your code

When you can’t find the error, read your code. Forwards. Backwards and out load if you need to. It may be as simple as a typo. If your missing a semicolon or using the wrong character, your code may compile and still not work. Use your eyes to double check your code.

Talk to someone about the problem

Sometimes, explaining the problem to another person can help you figure out the problem. If you can’t find a person to talk to, you can use the a rubber duck or action figure instead.

More Debugging Tips and Tricks

How to keep improving your UX Design skills as a developer?

Not creative? It takes creativity to solve programming problems. Design is about solving problems, not making things pretty. You can learn UX Design. Design is a learned skill. You can get better at it.

Improve Your UX Skills
Photo by Daria Nepriakhina from Pixabay

How do you keep improving your skills? The same way you improve your programming skills. You learn about design principles, practices and tools. Then, you build something.

Understand design principles

Design principles help you to make websites and apps that are aesthetically pleasing, easy to use and behave the way the user expects them to.

Learn and Use UX Design Tools

Developers like their tools. You can find design tools that help you do tasks like wireframing, prototyping, animations and more. Which tools do you use? That depends on your needs and preferences. Here is a short list to help you find the tools that may work for you:

Take a UX Design Course

A UX Design Course can give guidance on best practices, basic principles and techniques for creating software that people love to use.

Read up on UX and Design

Keep up to date on changes in UX and Design by reading books and blogs.

Blogs

Books

Build Something

Take an app that you built previously and redesign it with what you have learned. By redesigning it, you can see what works better.

Keep experimenting. You can get better by practicing.