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.

Notes on JavaScript Frameworks

A framework is a standard way to build and deploy applications. It provides code libraries, tool sets, apis and more. JavaScript frameworks make it easier and fun for developers to write code.

Notes on JavaScript Frameworks
Image by Alltechbuzz from Pixabay

If you build apps in JS, you have different frameworks to choose from. React, Vue and Angular are three popular choices. How do you choose? It depends. If you are working on a side project, you get to choose. When you work for a company, the choice may be made for you.

In the Ladybug Podcast entitled React, Vue && Angular, Oh My!, Kelly Vaughn, Ali Spitel and Emma Bostian share which frameworks they like and when to use them. For side projects, you may want to consider Vue or React. React is flexible and allows you to interact with other libraries and frameworks. When you need this type of flexibility, React is a good choice. If you are working on an Enterprise App with a team, Angular is the better choice.

If you have a framework that works for you, why switch to something else?

“Frameworks are not tools for organizing your code, they are tools for organizing your mind.” – Rich Harris

Building applications with Svelte

Svelte is a tool for building fast, small web applications using languages that you already know – HTML, CSS and JavaScript. It is similar to JavaScript frameworks like React and Vue. The difference is the type of code you write. Svelte converts your code into Vanilla JavaScript at build time instead of interpreting it at run time.

With Svelte, you can build an entire app or slowly add it to an existing codebase. Also, you can create components as standalone packages that work anywhere without depending on a conventional framework.

Rethinking Reactivity in JavaScript and Apps

Which framework is right for you? The one that works for you.

Image by Alltechbuzz from Pixabay

How to stay focused on your work

Have you ever been working on a project when a support issue came up? You spend time working on fixing their problem. Five minutes, one hour or even a couple hours you have it solved and fixed. Your customer is happy. You return to your programming project. Now, you can’t even remember where you left off.

How to Stay Focused On Your Work
Photo by Matthew Henry from Burst

Interruptions like support issues, coworkers asking questions or meetings can prevent you from staying focused on your work. What can you do to help concentrate on your work?

You can manage the things you can control like environment, distractions and time management.

Environment

Whether you work from home or in an office, you can control certain things about your workspace.

Chair, desk and computer

You will spend a lot of time sitting at a desk. Your chair and desk should be comfortable for you to work at. If it isn’t, ask for a different one. Consider buying cushions or pillows to help support your back. You can ask for keyboard trays and monitor risers to adjust the height of your computer monitor and keyboard. Or switch to using a standing desk.

Are you warm or cool enough?

Most offices are not comfortable for everyone. Some people are either too cold or too hot. You may want to bring in blankets, sweaters, space heaters or even a fan to make yourself comfortable.

Do you like to listen to music while you work?

Music can help you work. Choose the type of music that inspires and motivates you while you work.

Keep water handy

Water helps you stay alert and hydrated. Dehydration can affect your ability to focus. You want to drink water while you are working.

Distractions

Your phone and emails can affect your productivity. You can manage how you use your phone and how often you check your email.

Your phone

You can make your phone less distracting. Consider putting your phone in silent mode and choose to look at it durning specific times per day. Or install an app that allows you to control how you use your phone.

Emails

Emails can demand your attention. How often to you check your email? If you don’t know the answer, you make be checking it too often. Try these tips for managing your emails.

Time Management

Find a time management strategy that works for you. You can try the Pomodoro technique, Time Blocking or 80/20 rule. Each one of these strategies helps you to manage your time, stay focused on your task and limit distractions.

Staying focus throughout the day can be challenging. By managing your environment, time and distractions like your phone, you can stay focused on your tasks much easier.

Choosing fonts for your next project

Choosing fonts for your project can be a challenge. How do you pick fonts that work? The fonts that you choose can either help or distract your users. You want to pick fonts that are easy to read and fit the personality or mood you want to convey.

Choosing fonts for your next project
Photo by Alexander Andrews on Unsplash

Where do you start?

Pick fonts that match the purpose of your design
Whether you are creating a blog, tutorial, app or business website, you need to pick fonts that match the mood or personality of the project. Fonts can have distinct personalities or moods — casual, serious, playful or elegant.

Decide on a visual hierarchy

Fonts help you to design a typographic hierarchy. You decide how the fonts work together. The three levels we need to consider are primary, secondary and tertiary. The primary level is your headlines. Secondary is used for subheads, captions and pull quotes. The tertiary level is your main body text. These levels help users to scan quickly and focus on the information that they need.

Choose fonts that work with your project

No matter what type of project you are making different fonts work better than others. Fancy and decorative fonts may be a better choice on a blog than your business website.

Create contrast

Pick fonts that complement each other. Mix style, weight, size, spacing and color to achieve the desired effect. For example, pari a bold, chunky font with a tall, thin one.

Limit the number of fonts used

Try keeping the number of fonts to 2 or 3. If you design needs more, add one font at a time.

Use a font generator

A font generators can help you to pick out fonts or experiment with new ones.

Practice

Build sample pages or apps to test out different fonts to see how they work. Keep experimenting and reading blogs for suggestions on font combinations.

Read more