I Tried Every AI Coding Assistant

Conner Ardman
22 Nov 202324:50

Summary

TLDRThe video script offers a detailed review of various AI coding tools, including Tab 9, Chat GPT, GitHub Copilot, Bard, Amazon Code Whisperer, Sourcegraph Cody, and Codium AI. The reviewer tests each tool's capabilities in code autocompletion, AI chat, generating comments, and creating test cases. GitHub Copilot emerges as a top choice for efficiency in coding, while Codium AI excels in test case generation and code improvement. The script provides insights into the strengths and weaknesses of each tool, guiding developers toward the most suitable options for their needs.

Takeaways

  • ๐Ÿค– Tabnine is an AI coding assistant similar to GitHub Copilot that autocompletes code within IDEs like VS Code, but lacks multi-line support.
  • ๐Ÿง  The AI chat feature in Tabnine provides correct information about the time complexity of functions but sometimes includes incorrect details.
  • ๐Ÿ” Testing code with Tabnine reveals its ability to suggest fixes for logical errors and improve base case conditions.
  • ๐Ÿ“ Tabnine struggles with generating accurate and useful comments for code, often providing generic or incomplete information.
  • ๐ŸŒŸ GitHub Copilot excels in code autocompletion, offering efficient solutions for handling edge cases and improving code structure.
  • ๐Ÿ’ฌ Chat GPT, while useful for learning and providing context, may not be the best option for coding tasks due to potential context switching and occasional incorrect information.
  • ๐Ÿ“š Bard, similar to Chat GPT, provides sourced information but may be slightly less accurate in coding tasks compared to Chat GPT.
  • ๐Ÿ” Amazon CodeWhisper, Amazon's version of Copilot, lacks a chat feature and has some limitations in autocompleting and understanding code repositories.
  • ๐Ÿ“ˆ Sourcegraph Cody claims to understand entire code repositories but currently falls short in integrating with large codebases effectively.
  • ๐Ÿงช Codium AI focuses on testing code and improving it, providing comprehensive test cases and suggestions for better code practices.
  • ๐Ÿ† Among the AI coding tools discussed, GitHub Copilot, Chat GPT, and Codium AI stand out as part of an effective AI developer suite for improving coding efficiency and quality.

Q & A

  • What is the core functionality of Tab N?

    -Tab N is an AI-powered coding assistant that provides autocomplete code suggestions within an IDE, such as VS Code, and includes a chat feature for asking programming-related questions.

  • How does the AI chat feature of Tab N handle questions about code complexity?

    -The AI chat feature can correctly identify the time complexity of certain functions, such as factorial, as O(n). However, it may sometimes provide incorrect information, such as mistakenly stating that the time complexity is of N squared.

  • What issue did the user encounter with the factorial function provided by Tab N?

    -The factorial function provided by Tab N had an incorrect base case condition, which did not handle negative inputs properly. The correct base case should be when n is less than or equal to zero.

  • How does GitHub Copilot handle autocomplete for the factorial function?

    -GitHub Copilot can autocomplete the factorial function correctly, providing a functional code snippet that includes handling for negative numbers by returning 'not a number' if the input is less than zero.

  • What are the advantages of using Chat GPT as a coding tool?

    -Chat GPT is useful for learning and provides a lot of extra context, making it great for educational purposes. However, it may not be the best option for practical coding tasks due to the potential for context switching and the occasional provision of incorrect information without sourcing.

  • What is Bard, and how does it compare to Chat GPT?

    -Bard is another AI coding tool that, like Chat GPT, provides autocomplete and chat features. It cites sources for information, which can be helpful for further reading and verification. However, it may be slightly less accurate than Chat GPT in some cases.

  • How does Amazon CodeWhisper differ from GitHub Copilot?

    -Amazon CodeWhisper is Amazon's version of an AI coding assistant, similar to GitHub Copilot, but it lacks a chat feature. It provides code autocompletion but may not perform as well as Copilot in certain tasks, such as generating test cases.

  • What is Sourcegraph Cody's unique feature compared to other AI coding tools?

    -Sourcegraph Cody claims to understand the entire code repository and make suggestions based on it. However, in practice, it may struggle to integrate effectively with large codebases and provide accurate repository-specific insights.

  • What are the strengths of Codium AI as a coding tool?

    -Codium AI excels at generating comprehensive test suites and providing detailed code explanations and suggestions for improvement. It focuses on testing and enhancing code quality rather than trying to autocomplete every function.

  • Which AI coding tools did the user decide to continue using?

    -The user decided to continue using Chat GPT, Codium AI, and GitHub Copilot as their AI developer suite, as these tools best fit their needs for learning, efficient coding, and thorough testing.

Outlines

00:00

๐Ÿ’ป Introduction to AI Coding Tools

The paragraph introduces various AI coding tools such as TabNine, ChatGPT, and GitHub Copilot. It discusses the functionality of these tools, like code autocompletion and AI chat features, and provides a hands-on demonstration of their capabilities and limitations. The speaker evaluates the time complexity explanation and error handling of the AI-generated code, highlighting the pros and cons of each tool.

05:00

๐Ÿค– ChatGPT as a Coding Tool

