3 Problems with AI-Generated Code

Programming with Mosh · Intermediate ·🏗️ Systems Design & Architecture ·1y ago

Key Takeaways

The video discusses the problems with AI-generated code, including its tendency to be buggy, insecure, and unreliable, and highlights the importance of understanding the reasoning behind code and investing in learning fundamentals, with tools such as GitHub co-pilot and YouTube Premium mentioned

Full Transcript

a while back some big Tech leaders made some bold claims about AI Jensen hang the CEO of Nvidia actually said that kids wouldn't even need to learn to code anymore because according to him everyone in the world is now a programmer it is our job to create Computing technology such that nobody has to program everybody in the world is now a programmer this is the miracle this is the miracle of artificial intelligence yeah he said everyone in the world is now a program and then there is emad mushak CEO of stability AI who said that in just 5 years there wouldn't be any human programmers left sounds wild right but here's the reality AI isn't exactly living up to that hype instead of taking over programming it's causing a whole new set of issues studies are showing that AI generated code is often buggy insecure and honestly not very reliable in this video we're going to dive into to why this AI hype bubble might be popping we'll check out some numbers talk about why certain AI companies might be overvalued and see why some investors are starting to lose that initial excitement if you actually had to talk about the thing he selling today you go well it's a calculator of sorts well it doesn't always work but when it does it's sort of good so what happened how did we go from AI is going to replace programmers to AI is making things more complicated let's look at the research let's start with a recent study by up level that looks at the reality of AI in coding they studied over 800 developers using AI coding tools like GitHub co-pilot and the results not exactly what you would expect first they found that developers using AI saw a 41% increase in bugs yeah while AI might help you write code faster it's also adding a lot more errors meaning more time spent fixing those errors so in instead of spitting things up AI can actually slow you down in the end and even though you would think that AI tools would help developers complete tasks faster the study didn't show any real improvements in task completion or issue resolution basically ai's Promises of efficiency don't quite hold up also developers using these tools didn't feel any less stressed or burned out their workload and stress levels stayed pretty much the same even though AI was supposed to take over some of those rep competitive tasks so yeah it sounds great in theory but in practice not so much next up let's talk about a study from get clear they analyzed millions of lines of code to see how AI tools actually affect developer productivity if you thought AI was making things more efficient think again one big takeaway was that AI generated code has a 39% higher churn rate meaning a lot of it gets Rewritten or removed shortly after it's created so nearly 40% of that AI generated code ends up being redone which is basically waste of time and that's not all this study found about 11% more duplicated code when developers used AI tools instead of generating efficient reusable code AI tends to spit out new code unnecessarily which just clutters your code base now duplicated code isn't just ugly it can also introduce bugs in multiple places and make your software harder to debug and scale so yeah AI might help you pump out code faster but it also creates a ton of instability more churn more duplicated code it all adds up to less Reliable Software and more effort spent maintaining a clean code base in the end it's more work not less not exactly the game changer we were promised right oh it it thinks that BofA is a real protocol and it's like I don't know how to do that hey I wanted to tell you about something that's been improving my YouTube experience a ton and that's YouTube premium have you ever been watching a video and at the best part and ad pops up well YouTube premium gets rid of that you can watch all your favorite content without a single ad I've been using YouTube premium for the past few years and it's the best experience especially when I'm in bed I love listening to podcasts and I hate those annoying ads popping up but thanks to YouTube premium I never get them but there's more with YouTube premium you can also download your favorite videos this is great if you're traveling or don't have access to high-speed internet you can download videos ahead of time and watch them offline another great benefit is that you can keep your videos playing in the background when you switch to other apps ever been watching a video and then you get a text from a friend when you switch to the other app the video usually stops right with YouTube premium your videos keep playing in the background while you switch to other apps so how do you get all these perks YouTube premium is a paid monthly subscription service you can pay a very low monthly fee and get all these benefits no commitments you can cancel anytime but here's the best part if you subscribe through the link in the description or the banner in this video you will get two months free and I may earn a commission you will not only get an amazing atree experience but you will also support my channel so if you want 2 months of YouTube premium for free subscribe using the link in the description now let's talk about security because when you're writing code it's not just about getting it done it's about getting it right and this is where AI coding assistants start to fall short a study from Stanford found that the developers using an AI assistant wrote significantly less secure code than those working without one what's worse is that developers who had access to an AI assistant were actually more likely to believe their code was Secure even when it wasn't this suggests that AI tools might be giving developers a false sense of confidence AI generated code often looks right which makes developers trust it too easily and this false sense of security is a big deal in fields like healthcare Finance or infrastructure places where security really can't be compromised now don't get me wrong I'm not saying AI is useless or we should stop using it as a developer I can tell you that AI has definitely boosted my productivity I use it all the time for repetitive tasks it's great for generating boilerplate code like the stuff that nobody wants to write from scratch it's great for translating code from one language to another or quickly throwing together a prototype so yes AI is a powerful tool but it's just that a to the future of coding is an AI replacing developers it's developers working with AI anyone telling you otherwise probably has never built real enterprise software in their life or they're trying to sell you something look coding isn't even the hardest part of being a software engineer we spend a ton of time in meetings Gathering requirements setting up environments and digging through old code bases to understand what's really going on coding is only one piece of the puzzle so think of AI like spell checker for writers it makes us more productive but it's not replacing us anytime soon if ever and this brings us to a big takeaway education AI might help with some coding but you still need to understand what's going on behind the scenes you can just trust it blindly companies have learned this the hard way AI can give you code that looks great at first but if you don't fully understand it you're opening the door to bugs instability and security risks on top of that just copy pasting AI generated code can lead to technical death code that's so messy and complex that no one can work with without breaking something that's why in my courses I focus on teaching you to write clean maintainable code that solves real problems I don't just show you what to write I explain why we are doing it this way knowing the reasoning behind your code is key to becoming a great developer someone who can create software that is functional scalable and sustainable in the long run so AI is awesome and it can definitely spit things up but don't use it blindly don't skip learning the fundamentals best practices or the reasoning behind your code just because AI can generate it for you because here's the truth if you don't understand what your code is doing you're not making yourself more valuable you're actually putting yourself at risk of being left behind you won't lose your job to AI you will lose it to the developer who has solid programming skills and knows how to use AI to be even better AI is here to help not to replace us so invest in yourself learn the fundamentals understand the details and then use AI to level up if you found this video helpful please like And subscribe for more coding advice

