5 Tips for Managing Technical Debt

What is technical debt?
Technical debt results when a programmer or team chooses speed over perfect code. They make decisions that focus on shipping code instead of following design considerations. Product Plan gives you an in-depth look at technical debt.

5 TIps For Managing Technical Debt
Photo by Dylan Gillis on Unsplash

Is all technical debt bad?

No. Like financial debt, technical debt can be a necessary tool to help you achieve your goals. It becomes a problem when you haven’t managed it.

How do you manage it?

1. Treat tech debt as a tool

Every tool has its benefits and issues. When you are building new product, you need to decide how you are going to solve certain problems. You may create some technical debt while solving certain problems to get your app out the door.

2. Build it into your processes

Tech debt becomes a problem when you ignore it. To prevent it from becoming a problem, add it to your development processes. Track what debt you can and need to address and what you can live with. Document everything. Good documentation helps you understand the difference between debt, quirks and configuration needs.

3. Good testing can catch issues

Do you test all your code? Make sure you have enough testing to cover all your code.

4. Dedicate time to work on it

Plan on addressing the “bad” debt as part of your work load. If you schedule time to address it, bad tech debt won’t adversely affect the performance of your app.

5. Manage FOMO

There is always a new library, framework or programming language to learn more about. You want to limit the new things that you want to add or try out. Save the new things for a different project. Then, you won’t introduce unintended tech debt that you will have to fix.

Summary

When you write software, you’ll create technical debt. It doesn’t matter how good your processes. You can’t eliminate it. Tech debt can be managed.

Layouts with FlexBox

You can use a CSS library to design a large scale website. What do you do if your needs are simpler? A CSS library like Bootstrap may be too much for your project. Smaller projects may need a simple CSS solution.

Layouts with FlexBox
Image by Gerd Altmann from Pixabay

FlexBox or flexible box can be for design small-scale layouts or applications. For larger projects, you can use it with your favorite CSS library. FlexBox provides you with tools to create layouts that grow and shrink as you need them to.

When would you use FlexBox for layout?

If you are creating navigation menus, web forms, media items or card layouts. Even simple basic grid layouts can be done with FlexBox.

You can use FlexBox to create different kinds of grids. Grids like 3X3, Masonry or Alternating rows. Tobia Sahlin shows you how to build these basic layouts.

What problems can you solve with it?

You can tackle some problems with FlexBox that were difficult using CSS alone. Problems like Vertical Center, Sticky Footers, Input Add-ons and more. Solved By FlexBox shows you 6 different UI solutions that you can do. It includes solutions like vertical centering.

Where do I learn more?

Creating a simple weather app with Open Weather API

How do you get the weather? You could use an app or create your own. First, you need a way to get weather data. You can use an Application Programming Interface to get the data that you need.

Creating a simple weather app with Open Weather API

Where can you find APIs to use in your projects? Try ProgrammableWeb. It is an API directory that lets you find the right API for your project. I found a weather API called Open Weather. Open Weather allows you to get the current weather data, hourly or daily forecast and more.

With Open Weather, I created a simple weather app. It gets the current temperature, daily forecast (highs and lows) and weather conditions. Then, it tells you if the weather was right for riding a bike.

Getting Started

Before writing any code, I looked at Open Weather’s documentation. It explains how to use their API. They include examples using different programming languages like JavaScript. These examples are helpful were helpful to learn what I could do with the API.

On their examples’ page, I found Weather.js. Weather.js fetches data from Open Weather for you. It makes it easy to get weather information from Open Weather.

Building the App

Before building the app, I researched other weather apps to get an idea of what I wanted mine to look like. Then, I sketched out an idea on paper.

I chose to use HTML, CSS and JavaScript. Since I am familiar with Bootstrap, I used it as well. I built my prototype with Bootstrap’s starter template. Then, I wrote my own JavaScript file to fetch data from Open Weather using Weather.js.

Open Weather has weather icons. Weather.js doesn’t use those icons. I looked at the JavaScript and wrote code to get the icons.


Weather.Current.prototype.icon = function () {
  return this.data.list[0].weather[0].icon;
}

Now, my app shows the current and forecast temperatures, weather icon and conditions.

Bike Weather App Screenshot

What to do differently

Open Weather returns weather information for a specific location. Instead of hardcoding the location, I would use the location of the browser. Right now, I used Bootstrap for the UI. I would use a different tool for handling layout like FlexBox or CSS Grid.

Visual Studio Code Tips

Every programmer has their favorite code editor. Your favorite editor may change as you hear about new ones. My new favorite is Visual Studio Code. Visual Studio Code is a code editor for Windows, Linux and Mac OS from Microsoft.

Visual Studio Code Tips
Photo by Sarah Pflug from Burst

With VS Code, I can open Markdown files for editing. Or write code for many programming languages like PHP, JavaScript or C#. A good code editor lets you customize it.

Customize VS Code

How do you make it work for you? The simplest way is to change the theme. Themes change the look and feel of the editor. VS Code lets you select themes from the marketplace or write your own.

When you first install Visual Studio Code, it won’t do everything that you need it to do. Extensions help you to get the features and functionality that you need. You can also use settings and customizations inside VS Code to make it support the way you work.

Visual Studio Code Tips and Tricks

When you are first getting started with VS Code, visit Visual Studio Code Tips and Tricks. This guide helps you to be productive and start using it quickly.

What else can Visual Studio Code do?

It can be challenging to know everything that VS Code can do. You can find out more by checking out VS Code Can Do That?! You’ll find a list of things that it can do. Like Prettier, Node.js Debugging, JSON Intellisense or search user settings.

Why use HTML and CSS over JavaScript?

When you build for the web, you have to make many different choices. What am I going to build? What tools are I going to use? The number of tools, frameworks and libraries available can be overwhelming.

Why use HTML and CSS Over JavaScript
Photo by Nicole De Khors from Burst

JavaScript is no exception. You have a wide variety of JavaScript frameworks or libraries to choice from. Should you use these technologies for every project? HTML and CSS can now do many things that you once needed JavaScript to do.

What is the Lean Web?

The Lean Web is a set of simple web development principles. Best practices for building the web with HTML, CSS and JavaScript. Chris Ferdinandi who wrote the Lean Web encourages you to embrace the web as a platform. To let the browser to do what it does best.

Chris gave a talk on Lean Web at WordCamp LA 2020.


The Three Lean Web Principles

Principle 1. Embrace the Platform
Use HTML over JS, CSS over JS and use the browser for what it is good at. Does that mean you shouldn’t use new tools and technologies? No. You need to decide when you should use them and why.

Principle 2. Small & Modular
Look for small, focused tools that do one thing really well. Use APIs, native browser methods or alternative tools lie Svelte or Preact. Use utility-first CSS to prevent redundancy in your stylesheets.

Principle 3. The Web is for Everyone
Not all browsers support native features. You can use a polyfill to replicate the feature. As developers, we make choices that can break the web for some people. Chris suggest using the A11Y Project to make sure that everyone who wants to use your web applications can.

Summary

You don’t want to avoid using new tools, frameworks and techniques in favor of old ways of doing things. When you are building any project, you have to make choices on what to use. Sometimes, HTML and CSS is the better choice.