This section focuses on ChatGPT as a coding tool, emphasizing its strengths in providing contextual learning and conversational assistance. However, it also points out the drawbacks, such as the potential for context switching and the delivery of incorrect information without sourcing. The speaker assigns ChatGPT to the 'actually useful' tier but notes that there are better options for certain tasks.

10:01

๐Ÿš€ GitHub Copilot's Advanced Features

GitHub Copilot is highlighted for its AI chat and autocompletion capabilities, similar to ChatGPT, with an added focus on its ability to handle negative numbers in code. The tool's efficiency in generating comments and test cases is praised, especially its use of a testing framework for a more exhaustive approach. The speaker rates GitHub Copilot highly, placing it in the 10x developer category.

15:01

๐Ÿง Comparing Bard and Amazon CodeWhisper

The paragraph compares Bard and Amazon CodeWhisper to ChatGPT. Bard is noted for sourcing information, which adds credibility, but it is also seen as less accurate in some cases. Amazon CodeWhisper, while similar to GitHub Copilot, is considered less effective overall, especially without its unique AWS-specific features. The speaker places both tools in the 'acceptable' category.

20:01

๐Ÿ” Sourcegraph CodeIt's Repository Understanding

Sourcegraph CodeIt is discussed for its unique feature of understanding the entire code repository to make suggestions. However, the speaker finds it slow and not very effective in integrating with the repository, despite its potential to improve code with suggestions like loop usage and error handling. The tool is placed in the 'acceptable' category due to its current limitations.

๐Ÿ“ˆ Codium AI's Focus on Testing

Codium AI is praised for its specialization in testing and improving code, with a strong emphasis on generating comprehensive test suites and providing detailed code explanations and suggestions. The tool excels in identifying areas for improvement and potential errors in the code, making it a valuable addition to the developer's toolkit. The speaker places Codium AI in the top tier for its effectiveness in its niche.

Mindmap

Keywords

๐Ÿ’กGitHub Copilot

GitHub Copilot is an AI-powered coding assistant that autocompletes code and provides suggestions as you type. In the video, it is compared with other AI coding tools and is noted for its ability to handle complex coding tasks efficiently, making it a top choice for the narrator.

๐Ÿ’กAI Chat

AI Chat refers to the feature in some AI coding tools that allows users to ask questions or request specific actions through a chat interface. In the context of the video, AI chat is used to inquire about code functionality, time complexity, and to request improvements or explanations.

๐Ÿ’กTime Complexity

Time complexity is a measure of the amount of time an algorithm takes to run as a function of the size of the input. It's a crucial concept in computer science, helping developers understand and optimize the efficiency of their code. In the video, the time complexity of the factorial function is discussed, with the AI tools providing varying levels of accuracy in their explanations.

๐Ÿ’กCode Autocompletion

Code autocompletion is a feature that predicts the intended code snippet based on the user's partially written code and provides suggestions to complete the code. It's designed to speed up the coding process and reduce the number of keystrokes required. The video compares the autocompletion capabilities of different AI coding tools.

๐Ÿ’กCode Testing

Code testing involves creating and running tests to ensure that a piece of code functions correctly and meets its intended requirements. It's a critical part of software development that helps identify bugs and edge cases. In the video, the AI tools are evaluated based on their ability to generate test cases for the code.

๐Ÿ’กCode Suggestions

Code suggestions are recommendations provided by AI coding tools to improve the quality, efficiency, or correctness of the code being written. These suggestions can range from refactoring to using more appropriate algorithms or data structures.

๐Ÿ’กCode Analysis

Code analysis is the process of examining the source code of a computer program to determine its functionality, structure, and potential errors. AI tools can perform code analysis to provide insights into the code's behavior, potential improvements, and to suggest best practices.

๐Ÿ’กAI Coding Tools

AI coding tools are software applications that utilize artificial intelligence to assist developers in various aspects of coding, such as autocompletion, error detection, code optimization, and generating test cases. The video reviews and compares multiple AI coding tools based on their features and effectiveness.

๐Ÿ’กCode Commenting

Code commenting is the practice of adding explanations or notes within the source code to make it understandable for others or for future reference. It's an essential part of code documentation that helps maintain the code and aids in collaboration among developers.

๐Ÿ’กError Handling

Error handling is a programming technique that involves writing code to handle exceptions or unexpected conditions in a way that allows the program to continue running or provides useful feedback to the user or developer. It's crucial for creating robust and reliable software.

๐Ÿ’กCode Efficiency

Code efficiency refers to how well a piece of code performs its intended task with minimal use of resources like memory and processing time. Writing efficient code is important for optimizing the performance of software and ensuring it runs smoothly even with large inputs.

Highlights

Tabnine is an AI-powered code completion tool similar to GitHub Copilot.

Tabnine can autocomplete code and provide explanations for functions, but sometimes provides incorrect information.

Chat GPT is a versatile tool that can provide a lot of context and hold conversations, but may not be the best for coding tasks due to context switching.

GitHub Copilot offers an AI chat feature and can handle negative inputs in code by suggesting improvements.

GitHub Copilot provides a more exhaustive test case generation compared to Tabnine.

Bard, like Chat GPT, provides source citations but may be slightly less accurate in its responses.

Amazon CodeWhisper is Amazon's version of code completion but lacks a chat feature and may perform worse than GitHub Copilot.