Original Description

AI was supposed to change coding forever, but it's creating new problems no one saw coming. Let’s break down what this means for developers and why the AI hype bubble might be popping. Get 2 month's of YouTube Premium Free: youtube.com/premium?cc=programmingwithmosh&utm_campaign=ytpcreator Monthly paid subscription. Price per month varies. First 2 months free. Terms apply. Cancel anytime. If you subscribe through the link in this post or the banner appearing in this video, I may get a commission. 🔗 Related Videos: https://youtu.be/4gX44uyGSHo?si=oMV6zLiFlGLEnt-Z https://youtu.be/HXH4yu227EQ?si=4-f1ba7v6PRCQ6lz https://youtu.be/XKkoVpupYdw?si=IeiBMEjtPT3k7lii ✋ Stay connected: - Twitter: https://twitter.com/moshhamedani - Facebook: https://www.facebook.com/programmingwithmosh/ - Instagram: https://www.instagram.com/codewithmosh.official/ - LinkedIn: https://www.linkedin.com/school/codewithmosh/ #ai #coding #programming
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Programming with Mosh · Programming with Mosh · 0 of 60

← Previous Next →
1 6 Visual Studio Tips to Increase Your Productivity | Mosh
6 Visual Studio Tips to Increase Your Productivity | Mosh
Programming with Mosh
2 Visual Studio Keyboard Shortcuts that Speed Up Debugging Applications | Mosh
Visual Studio Keyboard Shortcuts that Speed Up Debugging Applications | Mosh
Programming with Mosh
3 Backbone.js Tutorial Part 2 - Backbone.js Models: Working with Model Attributes
Backbone.js Tutorial Part 2 - Backbone.js Models: Working with Model Attributes
Programming with Mosh
4 Backbone.js Tutorial Part 3 - Backbone.js Models: Model Validation
Backbone.js Tutorial Part 3 - Backbone.js Models: Model Validation
Programming with Mosh
5 Backbone.js Tutorial Part 4 - Backbone.js Models: Model Inheritance
Backbone.js Tutorial Part 4 - Backbone.js Models: Model Inheritance
Programming with Mosh
6 Backbone.js Tutorial Part 1 - Backbone.js Models: Creating Models
Backbone.js Tutorial Part 1 - Backbone.js Models: Creating Models
Programming with Mosh
7 Backbone.js Tutorial Part 5 - Backbone.js Models: Syncing Models with the Server
Backbone.js Tutorial Part 5 - Backbone.js Models: Syncing Models with the Server
Programming with Mosh
8 Backbone.js Tutorial Part 6 - Backbone.js Collections: Creating Collections
Backbone.js Tutorial Part 6 - Backbone.js Collections: Creating Collections
Programming with Mosh
9 Backbone.js Tutorial Part 7 - Backbone.js Collections: Working with Collections
Backbone.js Tutorial Part 7 - Backbone.js Collections: Working with Collections
Programming with Mosh
10 Backbone.js Tutorial Part 8 - Backbone.js Collections: Fetching Collections from the Server
Backbone.js Tutorial Part 8 - Backbone.js Collections: Fetching Collections from the Server
Programming with Mosh
11 Backbone.js Tutorial Part 9 - Backbone.js Views: Creating Views
Backbone.js Tutorial Part 9 - Backbone.js Views: Creating Views
Programming with Mosh
12 Backbone.js Tutorial Part 10 - Backbone.js Views: Passing Data to Views
Backbone.js Tutorial Part 10 - Backbone.js Views: Passing Data to Views
Programming with Mosh
13 Backbone.js Tutorial Part 11 - Backbone.js Views: Handling the DOM Events
Backbone.js Tutorial Part 11 - Backbone.js Views: Handling the DOM Events
Programming with Mosh
14 Backbone.js Tutorial Part 12 - Backbone.js Views: Handling the Model Events
Backbone.js Tutorial Part 12 - Backbone.js Views: Handling the Model Events
Programming with Mosh
15 Backbone.js Tutorial Part 13 - Backbone.js Views: Handling Collection Events
Backbone.js Tutorial Part 13 - Backbone.js Views: Handling Collection Events
Programming with Mosh
16 Backbone.js Tutorial Part 14 - Backbone.js Views: Templating
Backbone.js Tutorial Part 14 - Backbone.js Views: Templating
Programming with Mosh
17 Clean Code: Learn to write clean, maintainable and robust code
Clean Code: Learn to write clean, maintainable and robust code
Programming with Mosh
18 C# Events and Delegates Made Simple | Mosh
C# Events and Delegates Made Simple | Mosh
Programming with Mosh
19 C# Generics Tutorial: Whats and Whys | Mosh
C# Generics Tutorial: Whats and Whys | Mosh
Programming with Mosh
20 Debugging C# Code in Visual Studio | Mosh
Debugging C# Code in Visual Studio | Mosh
Programming with Mosh
21 Repository Pattern with C# and Entity Framework, Done Right | Mosh
Repository Pattern with C# and Entity Framework, Done Right | Mosh
Programming with Mosh
22 Angular 2 Tutorial for Beginners: Learn Angular 2 from Scratch | Mosh
Angular 2 Tutorial for Beginners: Learn Angular 2 from Scratch | Mosh
Programming with Mosh
23 Architecture of Angular 2+ Apps
Architecture of Angular 2+ Apps
Programming with Mosh
24 Working with Components in Angular
Working with Components in Angular
Programming with Mosh
25 C# Tutorial For Beginners - Learn C# Basics in 1 Hour
C# Tutorial For Beginners - Learn C# Basics in 1 Hour
Programming with Mosh
26 Difference between Junior and Senior Developers
Difference between Junior and Senior Developers
Programming with Mosh
27 Step-by-step ASP.NET MVC Tutorial for Beginners | Mosh
Step-by-step ASP.NET MVC Tutorial for Beginners | Mosh
Programming with Mosh
28 [Pluralsight]: Become a Full-stack .NET Developer
[Pluralsight]: Become a Full-stack .NET Developer
Programming with Mosh
29 Xamarin Forms Tutorial: Build Native Mobile Apps with C#
Xamarin Forms Tutorial: Build Native Mobile Apps with C#
Programming with Mosh
30 Value Types and Reference Types in JavaScript
Value Types and Reference Types in JavaScript
Programming with Mosh
31 Using Redux in Angular 2+ Apps | Mosh
Using Redux in Angular 2+ Apps | Mosh
Programming with Mosh
32 Testing Angular 2+ Apps with Jasmine and Karma | Mosh
Testing Angular 2+ Apps with Jasmine and Karma | Mosh
Programming with Mosh
33 Profile and optimize your Angular 2 apps
Profile and optimize your Angular 2 apps
Programming with Mosh
34 Build a Real-world App with ASP.NET Core and Angular 2
Build a Real-world App with ASP.NET Core and Angular 2
Programming with Mosh
35 Entity Framework 6 Tutorial: Learn Entity Framework 6 from Scratch
Entity Framework 6 Tutorial: Learn Entity Framework 6 from Scratch
Programming with Mosh
36 Two-way Binding and ngModel in Angular 4
Two-way Binding and ngModel in Angular 4
Programming with Mosh
37 Udemy Live 2017: Teaching Tech Panel
Udemy Live 2017: Teaching Tech Panel
Programming with Mosh
38 Demo of An E-commerce App Built with Angular, Firebase and Bootstrap 4
Demo of An E-commerce App Built with Angular, Firebase and Bootstrap 4
Programming with Mosh
39 My Brand New Angular Course
My Brand New Angular Course
Programming with Mosh
40 TypeScript Tutorial - TypeScript for React - Learn TypeScript
TypeScript Tutorial - TypeScript for React - Learn TypeScript
Programming with Mosh
41 Access Modifiers in TypeScript
Access Modifiers in TypeScript
Programming with Mosh
42 TypeScript Interfaces
TypeScript Interfaces
Programming with Mosh
43 TypeScript Classes
TypeScript Classes
Programming with Mosh
44 TypeScript Constructors
TypeScript Constructors
Programming with Mosh
45 TypeScript Properties
TypeScript Properties
Programming with Mosh
46 Angular Tutorial for Beginners: Learn Angular & TypeScript
Angular Tutorial for Beginners: Learn Angular & TypeScript
Programming with Mosh
47 AngularJS vs Angular 2 vs Angular 4 | Mosh
AngularJS vs Angular 2 vs Angular 4 | Mosh
Programming with Mosh
48 Angular Material Tutorial | Mosh
Angular Material Tutorial | Mosh
Programming with Mosh
49 Angular Animations Tutorial | Mosh
Angular Animations Tutorial | Mosh
Programming with Mosh
50 Firebase in Angular Applications | Mosh
Firebase in Angular Applications | Mosh
Programming with Mosh
51 Deploying Angular Applications | Mosh
Deploying Angular Applications | Mosh
Programming with Mosh
52 Building Forms in Angular Apps | Mosh
Building Forms in Angular Apps | Mosh
Programming with Mosh
53 Directives in Angular Applications
Directives in Angular Applications
Programming with Mosh
54 Routing and Navigation in Angular | Mosh
Routing and Navigation in Angular | Mosh
Programming with Mosh
55 Angular 4 in 40 Minutes
Angular 4 in 40 Minutes
Programming with Mosh
56 [NEW COURSE] Unit Testing for C# Developers
[NEW COURSE] Unit Testing for C# Developers
Programming with Mosh
57 Unit Testing C# Code - Tutorial for Beginners
Unit Testing C# Code - Tutorial for Beginners
Programming with Mosh
58 C# Classes Tutorial | Mosh
C# Classes Tutorial | Mosh
Programming with Mosh
59 C# Object Initializers Tutorial
C# Object Initializers Tutorial
Programming with Mosh
60 C# Constructors Tutorial | Mosh
C# Constructors Tutorial | Mosh
Programming with Mosh

