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

Programming With a Free API

What is an API? An application programming interface acts as an intermediary between your application and the API’s server. You request information from the server and it gives you information that you requested. When you get the data that you need, you can build a front-end design to display the information in a readable format.

Programming with a Free API
Photo by Flickr from Pexels

Find An API

You can use websites like Programmable Web, RapidAPI or API List. While you are evaluating APIs to use, consider whether or not you want to pay to use it. You can find free APIs for your projects.

Farmsense API

I found a free API on ProgrammableWeb called Farmsense. Farmsense provides three APIs to farmers: Day Lengths, Frost Dates and Moon Phases. I used the Moon Phases API to display the current phase of the moon.

Farmsense API Demo

Farmsense API uses the date to tell you what phase the moon is in, what percentage of full it is, how long the day is and more.

When I reviewed the AstroWidget, it shows way more information than I want. I wanted to display the current phase of the moon using HTML, JavaScript and CSS. First, I sketched out a design so that I would know what I wanted to build. Then, I read the API’s documentation. Farmsense API doesn’t require an API key. It does requires the current date.

I used JavaScript to get the current date and choose Milwaukee, WI as the location. Farmsense requires your location in longitude and latitude. To simplify, I decided to use one location.

Getting the Data From the API

How do you get data from the API? It returns the data in JSON. Instead of using the Astro-Widget’s method of retrieving the data, I used the JavaScript Fetch API to get it. The Fetch API made it simple and easy to retrieve the data and put it spots I wanted it.

The API doesn’t include images of the moon in each phase. I found icons of Moon Phases on Icons8. Then, I wrote a JavaScript function to determine the moon phase and displayed an icon image that closely matches the phase.

Screenshot of Moon Phase - Dec. 2, 2019

APIs let you work with data to create something more interesting. With HTML, CSS and JavaScript, you can create a simple user interface that retrieves data from an API. No database required for you to maintain. You can get start learning how to work with an API quickly. Have you built something fun with an API?

Make your site printable with CSS

Do your web pages look as good on paper as in your browser? When you are developing your website, you create it to look good on different devices. Then, you print it out and see how terrible it looks on paper. It prints everything out.

Make your site printable with css
Image by tookapic from Pixabay

What can you do to make it look good on paper too? You have to design for print as well. By using CSS, you can change your design to work on paper, too. The easy way is to add an additional media query for print to your CSS. Or you may want to separate it out into its own file.

What you need to create printable CSS?

  • Decide what elements need to be printed
  • Change your print styles to work with the printer
  • Adjust your design to be printable

Decide what needs to be printed

Websites have navigation bars, footers and other design elements that are necessary to use your site. When you are printing, you want only the content not the extras. To make a page printable, you need to decide which elements don’t have to be printed.

Change your print styles to work with the printer

When you print your page, you want it to fit on a page and not cut off important content in strange spots. If your page includes videos or iframes, you want to prevent them from printing as well. Sitepoint shows you how to create the perfect print stylesheet.

Adjust your design to be printable

What do you change? First, look at the font size. Is it too big? You may want to consider changing the size to fit better on paper. Next, are you using background colors on certain elements? You could change them to a different color or hide them.

Are you using a CSS Framework? The framework my impact how it looks on paper. For example, Bootstrap 3’s col-sm-* turns into a single column on paper. You want to change their settings so that the columns work they way you want on paper. Donnie Ray Jones explains how to fix Bootstrap 3 for printing.

By adding printable CSS to your site, you control how your page prints on paper. Your users will be happy it doesn’t print so many extra pages. It is easy to add to your website after you have finished developing.

Tips for Managing Productivity as a Developer

Do you manage your time or does it manage you? If you are like a lot of people, time manages you. As a developer, you need to handle distractions, projects and people. It can be difficult to manage distractions, maintain focus and get your work done.

Tips For Managing Productivity as a Developer
Image by 3209107 from Pixabay

How can you maintain your productivity? You can try these tips below to improve your focus and get things done.

Manage Interruptions and Distractions

You have to deal with distractions like Email, Social Media, notifications and more. Here’s a few things that you can try:

  • Decide when you are going to look at Email. You may want to look at email once or twice a day.
  • Mute all notifications from Slack and Social Media.
  • Put your phone away.
  • If you work in an office, close your door. Or put up a sign letting them know that you are working on a project and need to focus.

You don’t have to stay stuck on a problem

When you are coding, you can run into a problem that you can’t solve. No matter what you try it doesn’t fix it. When that happens, you can take a short break. Five to ten minutes away from the problem can really help. If a break doesn’t work, try working on something else. Doing something simple and easy can be the break that you need.

Create a library of code snippets

You’ll find yourself using the same snippet of code over and over again. Instead of searching your repos for it, you can create a library of snippets. By having a library, you can search and use those snippets faster.

Here’s a few ways to store your snippets:

  • Use a folder on your hard drive
  • If you write code in Visual Studio, you can collect code snippets with Code Snippets Manager
  • Use online tools like CodePen and Github.
  • CSS-Tricks has a collection of code snippets

Schedule and Take Breaks

When you are in the coding zone, you can forget to take breaks. If you try to push through a project without a break, you could burnout. To avoid forgetting, you can schedule your breaks. When you take a break and how long depends on which productivity method you prefer.

When you take a break, don’t start a new task. Take the time to get away from your computer. Stretch, walk, get some water or coffee.

Plan out your tasks

Why plan out your tasks? Planning helps you to know what you want to do and prevents you from forgetting things. You can use a to-do list, a bullet journal or an app like Trello to plan and track your tasks. Whatever method you use, it can help you get more done.

Pomodoro Techinque

When you have a long list of programming tasks, it can be hard to finish them and meet deadlines. The Pomodoro Techinque helps you to focus on one programming task at a time. The key is to work on one task for a specific time. You can use 25 or 50 minutes. When the time up, take a short break and repeat.