Sourcegraph Code is designed to understand entire code repositories and make suggestions, but currently has limitations in its implementation.

Codium AI focuses on testing code and improving it, rather than trying to be an all-in-one code completion tool.

Codium AI generates test suites and provides detailed code explanations and suggestions.

Codium AI suggests code improvements such as checking for positive integers and handling edge cases.

Codium AI's test case generation can identify errors in code that the developer might have missed.

The reviewer plans to use Chat GPT, Codium AI, and GitHub Copilot as their AI developer suite for efficiency and learning.

Transcripts

play00:00

okay so first up we have tab n which is

play00:01

sort of like GitHub co-pilot if you've

play00:03

used that if you haven't I'll be looking

play00:05

at it in a minute but the core idea is

play00:07

that within vs code or whatever IDE you

play00:09

use it can autocomplete code as you're

play00:11

writing it and we get this AI chat

play00:14

feature as well so let's say function

play00:16

and we can see it tries to autocomplete

play00:17

the function and let's say we want a

play00:19

factorial function which it will

play00:20

autocomplete and there we have it we

play00:22

have a factorial function that I didn't

play00:24

even have to write I wish this was on

play00:26

multiple lines but that's nitpicky it is

play00:28

a correct function and let's try the

play00:31

chat feature as well so let's say what

play00:33

is the time complexity of factorial okay

play00:36

so it says the time complexity of

play00:38

factorial is o n where n is the number

play00:39

of iterations which is correct but then

play00:41

at the end here it says the time

play00:43

complexity is therefore of N squared

play00:45

which is incorrect so it was correct and

play00:47

then it sort of lost the thread a little

play00:49

bit and said in squared and it was

play00:50

incorrect so close but this is not

play00:53

correct information but okay let's try

play00:54

to break this code a little bit and see

play00:56

if it's able to fix it so I'm going to

play00:58

make this equals instead of less than or

play01:00

equals and see if it realizes that this

play01:02

is not going to work for a negative

play01:03

input anymore so let's say the code for

play01:07

factorial is incorrect how can I fix it

play01:11

let's see if it's able to figure this

play01:13

out okay so it says the code for the

play01:14

factorial function is incorrect because

play01:16

the condition for the base case is

play01:17

incorrect the correct condition is if n

play01:20

is equal to 1 so that's the condition I

play01:22

have so it's correct that the base case

play01:23

was wrong but it didn't do a good job of

play01:26

actually telling me why it was wrong

play01:27

let's look at the other response it has

play01:29

and and okay so this one the response

play01:31

number two is actually correct it should

play01:33

be n is less than or equal to one

play01:35

instead of n equals 1 so I'll give it

play01:37

sort of partial credit for that out of

play01:39

curiosity this first one it doesn't look

play01:40

like I have multiple responses here but

play01:42

this one at least it gave me a second

play01:44

response and the second response was

play01:45

correct okay so now I want to try some

play01:47

of the other command options we have so

play01:49

let's say just explain the code and

play01:50

let's see what we get for an explanation

play01:52

of this code okay so I'm not going to

play01:54

read all of this but this is a correct

play01:56

explanation of how a factorial function

play01:58

works so good job on Tab 9 there okay so

play02:00

now I'm curious if it can write some

play02:01

comments for me so I'm going to come up

play02:03

here and try to write a JS St style

play02:05

comment and let's see if it's able to

play02:07

autoc complete this I'll remove this

play02:09

thing that was added by vs code okay so

play02:11

it's autoc completing something we have

play02:12

a parameter of n that is correct we do

play02:15

return a number okay and now we're sort

play02:18

of going off the rails a bit we have API

play02:20

private and we're just sort of adding

play02:23

random stuff now it was close it started

play02:25

getting it right and then it was sort of

play02:27

going off the rails a little bit but

play02:28

what if I just add a blank comment like

play02:30

this it just says factorial function

play02:32

that's not particularly useful I know

play02:34

that by just the name of the function

play02:36

it' be better to tell me things like

play02:38

what inputs it takes and what it returns

play02:39

all right so now what I want to do is

play02:40

see if it can generate some test cases

play02:42

for me so let's come down here and just

play02:44

say test cases and see what it generates

play02:47

below us okay so it generated a bunch of

play02:49

test cases factorial 5 120 0 1 2 3 4 and

play02:53

if I run this that is exactly what I get

play02:55

so these test cases are correct I'm

play02:57

curious also there was a test cases

play02:59

command here here so let's do that as

play03:01

well and see what we get so generate

play03:03

test for code and let's see what it does

play03:05

with that okay so it does basically the

play03:07

same thing and we got a few more test

play03:09

cases now what about a slightly more

play03:11

complicated function so let's say

play03:12

function let's do merge sort okay so it

play03:15

knows it takes in an array okay so it

play03:17

does seem to be a merge sort function

play03:19

but it just added this merge function

play03:21

and didn't actually give that to me so

play03:23

let's see if we can get it to add that

play03:25

as well so function merge it seems to

play03:27

know that that's what it needs to add

play03:29

okay so it seems to have added the

play03:31

function and let's add a test case as

play03:32

well so let's say merge sort test cases

play03:36