The video highlights the potential problems with AI-generated code and emphasizes the importance of understanding the reasoning behind code and investing in learning fundamentals to become a great developer. It discusses the limitations of AI tools and the need for developers to be aware of the potential risks and consequences of using AI-generated code. By watching this video, developers can gain a deeper understanding of the role of AI in software development and how to use it effectively.

Key Takeaways
  1. Evaluate the use of AI-generated code in development workflows
  2. Assess the security and reliability of AI-generated code
  3. Invest in learning fundamentals to become a great developer
  4. Understand the reasoning behind code to avoid technical debt
  5. Implement secure coding practices to mitigate potential risks
💡 AI-generated code can be buggy, insecure, and unreliable if not fully understood, and developers need to be aware of the potential risks and consequences of using it

Related AI Lessons

The Hardest Part Of Microservices Is Undoing What Already Succeeded
Learn how to refactor monolithic ERP systems into microservices, focusing on undoing existing successful implementations
Medium · Programming
What OOP Actually Buys You (And Why “Real World Modeling” Is a Lie)
Learn the actual benefits of Object-Oriented Programming (OOP) and why 'real world modeling' is a misconception
Medium · Programming
Data Partitioning in System Design: Why Every Scalable Application Depends on It
Learn how data partitioning enables scalable applications to handle growth without failing
Medium · Programming
Why Realtime Collaboration Is Harder Than It Looks?
Realtime collaboration is a complex distributed systems problem that requires careful engineering, not just a simple UI feature
Medium · JavaScript
Up next
Retracing It All With My Son
Ginny Clarke
Watch →