AI-assisted programming is transforming how developers create systems and apps.
While ChatGPT and Copilot traffic and usage have increased astronomically over the past year, Stack Overflow, the go-to resource for developers, has lost roughly 35% of its traffic in 1.5 years. Are developers moving away from Q&A forums on Stack Overflow to rely on AI?
How will AI continue to impact software developers, as we're already seeing the shifts in use today?
While OpenAI's ChatGPT and other generative AI platforms, including GitHub Copilot or OpenAI Codex, are rapidly improving tools that enhance developer productivity, neither will fundamentally affect the long-term viability of software development as a career—at least not anytime soon.
AI-assisted coding has the potential to accelerate development and improve code quality. However, there are limitations and caveats to blindly adopting everything you get from the tools.
OpenAI's ChatGPT and GitHub Copilot are AI assistants that aid in code development. They offer various benefits and limitations, some defined by the programming language models and datasets they were trained on.
In the chart below, developers accept about a third of the suggestions, indicating humans still need to use their engineering knowledge and software experience to make decisions
ChatGPT
| Github Copilot
|
Both ChatGPT and GitHub Copilot present distinct advantages for facilitating development across various programming languages.
Diamond Bishop, CEO and co-founder at Augmend, a Seattle collaboration software startup states:
"AI is making it so small startups like ours can accelerate all aspects of the software development lifecycle. We're a team of five devs, and we estimate a productivity impact of almost 2X.
...
Going back to coding without this augmentation feels like working without the internet at your fingertips."
Source: How Seattle tech companies are using generative AI for programming
Let’s cover some capabilities and potential challenges to understand how AI might be leveraged or integrated within your development teams.
1. Versatility: ChatGPT's wide range of natural language processing tasks includes code completion and generation of code snippets based on textual prompts.
2. Accessibility: Its natural language interface is easy to use, even for non-programmers or those new to programming languages like Python, JavaScript, Java or TypeScript.
Here's a sample from ChatGPT 4 for a simple Python function that generates a list of car options based on given parameters.
3. Multiple Language Support: With code generation capabilities in various languages, ChatGPT assists developers working in different programming environments, including Python, Java, and C++.
1. Lack of Specialization: ChatGPT isn't solely focused on coding, so it may not have the expertise in certain areas, such as syntax and codebase structure, as specialized tools like Copilot.
2. Potential Inaccuracy: Generated code may require human review and refactoring to ensure compliance with specific coding standards or business requirements.
3. Dependence on Clear Instructions: Effectiveness relies on the clarity and specificity of the user's instructions, which may require further optimization of prompts and templates.
1. Coding Specialization: Explicitly created for coding tasks, Copilot provides accurate and context-aware code suggestions using algorithms trained on public code repositories.
2. Integration with Development Environments: Directly integrates with popular IDEs like Visual Studio Code, Jetbrains, and more, offering real-time assistance and streamlining the coding process with autocomplete functionality.
Real-time assistance includes functions such as "explain selected code" for developers to assert the functionality for lines of code.
3. Learning from Public Code Repositories: Trained on a mixture of licensed code and other publicly available sources, Copilot understands coding patterns and practices, using transformer technology for real-time code suggestions.
1. Potential Intellectual Property Concerns: Training data may include copyrighted code, leading to potential legal and ethical concerns.
2. Dependence on Specific Environments: Its integration might limit usability across different development environments and programming languages like Rust.
3. Common Solutions: It may sometimes suggest commonly used solutions that need to be more innovative or tailored to specific problems.
With the integration of AI tools like ChatGPT and Copilot becoming increasingly prevalent, it's vital to establish clear guidelines on leveraging these technologies effectively. Balancing AI-generated code with human insight, maintaining security, and following the best coding practices are important considerations.
Research on AI Code assistant usage in the past year suggests that users who interact with AI Code assistants create significantly less secure code than those without — with developers placing too much trust in an AI Code's ability to write secure code.
The following section will explore a list of dos and Don'ts that will guide your team in using AI for coding.
1. Utilize AI for Repetitive and Time-Consuming Tasks: AI will automate tasks like code refactoring, debugging, and boilerplate code generation. Use AI coding tools to free developers to focus on more complex aspects of software development.
2. Pair AI with Human Oversight: Combine AI algorithms with human oversight to ensure code efficiency, compliance, and best practices.
3. Test Thoroughly: Apply rigorous testing to AI-generated code, using unit tests, integration tests, and workflows that meet all requirements.
4. Keep Up with Updates and Improvements: Regularly update and retrain AI tools, considering language models and datasets to ensure they align with the latest coding best practices.
1. Don't Replace Critical Thinking: AI will not replace human developers' critical thinking. Avoid over-relying on AI for complex and creative development processes.
2. Don't Use AI as a Sole Solution: Developers must stay current on the latest languages and frameworks since AI models may not always keep up with the latest advancements or understand the full context of the system requirements.
3. Don't Ignore Security Concerns: Protect code, data, and models by implementing dedicated security reviews for AI-generated code. Through a combination of manual or automatic security reviews, conducting a secure code review should include the following key issues:
Potential risk of revealing sensitive data
Breakdowns in authentication, identification, or access control
Security vulnerabilities from the code mishandling: encryption, cookies and tokens, and input and data validation.
Analyzing metrics to minimize errors and policy breaches before integrating code.
4. Don't Skip Documentation: Document AI-generated code to facilitate future maintenance and collaboration to understand the logic behind its generation. See the following article for more details on writing technical documentation.
ChatGPT and Copilot serve different niches within the coding assistance landscape. They leverage deep learning and other technologies to assist in various programming languages, frameworks, and use cases.
Choosing between the two will depend on specific needs, such as how programming languages like Python, JavaScript, Java, TypeScript, Ruby, SQL, and PHP are used, integration with development tools, budget considerations, and the importance of specialized coding assistance.
AI is ready to support developers—not displace them. Rote coding skills aren't nearly as important as the ability to think critically and solve problems.
AI coding assistants’ limitations confirm that software developers today are "problem-solvers" more than "coders."
With tools like ChatGPT, GitHub Copilot, AI-powered code editors, and Microsoft's Visual Studio Code, developers leverage these resources to become more efficient and productive. Automating lines of code, code suggestions, and other tasks enables more time for creativity and innovation.
Free Resources