and let's see if it adds some of those

play03:38

all right so merge sort the first one is

play03:40

just already sorted the second one is in

play03:41

backwards order and it looks like it did

play03:43

sort those correctly and let's see if we

play03:45

can add some more test cases all right

play03:47

so that one just said merge sort of one

play03:49

and it didn't really give me full test

play03:51

case oh wait it started doing it and now

play03:53

we just have basically the same test

play03:54

case again I would like to see it just

play03:56

generate more random test cases let's

play03:58

see if we use the command and instead

play04:00

generate test for code all right so it

play04:02

did generate a few more merge sort test

play04:05

cases but these are basically the exact

play04:06

same so we have 3 2 1 10 n down to zero

play04:09

and then all ones but I'd like to see

play04:11

something with just like random numbers

play04:13

and random orders but regardless it was

play04:15

pretty close and definitely still

play04:16

helpful okay so tab 9 works but there's

play04:18

better options that we'll see later in

play04:20

the video so I'm going to put it in the

play04:21

decent tier for now and by the way in

play04:23

this video we'll be building up this

play04:24

tier list of all of these different AI

play04:26

coding tools all the way from the 10x

play04:28

developer tools down to the artificially

play04:30

unintelligent okay so next we have chat

play04:32

GPT but I'm not going to spend too much

play04:34

time on this because I'm sure you've all

play04:35

used it at this point and I've made a

play04:37

lot of videos on it but here's my

play04:38

thoughts on chat GPT as a coding tool as

play04:41

it stands right now so I do think it's

play04:42

an amazing tool and a lot of the other

play04:44

ones on this list actually use the GPT

play04:47

API but that said I don't think for most

play04:50

coding tasks that it's actually the best

play04:52

option it's great if you're trying to

play04:53

learn something because it gives you so

play04:55

much extra context and it's great at

play04:56

holding a conversation however if you

play04:59

are just just trying to work through

play05:00

some problem going back and forth

play05:02

between your code editor and chat GPT

play05:04

just adds a lot of context switching

play05:06

which I think can be a bit of a problem

play05:08

and this can still work but why do this

play05:10

when there's other options on this list

play05:12

that work just as well without the extra

play05:14

context switching and the other thing I

play05:15

don't like about it is that it doesn't

play05:16

really site any sources and it just

play05:19

confidently tells you incorrect

play05:20

information sometimes which of course

play05:22

isn't a great thing so on occasion you

play05:24

just get bad information and you don't

play05:26

know it's bad because it's not citing

play05:27

sources and it's so confident in the

play05:29

information it's giving you that said of

play05:31

course chat GPT is useful so I'm going

play05:32

to put it in the actually useful tier

play05:35

but there are still ones that are going

play05:36

to be going above it next have GitHub

play05:38

co-pilot so it's going to have an AI

play05:39

chat similar to chat GPT we can also do

play05:42

command I to ask questions in line or we

play05:45

can just use autoc completion similar to

play05:47

what we had in tab 9 so we can say

play05:49

function factorial once again and it's

play05:52

going to complete the function

play05:53

interestingly it changed the name to

play05:55

factorial Li but I guess that's fine and

play05:57

we say if the number is zero return one

play06:00

otherwise return num * factorial num

play06:03

minus one and this will work but it's

play06:04

not going to work for negative numbers

play06:06

so let's see if it actually able to fix

play06:08

that so I'm going to come here and

play06:09

simply say handle negative numbers and

play06:13

let's see what it does to fix this nice

play06:16

so it gives me sort of a diff here where

play06:17

it added this if number is less than

play06:20

zero return not a number which seems

play06:23

like a totally reasonable way to do this

play06:25

I think I would have preferred it just

play06:26

throw an error but I think this works as

play06:28

well all right now come over here and

play06:30

let's just ask it what is the time

play06:32

complexity of this code and let's see if

play06:35

it's able to answer that question all

play06:37

right so it says the time complexity is

play06:38

o in which is completely correct let's

play06:40

see if it's able to add a comment up

play06:43

here we tried to do this last time and

play06:45

it didn't really work so it wants to add

play06:47

something that's like challenge let's do

play06:49

JS do style and see if it figures out

play06:51

that that's what I want factorial lie a

play06:54

number okay so it's just kind of adding

play06:57

comments like that but let's see because

play06:58

we do have the option here to do the

play07:00

sort of inline command ey thing so let's

play07:02

say JS doc comment and let's see if it

play07:05

can just add that in for me so it was

play07:07

able to generate this JS do comment with

play07:10

the parameter and the return so if you

play07:12

did want to use some commenting syntax

play07:13

like JS do it seems to do a pretty good

play07:15

job of that all right so now what I want

play07:17

is some test cases so let's see we have

play07:18

some commands here as well so we can

play07:20

explain the code let's actually do that

play07:21

first and then we can after we explain

play07:24

the code do the test cases you can pause

play07:26

and read the whole thing if you want but

play07:27

this is a great explanation of how the

play07:29

factorial function actually works so now

play07:31

let's see if we can generate some test

play07:33

cases so let's go to/ tests and see what

play07:36

it generates for us awesome so it

play07:38

actually generated an entire file for

play07:41

test and it uses the just testing

play07:43

