Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
Will AI replace us? Find out what Dustin has to say about this popular question as he takes you through using AI in our workflow as developers.
Resources
Testing ChatGPT's Coding Skills
Check out these other AI Videos!
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
[MUSIC]
0:00
Okay, listen, I get it, AI is everywhere.
0:09
It's pretty intimidating.
0:12
It's actually pretty scary,
but it doesn't have to be.
0:14
And I'm sure you're probably wondering,
will AI replace developers?
0:17
And my answer to that would be,
yes, I think it will, but
0:21
only if you let it replace you.
0:25
There's a lot of things we can do with AI
to help us as developers instead of it
0:26
replacing us.
0:30
Think about it this way,
when the calculator was invented,
0:32
did it take all the jobs
away from teachers?
0:35
It didn't, they used it, and
now it's a part of how they teach.
0:38
So let's take a look at a few things that
we can do to have AI help us instead of
0:42
replace us as developers.
0:46
Let's get into it.
0:48
This first example is an easy one, and
0:49
that's utilizing the blazing fast feedback
that you can receive from ChatGPT.
0:51
In this example, I'll use ChatGPT to
help me debug an issue in my code.
0:56
Being able to work quickly and efficiently
is an absolute must with AI on the rise.
1:01
Many people are afraid that AI could
take their jobs because it can do things
1:06
much quicker than humans.
1:09
And reducing development
costs is a big concern.
1:11
The longer our project takes to complete,
the greater the cost.
1:15
So let's take a look at this example.
1:18
I have one final feature to implement on
this ChatGPT bot that I've created for
1:20
our Discord server.
1:24
This is actually a fun code
long project I just released.
1:26
So if you're interested in checking
that out, check out the description, or
1:28
teacher's notes down below.
1:31
But one thing our bot didn't do was allow
messages that are longer than 1,500
1:33
characters to reply to our channel.
1:37
So my boss asked me if I could add a
feature that can allow us to send multiple
1:39
messages to our discord channel if
there are more than 1,500 characters.
1:43
All I've got left to do
is write this simple for
1:48
loop to push each reply to an array.
1:51
And the only problem is,
1:53
is that I keep getting errors
when I try to run this code.
1:54
Instead of spending a ton of
time on Stack Overflow, or
1:57
trying to figure out why
I'm getting this error.
2:00
Or even googling reasons that this isn't
working, let's throw our chunk of code
2:03
directly into ChatGPT, and
ask it why it's not working.
2:07
It looks like ChatGPT says that
there's a mistake in my code.
2:15
The issue is with the variable
name used to slice the 'res' string.
2:19
It looks like it was a simple typo,
I wrote 'star' instead of 'start'.
2:23
This likely would've taken me a pretty
long time to figure out due to it being
2:27
just a typo.
2:31
Not only does ChatGPT solve my
bug pretty quickly for me, but
2:32
it also explains it as well.
2:35
This has already saved me
a huge chunk of time and
2:37
now I can finish out this feature.
2:39
But while we're here, let's see if we
could have used another tool to speed
2:42
up this feature as well as prevent
any bugs, all enabled GitHub Copilot.
2:45
This is an extension in VS code, it's not
free, but it's absolutely worth paying for
2:50
in my opinion.
2:54
It infinitely speeds up development
process, and I'll show you exactly how.
2:55
So I remove the for
loop code that we just wrote.
2:59
And what I'll do instead is just start
writing my for loop, and GitHub Copilot
3:01
will attempt to autocomplete what
it thinks this code will do.
3:05
It can do this pretty accurately because
it takes the rest of the code that's
3:10
already written and
considers what I might be trying to write.
3:13
As you can see, it rewrote my for
loop with what looks to be different, but
3:16
much shorter than my
previously written code.
3:19
And by taking a look at it,
it does the exact same thing, pretty neat.
3:23
This only took a few seconds.
3:26
One thing that I like to
do when this happens,
3:29
especially if I'm unsure of what the code
that was given to me actually does,
3:31
is just throw the new chunk of code into
ChatGPT, and ask it to explain it for me.
3:35
This is awesome because it helps
me understand the code that I am
3:40
responsible for.
3:43
ChatGPT nor GitHub Copilot is
responsible for the code that I write.
3:45
So it's extremely important to understand
the code, test it, and make sure it works.
3:49
This is why I believe AI won't replace us,
but instead help us.
3:54
You still need to understand the code,
know where to write it,
3:58
when to execute it, and how to format it.
4:01
All these AI tools can
certainly speed things up,
4:03
there still needs to be
a developer to work with it.
4:06
My knowledge of JavaScript is
crucial to understanding the code
4:08
completions that Copilot offered me.
4:12
As you can see, ChatGPT gave me a
breakdown of what each line of code does.
4:14
Utilizing both ChatGPT and GitHub Copilot
is an awesome way to level up as well as
4:18
speed up your development process.
4:23
These are just two low level ways that
you can start using AI to help you as
4:26
a developer instead of replace you.
4:29
I'll link below a couple of videos where
we go a little bit deeper into what AI and
4:31
ChatGPT is,
as well as getting started with ChatGPT.
4:36
I hope this guide was helpful and I'll see
you in the next one, till then, have fun,
4:39
and happy coding!
4:42
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up