Stop worrying about AI pairs, make them your best friends instead
<  Go to blog home page

Stop worrying about AI pairs, make them your best friends instead

Are you worried that AI pairs will take over your job? You’re not the only one. Let’s see how this trend started, what to think about it, and how AI can be a great tool rather than an enemy.

AI Pairs: the start of a new era

News agencies, in their constant aim for acquiring audience frequently spits out an article about a study that presents a set of jobs that are at risk at being replaced by robots and Artificial Intelligence. Now, with tools like Github Copilot (that has just been announced as a publicly available product), Openai Codex and DeepMind AlphaCode, even developers are starting to face that fear.

It is true that automation and robotics have caused the end of many job positions and the fear of automation always looms over people’s minds. However, If you were to ask a developer 10 years ago if he feared to lose its job to a machine, you would probably receive a solid no, and even a ‘are you crazy?’.

Now, right in the middle of a boom in the technology field and a well-noticed shortage of workers, concepts like AI-programmers, low-code and no-code can give the creep on developers who started feeling like they finally found their time under the sun.

But, could that be it? Are AI-models a threat for developers? Before having an answer for that, let us first have a brief overview of these tools and then, we answer it by knowing how they work.

AI-Pair Programmer/Copilot

So the term “AI-Pair” programmer is a pun created by Microsoft/Github team when releasing their AI-Programming tool, playing with the idea of an Au-pair for programming. These tools are tools that use some kind of Artificial Intelligence Engine to provide code completions, generate code from textual input or explain code in Natural Language.

While Github Copilot is probably the most well known tool of the group, there are others that work similarly. Here is a non-exhaustive list of this kind of tools with a brief overview of them:

  • Github Copiliot:
    • Most well known tool.
    • After one year of free closed beta-testing, finally released to all developers for $10/mo or $100/yr.
    • Integrates with IntelliJ IDEs, VS Code, VisualStudio and Neovim.
    • Powered by OpenAI Codex engine.
    • Supports most modern languages: Python, Javascript/Ts, Ruby and Go.
  • Kite:
    • Free to use.
    • Integrates with 16 IDEs, including Vim and Jupyter.
    • Provides shorter, closer context suggestions.
    • Supports over 16 programming languages, including Java and C-family.
  • Tabnine:
    • Fully-functional ai-complete solution.
    • Free for individual use with a Pro Version starting at $12/month. Provides enterprise solution.
    • Only provides short completions in individual use and single-line completions in the Pro version.
    • Integrates with 8 IDEs and supports different languages.
  • Cogram:
    • Specially aimed at Data scientists, helping them write SQL queries from english input and worry about Data Science instead of SQL.
    • Still in beta, focused on Enterprise instead of personal use.
  • AlphaCode:
    • Under development by Deepmind.
    • Provides entire solutions based on natural language descriptions (textual instructions).
    • Not yet turned into a product.

Check this interesting Forbes article:

Now, to understand how these tools can impact the universe of development, it is important to know how they work, because this will help us see their strengths and limitations, allowing for a balanced view of the reality of AI-Pairs.

How an AI pair works

The ai-pair/copilot tools we just described are built on top of Natural language Processing models. Natural language processing is a field of Artificial Intelligence that has the objective of allowing computers to process Natural Language, which is the kind of language that humans use and create naturally (is more fluid and less formal than code, which we could call an artificial language understood by computers).

Most of the currently available tools are based on Deep Learning models trained over tons of code snippets, mainly made available public through tools like Github (hence the reason why Github is one of the main contenders in the area).

These models usually uses architectures called “Transformers”, that paired with a technique called “Attention” can help a model to predict outputs based on surrounding context and language structure previously learned from training.

In Deep Learning, you can train a model by providing sample inputs and their expected outputs (labels). This process, called Supervised training, has been adapted to be performed automatically on text that has not been labeled, in a method called self-supervised learning. This has made it possible to train huge models on lots of data without much manual effort. And this includes code.

Why there is no need to worry

We could say that these Deep Learning models became experts in understanding how code is written, but in general cases. This makes it so that they are not fit to perform very specific tasks (or write specific code) – if they were trained for specificity (e.g.: creating a function that returns the computation of a business specific product cost composition).