framework so whereas tab9 was just sort

play07:46

of adding some console logs this used an

play07:48

entire testing framework and created an

play07:50

entire test suite and these tests look

play07:52

pretty exhaustive they include negative

play07:54

numbers which is good and I like how we

play07:56

have a few options here so we can copy

play07:58

the code we can insert the code into

play08:00

this file or we can insert this into a

play08:02

brand new file so it's going to create

play08:05

this testing file for us which is super

play08:07

cool all right so now coming back to the

play08:08

main file let's try to do the same merge

play08:10

sort function again so let's say

play08:12

function merge sort and see if it's able

play08:15

to autocomplete this for us okay so it

play08:17

takes in an array and it did the same

play08:19

thing that tab 9 did where it added this

play08:21

merge function but didn't actually

play08:22

implement it for us so let's see if it

play08:24

figures out on its own okay so it does

play08:25

figure out that we need the merge

play08:27

function just like tab 9 did let's see

play08:29

if it's able to implement that function

play08:31

it is now let's see can we just get test

play08:34

cases for merge sort all right so it

play08:37

generated test cases so let's just

play08:39

accept this and interestingly it

play08:41

actually put it in a new file for us I

play08:45

probably had an option not to do that

play08:46

but I'm just going to copy this into the

play08:48

same file it's also interesting that

play08:49

this one just generated it with console

play08:51

logs whereas when I did it over here in

play08:53

the chat function it actually used just

play08:55

although I'm sure if I specified which I

play08:57

wanted it would have done that for me

play08:59

but we can run this and yeah these

play09:00

sorting seems to be working and these

play09:02

are pretty good test cases much better

play09:03

test cases than we got from tab n

play09:05

because they're just more exhaustive for

play09:07

example we have arrays with duplicate

play09:08

elements and elements in different

play09:09

orders instead of just having like 0

play09:11

through 10 and 10 through zero so yeah

play09:13

I'm a huge fan of copilot I've been

play09:15

playing with this all day long and it's

play09:17

working absolutely incredibly I've been

play09:18

trying to find some examples to give you

play09:20

all where it's not working very well and

play09:22

I just haven't been able to find many I

play09:24

do wish sometimes it would give a little

play09:25

bit more context with its sensors I

play09:27

think chat GPT on its own does a bit of

play09:28

a better job with this but overall

play09:30

co-pilot is incredible as a tool for

play09:33

actually writing code more efficiently I

play09:35

think chat GPT is where it go to

play09:37

actually learn something and co-pilot to

play09:39

just code more efficiently so this is

play09:41

going all the way at the top in the 10x

play09:43

developer category all right so next we

play09:45

have Bard and I'm not going to waste a

play09:46

ton of time on Bard just like chat GPT

play09:48

because I'm sure you get the idea of how

play09:49

it works but here's my thoughts on Bard

play09:52

and Bard specifically compared to chat

play09:54

GPT so I spent a few hours giving the

play09:56

exact same prompts to Bard and chat GPT

play09:58

today and honestly I was pretty

play10:00

surprised that in most cases Bard gave

play10:03

basically the exact same answer that

play10:05

said there were some pros and some cons

play10:08

so the big Pro I saw with Bard is that

play10:10

it does actually site some sources which

play10:12

is a great way to get some further

play10:14

reading and just to know that the

play10:15

information it's giving you is correct

play10:17

but on the negative side it does seem to

play10:19

just be a little bit less accurate than

play10:22

chat GPT for example I asked both of

play10:23

them to generate a tic tac toe game

play10:25

using react and chat gpt's game worked

play10:28

perfectly and B's code was close but it

play10:30

didn't fully work it didn't change which

play10:32

player it was and it wasn't correct at

play10:33

figuring out who the actual winner of

play10:35

the game was so I'm going to put Bard in

play10:37

the actually useful category with chat

play10:39

GPT although it's definitely in my mind

play10:42

a notch below chat GPT within that same

play10:44

category I don't think there's any

play10:46

problem with using it but personally I

play10:47

would just use GPT instead of Bard okay

play10:50

so next we have Amazon code whisper

play10:51

which is sort of Amazon's version of

play10:53

co-pilot although it doesn't have a chat

play10:55

feature this time but let's try it out

play10:56

so let's say function and again the

play10:59

factorial function you can take any

play11:01

number it's not autoc completing this

play11:02

part yet but let's see does it

play11:04

autocomplete now okay so it does and we

play11:06

have if number is less than or equal to

play11:08

one return one otherwise return num time

play11:11

factorial num minus one it added a weird

play11:13

blank line at the end here but I'll

play11:15

delete that and this is correct and now

play11:17

let's see if we can get it to generate

play11:19

some test cases so let's say test cases

play11:22

and let's see if it generates anything

play11:24

okay so factorial of zero is one and

play11:26

then let's see do we get more factorial

play11:28

of one

play11:29

do we keep getting them factorial 5 I

play11:31

don't like that it's doing one line at a

play11:32

time but this is working and we can run

play11:35

this and this is all correct but so now

play11:37

let's do the same tests we did with the

play11:38

others and try merge sort so we can say

play11:41

function merge sort let's see if it's

play11:43

able to automatically do this for us so

play11:47

let's see if it's going to complete the

