AI isn't the solution to all problems
Tags: ai, a11y, devops
Published: 2023-07-26 17:11:00

---
title: AI isn't the solution to all problems
published: true
description: Whenever a new technology becomes popular, there's a tendency to look to apply it to every problem. As it turns out, this isn't the best approach, as we often already have good solutions which are the best option.
tags: ai, accessibility, devops
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0246ep1pn0qpornuuon7.png
# Use a ratio of 100:42 for best results.
published_at: 2023-07-26 17:11 +0000
---

There's an old saying "If the only tool you have is a hammer, everything looks like a nail." The basic message is if you're using a single solution you're likely to force its usage to solve every problem, even if it isn't the best tool for the job. This is a trap we often fall into when we're handed a new shiny tool, like AI. We immediately want to apply it to every scenario, even when there are existing options which are better equipped. I'm seeing this quite a bit these days with AI, with new products capturing the imagination of developers everywhere. But before we reach for AI we need to stop to ask if this is the right tool or is a better tool already available.

As an example, I recently attended a hackathon where a team was building an app to help developers create accessible websites. They were asking questions about how to incorporate AI into the process, using AI to detect accessibility shortcomings. As it turns out, this is a solved problem.

Looking at web development specifically, there's a set of [clearly defined standards](https://www.w3.org/WAI/standards-guidelines/wcag/). There are numerous tools, including [Visual Studio Code extensions](https://webhint.io/docs/user-guide/extensions/vscode-webhint/) and [GitHub actions](https://github.com/marketplace/actions/web-accessibility-evaluation) which can detect and report on gaps in compliance. Because detection is pattern based, there isn't a need for the dynamic capabilities AI would bring to the table. While it's certainly possible to build a new AI-driven tool, it wouldn't improve the process. This falls into the "hammer/nail" category.

However, there is a space where AI an help developers improve the accessibility of the apps they build. When we look at existing tools, the feedback provided to developers is relatively generic. An error might be raised indicating an `alt` attribute is missing from an `img` tag, but it would likely lack explanatory context. It's always better for someone to truly understand the rationale behind a rule rather than following the rule "because someone said so." Why is the `alt` attribute important? What makes for good alt text? What are the best practices?

Using a tool like [GitHub Copilot Chat](https://github.com/github-copilot/chat_waitlist_signup/join), a developer could highlight a block of code and ask questions like the ones listed above. It's a great opportunity to interactively learn more about accessibility, the experience different users have on a website, and how best to ensure the pages they build are usable by everyone. The information will be contextual to their specific situation, making it more relevant and impactful to the developer.

[GitHub Copilot](https://github.com/features/copilot) can also aid developers in creating accessible code. GitHub Copilot offers suggestions based both on its model and the current development context. If the HTML the developer is editing follows good accessibility practices, GitHub Copilot is more likely to make suggestions which do the same. A developer can also prompt GitHub Copilot by saying things like "Create a link to /login using the login.png image ensuring accessibility", which helps guide the suggestions generated.

In the end, we use different tools with different technologies to help our developers create accessible web pages. Extensions in the [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) alert to potential gaps. Automation integrated into the [CI](https://en.wikipedia.org/wiki/Continuous_integration) process catch issues before they're merged into the codebase. And finally AI helps the developer write better code, gain context and learn about accessibility.

All of us have a propensity to fall into the trap of wanting to use the cool new technology anywhere and everywhere, even if it's not an appropriate application. We always need to stop for a minute to ensure we're using the right tool, that we're not simply hammering everything as not everything is a nail. AI doesn't replace existing tools and solutions; it's another tool we can use to enhance and improve what we already have.