They wouldn’t be maintainable nor profitable, especially considering that training one such model and making it available is very expensive – it has been reported that GPT-3, Codex Bigger Brother, have costed around 12 million dollars just to perform a single training run, not accounting for the staffing costs (which is enormous), data acquisition costs, and the underlying infrastructure to have it run.

Another important thing about models like OpenAI Codex and DeepMind AlphaCode are that they require inputs to provide outputs – and these inputs need to follow a certain logic, requires business overview and have to be corrected. Also, context is important, since it is also used as input – and context is not generated by itself. 

The above mentioned is one of the reasons why developers don’t have reasons to worry about being replaced. No current (or near future) model can generate correct code without supervision and after being provided the correct input, following the programming language of choice capabilities.

Also, since they are trained for generality, it is very common that variables and methods pop out of nothing just because they sounded like the correct output given the surrounding context of your environment. Since the combinatorial possibilities of a computer program approach infinity, there are only so much that a machine learning model can do, while human native creativity can go beyond the current status quo.

Considering all these characteristics can give developers clues on how to profit, instead of worrying about Ai-pairs. Now, let us try to summarize ways to make profit out of these tools.

How to make the best use of your ai-pair

Github public release of Copilot shows that AI-Pairs are here to stay. And the flow of competitors following it tells us the same. How, then, can we profit from these tools and not worry about losing our jobs? 

The main hint is given by Charlie’s father situation in the end of Tim Burton’s version of Charlie and the Chocolate Factory. In the movie, Charlie’s father loses his job of screwing toothpaste tub lids after a machine was created to do exactly that. However, in the end of the movie (spoiler alert), his father is seen fixing the same machine that displaced him. 

Repairing the toothpaste machine

The lesson: instead of seeing them as opponents, make these tools your helpers and you as their master (please, Singularity from the future, do not charge my descendants a toll for these words).

How to make the most out of AI pairs

  • Understand the tool’s benefits and limitations.
  • Use natural language input, not only code completion.
    • Most tools allow you to provide a description of what you want (in a comment) and then a solution is provided. Use this to see how the tool would solve your problem and tweak accordingly.
  • Ask for the tool to summarize a code block that you don’t understand.
    • This will save you a lot of brain-compilation time, but don’t trust it blindly!
  • Use the tool to write documentation for you (and fix the documentation afterwards).
    • Documented code is happy code, we want to keep code happy!
  • Use the tool to write test cases for you.
    • Since these tools are good at context and input/output matching, this is a great use case for your tool, will save you a lot of time and help you to write reliable code.
  • Master the logic, not the code.
    • Code is just a set of symbols, logic is what makes code useful. So, focus on writing good logic, making use of the correct data structures and getting the business requirements correct. I’m sure that no AI would ever be able to reason with an Angry Product Owner, but if you master the logic, you can!

Final thoughts

Don’t think that not using an AI pair would mean that you won’t be giving ammunition to the enemy. Instead, think that not using an AI pair would mean that you’ll be out there fighting with a bow-and-arrow against an enemy with a fully-automatic machine gun.

If you follow the above steps when working with an AI-pair, your productivity will increase and you’ll stop worrying about being replaced. You’ll become a better developer and will may even chose to take on the title of AI-beastmaster.

Explore our next posts

Consumer Driven Contract Testing In a Microservice Architecture

Consumer Driven Contract Testing In a Microservice Architecture

Building an E2E test suite in a distributed environment can be a challenging task, in many cases it could even be infeasible considering its complexity and cost, besides that, continuous integration pipelines execution could be very time consuming. Instead of focusing on applications interactions and behaviors, developers probably would spend a considerable amount of time

Stewart Brand’s “How Buildings Learn”–3 lessons for Software Architects

Stewart Brand’s “How Buildings Learn”–3 lessons for Software Architects

There is a reason why there is a specific position in software engineering called Software Architect, and, if you ask 10 different people what software architecture is, you’ll have 10 different answers. On the other hand, if you ask 10 different people what an Architect is, most of them would say that they are responsible

5 Tips That Will Boost Your Career
Tech Team Management

5 Tips That Will Boost Your Career

Feeling lost in your career? This can happen for a variety of reasons. Some feel lost because their work is not challenging enough, others feel stuck in their area and don’t know how to keep growing as professionals, and sometimes people just want a change.  This is especially true in the software industry, where professionals

Join's community today

Apply for jobs Hire developers