play11:48

function okay there it goes and again it

play11:51

added a blank line at the end which is

play11:52

odd and it did the same merge thing

play11:54

where it doesn't give us the merge

play11:56

function but that seems to be a

play11:57

recurring theme and this one though is

play11:59

not automatically knowing that now it's

play12:01

time for the merge function but let's

play12:02

try doing function merge left and right

play12:06

and there it goes okay so it added the

play12:08

rest of the merge function for merge

play12:11

sort and I don't know where that came

play12:13

from I might have typed that though now

play12:14

let's see if we can also get some test

play12:16

cases so test cases for merge sort let's

play12:21

see what it generates nice so this one

play12:23

actually generated a bunch of different

play12:25

test cases although again these are

play12:27

already sorted for the most part so

play12:29

great test cases but at least it was

play12:30

able to generate some and I'm curious

play12:32

again to see if this can write comments

play12:34

for me but I'm guessing it can't because

play12:35

I don't really have a great way to

play12:36

actually interface with it to tell it

play12:38

that that's what I want but I'm going to

play12:39

try once again to put the beginnings of

play12:42

a js. comment and see what it

play12:44

autocompletes to if it autocompletes

play12:46

anything at all which doesn't seem like

play12:48

it's doing anything so that's a no on a

play12:51

j. comment what about just a standard

play12:53

comment all right so that doesn't seem

play12:55

like it's going to generate so I'm going

play12:56

to do option C so I manually generate it

play12:59

write a function that takes in a number

play13:00

and returns its factorial so this is

play13:02

like a prompt for a question on a quiz

play13:04

rather than an actual comment so that's

play13:06

a bit strange as well although I did

play13:08

want to show one cool feature of code

play13:10

whisper which is that it has this

play13:12

reference log where it actually gives

play13:13

you an idea of where the code came from

play13:16

so for example it actually says that

play13:18

this was from a reference from this code

play13:21

Wars repository which is kind of cool to

play13:23

be able to see that and then to make

play13:25

sure that the code that's being used

play13:27

doesn't have some license that you can't

play13:29

actually use it so overall code whisper

play13:31

is fine but its only feature is

play13:33

basically just one of the co-pilot

play13:35

features and it seems to do it worse

play13:37

than co-pilot does it might be better if

play13:39

you're specifically using AWS features

play13:41

and it might be really good at autocom

play13:43

completing for those AWS specific

play13:45

features but other than that for just

play13:47

like General coding I don't think it's

play13:49

all that great so I'm going to put it in

play13:50

the acceptable category all right so

play13:52

next we have Source graph Cody which is

play13:54

pretty interesting so it's similar to

play13:55

tab9 and co-pilot and all of these it's

play13:58

got an AI chat and the ability to

play13:59

autocomplete code but what it also

play14:01

claims to be able to do is understand

play14:03

your code repository and to make

play14:05

suggestions based on the entire

play14:07

repository so we'll see how that works

play14:08

in a minute but first let's give it some

play14:10

of these same tests so let's add a

play14:12

factorial function okay so it knows it

play14:14

takes in a number and it autocom

play14:16

completed the whole function so if n is

play14:18

one return one otherwise return n *

play14:20

factorial of n minus one so this is

play14:23

correct again although this is not going

play14:25

to work for the case of zero or a

play14:28

negative number so let's see if we can

play14:30

actually just get it to fix this so we

play14:32

can add an inline question so let's say

play14:34

can you improve this function so I'll

play14:38

give it this open-ended question to see

play14:39

how it does and if it doesn't answer it

play14:41

I'll give it a more direct question to

play14:43

fix the cases it's not handling okay so

play14:46

it says here's a few ways the function

play14:47

can be improved use a loop instead of

play14:49

recursion to avoid call stack limits on

play14:51

large inputs okay that's not what I was

play14:53

looking for but that is a good way to

play14:55

improve the function and then we have

play14:56

use big int to allow for larg inputs I

play14:59

don't know that we need that but decent

play15:01

suggestion I guess use memorization so

play15:03

another actually good suggestion to

play15:05

improve the function and simplify the

play15:08

conditional logic I don't really like

play15:09

this I don't think this is simpler I

play15:10

think it's just less lines but none of

play15:13

these are actually getting at exactly

play15:16

what we want so let me get rid of this

play15:19

and let's

play15:22

say how do I add another question in

play15:25

here do I close this I guess kind of a

play15:28

conf using UI okay so let's say make

play15:31

this handle inputs less than one ask

play15:36

Cody okay so here's how you can handle

play15:39

inputs less than one and it added this

play15:41

check if n is less than one return one

play15:43

so this kind of handles what I asked it

play15:45

to do but this is just redundant because

play15:47

you don't need all of this it can just

play15:49

be if n is less than or equal to one and

play15:51

also if n is less than zero we probably

play15:55

don't want to be returning one we should

play15:56

be throwing an error or returning in a

play15:58

in but some of the other ones did that

play16:01

as well so not horrible but not a great

play16:03

suggestion either but now let's see if

play16:06

it can actually add a comment so let's

play16:09

start by doing the test to see if it

play16:10

just autocompletes the comment for me

play16:12

which has not worked on any of them but

play16:14

