Article

HAL vs WALL-E: A Software Engineer’s Dysfunctional Relationship with ChatGPT

December 18, 2024


By Brian Przybytek | Sr Software Engineer |

HAL vs WALL-E: A Software Engineer’s Dysfunctional Relationship with ChatGPT

AI has come a long way in recent years. Sure, we’re still a far cry from Commander Data’s positronic brain or C-3PO’s fluency in six million forms of communication, but AI has reached a point where it’s a useful tool in the modern programmer’s kit. However, sometimes working with AI tools like ChatGPT and Copilot can feel less like collaborating with a friendly WALL-E and more like being gaslit by the ominous and psychopathic HAL, eroding your sanity one query at a time.

So, how do we deal with this?

Step 1: Understand AI’s Limits

First of all, we must remember that AI is not really all that intelligent. It’s simply a tool that parses the petabytes of data available across the internet and reduces it to a palatable, bite-sized amount of information that our human brains can process.

AI tools are essentially pattern-matching engines at their core. They don’t think or reason; they predict the next word or phrase based on the input and their training data. The issue arises when the AI seems almost intelligent—engaging in what feels like an actual conversation. When it fails to provide a functional answer, it’s tempting to feel like it’s deliberately being obtuse or sarcastic. But it’s not; it’s just a machine trying (and sometimes failing) to meet your expectations.

When the AI falters, it’s often because the prompt doesn’t align well with the patterns it has learned. Recognizing this limitation can help you adjust your approach to get better results. For instance, breaking down complex queries into smaller, more manageable parts can guide the AI toward a more accurate response.

Step 2: Ask the Right Questions

To use AI properly, we need to understand its strengths and weaknesses. Don’t ask it questions it can’t possibly answer. If you must, take its responses with a grain of salt. Use precise, clear prompts that play to the AI’s strengths. Vague or overly complex questions will yield frustratingly useless answers.

Think of prompts as blueprints: the clearer and more structured they are, the better the results. For example, asking “How do I improve code readability in Python?” is far more effective than “How do I write better Python code?” The former is specific, giving the AI clear context, while the latter is too broad and invites a meandering response.

Step 3: Stay Calm

It’s easy to get frustrated when crafting the right prompt or when the AI provides unhelpful answers. But getting angry at a machine is like yelling at your microwave for burning popcorn—it’s not going to help. Those faux-apologies from AI? Developers, please, for the love of all that is efficient, remove the fake sincerity. Nobody believes it, and it only fuels the frustration.

Patience is key. If the AI gives a wrong or irrelevant answer, take a moment to rephrase your question or break it into smaller parts. For instance, instead of asking a compound question like “How do I set up AWS Lambda and troubleshoot issues with it?” split it into “How do I set up AWS Lambda?” and “What are common troubleshooting steps for AWS Lambda?” This approach can save you from unnecessary aggravation and help the AI focus on each aspect of the problem.

Step 4: Keep It Concise

Repetitive or overly verbose responses are a common annoyance. A simple trick: add “In 100 words or less” to your prompt. You’re not looking for War and Peace; you’re looking for the TL;DR.

AI often errs on the side of over-explaining because it’s trained to be thorough. Specifying a word limit forces it to distill information into its most essential form. For example, instead of letting it ramble on about “how to optimize a database,” a concise answer might focus on indexing, query optimization, and caching—the core elements you need.

When AI Tools Deliver Results

AI tools can be a great addition to your programming workflow when used strategically. Here’s how they contribute to various outcomes, along with where they fall short.

1. Time Efficiency

AI shines when it comes to repetitive or time-consuming tasks, helping you focus on more critical and creative aspects of your work:

  • Documentation: Writing boilerplate documentation for functions, classes, and APIs can be tedious, but AI simplifies this process. It generates concise, structured documentation that outlines the purpose and functionality of your code, leaving you with more time to handle complex, domain-specific details.
  • Templating: Setting up project scaffolds or configuration files can be repetitive, but AI handles these tasks quickly and effectively. For example, it can create initial Dockerfile setups, JSON templates, or folder structures for a new project, saving significant manual effort.
  • Test Generation: Drafting unit tests often takes considerable time, especially for large codebases. AI can generate initial test cases based on your code, covering edge cases and common scenarios. While these tests need thorough review and refinement, they provide a useful starting point to ensure broader test coverage.

2. Improved Code Quality

AI helps enhance your code by making it more readable, maintainable, and efficient:

  • Code Comments: Many developers struggle to keep their code well-commented. AI can take your code snippets and generate clear, descriptive comments explaining functionality, purpose, and parameters. While not always perfect, these comments provide a strong foundation that you can build on.
  • Refactoring: AI can analyze your code and suggest improvements, such as simplifying complex logic, improving naming conventions, or identifying redundant code. These suggestions not only improve readability and maintainability but can also boost performance. However, since AI lacks deep contextual understanding, it’s essential to validate its recommendations to avoid unintended side effects.

3. Assistance with Errors

While not a replacement for debugging tools, AI can sometimes assist in identifying or addressing errors:

  • Debugging: For surface-level issues like syntax errors or forgotten semicolons, AI can quickly pinpoint the problem and suggest a fix. It can also provide general advice for common errors, like explaining the cause of a null pointer exception. However, for deeper logical issues or context-specific bugs, AI often lacks the nuanced understanding necessary to provide a meaningful solution. It’s best to use AI as a supplementary tool alongside traditional debugging methods.

4. Tasks Beyond AI’s Scope

There are areas where AI is not reliable, often due to its lack of reasoning, creativity, or contextual understanding:

  • Complex Problem Solving: AI is not equipped to handle novel or intricate problems that require creativity, critical thinking, or deep domain expertise. It relies entirely on patterns from its training data, meaning it struggles with unique challenges, innovative algorithms, or problems without a clear precedent. For such tasks, a human’s ability to analyze, brainstorm, and adapt is irreplaceable.

By recognizing where AI excels and where it falters, you can strategically integrate it into your workflow. Let it handle repetitive, structured tasks, and use its suggestions as a starting point, but rely on your expertise for more creative or complex challenges.

And remember, AI is not messing with you. It’s not toying with the simple little human and enjoying watching you lose your mind. At least, not yet.