we'll see if it works so parameter Good

play16:17

Start return

play16:20

number and we're sort of lost there so

play16:23

sort of started doing a good comment

play16:24

what if we just do the standard comment

play16:26

syntax factorial. Js so not a very good

play16:29

comment there either but now let's try

play16:31

to do JS doc comment like this ask Cody

play16:36

okay so that took a very long time to

play16:38

actually come back and it wasn't able to

play16:40

actually do it it explained what a js.

play16:42

comment is but it wasn't able to

play16:43

actually add it in for me but okay let's

play16:46

come over to Cody chat now and let's say

play16:48

let's see what we can get with the

play16:49

forward slash let's do some generate

play16:51

unit tests and see if it can generate

play16:53

some good test cases for us awesome so

play16:55

I'm going to expand this a bit and it

play16:57

generated some just tests for us so I

play16:59

like that it used an actual testing

play17:01

framework and we have some reasonable

play17:02

tests interestingly it does know to

play17:05

throw an error on a negative in but it

play17:06

didn't actually do that in the function

play17:08

which is kind of funny so this test

play17:09

would actually fail but I guess that's

play17:11

actually good because that means it's

play17:12

going to catch its own air all right but

play17:14

now what I want to do is test this

play17:15

ability to understand the entire

play17:17

codebase so I'm actually in the codebase

play17:19

for a video you might have seen on this

play17:21

channel a few months back where I had

play17:22

some Fiverr developers build this sort

play17:25

of task management application so this

play17:27

is a task management application and

play17:29

what I'm going to do is ask Cody about

play17:31

it so first of all let's say

play17:35

can you show me the logic for saving a

play17:41

task so if I'm new to this codebase I

play17:42

might want to see where exactly is that

play17:44

logic for saving a task so let's see if

play17:46

it's able to actually find it within the

play17:48

code base okay so it says it read eight

play17:50

files and it wasn't able to figure it

play17:51

out so let's see what file was it

play17:53

actually read so all it read was this

play17:55

file I have opened which I'm probably

play17:57

not helping it by having that open and

play17:58

then a bunch of node modules files so it

play18:00

didn't even really look to any of the

play18:02

actual codebase but let's close this

play18:04

file to give it the benefit of the doubt

play18:07

and maybe go into something near the

play18:10

tasks let's actually even go into I

play18:12

think it's this task section that

play18:14

actually has that logic yeah so this is

play18:16

the one that actually has the saving

play18:18

task logic in it so now let's ask the

play18:21

same question but it will give it a

play18:22

little bit more context so let's say

play18:24

this is a task management react

play18:29

application

play18:30

find the logic that saves a task on

play18:37

the server okay so let's see what we got

play18:40

back so first of all what files did it

play18:42

even read so again it just sort of

play18:44

looked through the node modules and then

play18:46

it looked at this file that I've opened

play18:48

and one other file so this whole idea of

play18:50

it just looking through the node modules

play18:51

is not very useful but okay let's see

play18:54

what exactly it shows so we have used

play18:56

dispatch and save task from actions and

play19:00

handle safe task dispatch safe task so

play19:02

is there any way to actually find this

play19:04

in the codes let's see this is going to

play19:07

copy it this is going to insert it and

play19:09

this is going to save it in a new file

play19:11

so I don't see any way to actually find

play19:13

this but let me see if I can find this

play19:15

in here if this is actually the correct

play19:18

code yeah so as far as I can tell the

play19:20

code that it gave me back is not

play19:21

actually code from the repo so this is

play19:23

the actual save task function which

play19:26

looks nothing like this so

play19:28

it really wasn't able to actually find

play19:30

that and provide me any useful

play19:32

information on how saving a task Works

play19:34

in this repository okay so my thoughts

play19:35

on Source graph Cody first of all it's

play19:38

just sort of slow probably because it's

play19:40

having to parse all of these files and

play19:42

it doesn't even really do a good job at

play19:44

the thing it says it's made to do of

play19:46

actually parsing files it was mostly

play19:47

just looking through the node modules

play19:49

and even when I sort of spoonfed it the

play19:51

right file to look at it still wasn't

play19:53

able to find the logic that had

play19:55

basically the exact same function name

play19:57

as what I asked it to find so it didn't

play19:59

do a great job of actually integrating

play20:01

with the repository at all from what I

play20:03

could tell so this is a cool idea and I

play20:04

like that they're trying to do something

play20:06

different and this has been one of my

play20:07

main complaints about AI coding

play20:09

assistants is like they work in these

play20:11

small projects but the second you go

play20:12

work at Google and there's two million

play20:15

files with aund lines of code in each of

play20:17

them they're just not that useful

play20:19

anymore and this is trying to solve that

play20:21

but it just doesn't seem to actually be

play20:23

solving it in a very good way that said

play20:25

the code Auto completion was decent and

play20:27

the AI chatbot was also for the most

play20:29

part decent as well so I do hope they

play20:31

continue working on this and maybe one

play20:33

day we'll be at the point where it truly

play20:35

understands your code repository but I

play20:37

don't think it's there just yet so I'm

play20:39

going to put it in the acceptable

play20:40

category okay so next we have codium ai

play20:42

which is really cool because it's not

play20:44

trying to do what all of the other AI

play20:46

tools are doing so it's not trying to be

play20:48

a Do-it all code completion tool instead

play20:51

it's just very very good at testing your

play20:53

code and helping you improve your code

play20:54

so I'm going to test this factorial

play20:57

function we have and see what it's able

play20:59

to come up with okay so first of all it

play21:01

generated a test suite for us so we can

play21:03

see the configuration it's using just

play21:05

and we could actually change the testing

play21:07

framework if we want we can see the

play21:09

behaviors that it actually covers so we

play21:11

have like the Happy path the edge cases

play21:13

as well as some other behaviors and we

play21:15

can see each individual test case and we

play21:17

can actually ask it to change any of

play21:19

these or to run it to make sure they're

play21:20

actually working and we can actually see

play21:22

it's handling some things that my code

play21:25

doesn't handle so these test cases would

play21:27

actually find errors in my code which is

play21:29

amazing so for example it knows we need

play21:31

to throw an error if we get a decimal as

play21:33

an input but I will say it's not perfect

play21:35

either so for example here it says we

play21:37

should return one for a non-numeric

play21:39

input value but I think here we should

play21:41

probably be throwing an error so let's

play21:43

say instead of returning one make these

play21:48

throw an error so let's say that this is

play21:50

not a test case we like this is not the

play21:53

expected value we actually have and okay

play21:55

now it says it is expecting to throw an

play21:57

air so let's go to the code explanation

play22:00

as well okay so we have code analysis

play22:02

the inputs and the flow of the code as

play22:04

well as the output okay and we also have

play22:06

some example usage this is awesome this

play22:08

code explanation is amazing this looks

play22:11

like professionally written

play22:12

documentation so that is great and then

play22:14

code suggestion and actually I'm just

play22:16

going to hide the chat because it

play22:17

basically does the same thing in this

play22:19

case so here we have our suggestions so

play22:22

first the code should check if num is a

play22:24

positive number if not it should throw

play22:25

an error so let's select this and say we

play22:27

want to do that and let's see what else

play22:30

we have the code uses recursion to

play22:32

calculate factorial instead it should

play22:33

use a loop to avoid potential stack

play22:35

Overflow errors also a good suggestion

play22:38

it depends on your exact use case but I

play22:40

do think in most cases for factorial

play22:42

even though it's a sort of example we

play22:44

use for recursion a lot it actually

play22:46

makes more sense to just do it

play22:47

iteratively because you won't have that

play22:49

stack Overflow so let's select this as

play22:51

well the code should check if number is

play22:53

larger than 170 if so it should return

play22:56

Infinity because JavaScript cannot

play22:58

accurately represent larger numbers than

play23:00

170 factorial so I don't know if 170

play23:02

factorial is exactly the cut off but

play23:04

that's a very interesting point so let's

play23:06

say we want to do that as well and

play23:08

somebody down in the comments can let me

play23:10

know if 170 is actually the cut off of

play23:12

the max number in JavaScript or not but

play23:14

anyways next we have the code should

play23:16

check if num is zero if so it should

play23:18

return one as zero factorial is one so

play23:21

the current code actually does handle

play23:23

this but maybe with the other edits it

play23:24

wouldn't so let's select this and say we

play23:26

want to do that as well the code should

play23:28

check if num is in a in if so it should

play23:29

throw an err that also seems reasonable

play23:32

okay so let's prepare these code changes

play23:34

and see what it says to change awesome

play23:36

so it seems to have done all of that so

play23:37

let's apply this to the code and see

play23:39

what exactly we get here so now we have

play23:41

if the type of number is not number or

play23:44

number is less than zero or number is

play23:46

not an integer we are going to say input

play23:49

must be a positive integer so that's

play23:51

good except for this error message isn't

play23:53

perfect because it can also be zero

play23:55

which I don't think is considered a

play23:57

positive integer just an integer but

play23:59

maybe it is I don't know is zero

play24:00

positive I'm not sure then we have if

play24:02

number is greater than 170 return

play24:04

Infinity if number is zero return one

play24:06

and then we have the iterative code here

play24:08

as well so yeah honestly this is the

play24:10

best test generator I've seen its

play24:12

explanations are really good and it

play24:14

doesn't try to do more than it's capable

play24:15

of it doesn't claim to be able to

play24:17

autocomplete every function you ever

play24:19

write because it's just not made to do

play24:21

that it's made to improve your code and

play24:23

to write good test cases which it does a

play24:24

great job of doing so because of that

play24:26

it's going in the top tier at 10x

play24:28

developer now all of these tools have

play24:30

their own place and all of them are

play24:31

probably valuable to certain people but

play24:33

in my case I'm going to continue using

play24:35

chat GPT as well as codium Ai and GitHub

play24:38

co-pilot that's going to sort of be my

play24:39

AI developer suite and hopefully it will

play24:42

make me a better developer but if you

play24:43

want to be a better developer you should

play24:45

watch this video next that the YouTube

play24:47

algorithm thinks will'll enjoy and let

play24:48

me know if it's right

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
AI CodingDevelopment ToolsGitHub CopilotChatGPTCode AutocompletionCode TestingAI ChatbotsProgramming EfficiencyCode WhispersSourcegraph CodyCodium AI