Using AI to help me with C++

  Рет қаралды 111,548

The Cherno

The Cherno

Күн бұрын

Пікірлер: 517
@TheCherno
@TheCherno Жыл бұрын
Thank you for watching! You’ll be amazed at what you can do with GrammarlyGO. Sign up at grammarly.com/cherno and get 20% off Grammarly Premium.
@pietropaolofrisoni4575
@pietropaolofrisoni4575 Жыл бұрын
Fun fact: I clicked on this video right before I paid for Grammarly premium (I just finished my week of free trial). This video will save me 20%., Thanks, man!
@LucidSurreal
@LucidSurreal Жыл бұрын
it's worth the $20 for the super-speed with gpt-3 and to be able to use gpt-4, which is significantly smarter for more complex tasks.
@wjrasmussen666
@wjrasmussen666 Жыл бұрын
Wish you would have posted the exact prompts in order that you used them.
@carkawalakhatulistiwa
@carkawalakhatulistiwa Жыл бұрын
all repetitive work using computers can be automated within 2 years by ai.😮 Is like 50% work in bank 😂
@TheExileFox
@TheExileFox Жыл бұрын
I know you really like Dear Imgui but you should do a video on Nuklear which is a different but similar option.
@Rudy_YT
@Rudy_YT Жыл бұрын
The DynamicArray class actually has a bug in it. It initialized capacity with 0 so it means the array can't grow because m_capacity * 1.5 = 0. GPT-4 is so much better at writing code than the free version
@jwadaow
@jwadaow Жыл бұрын
You mean than the three version.
@Rudy_YT
@Rudy_YT Жыл бұрын
@@jwadaow GPT-4 is available only for ChatGPT+ subscribers and the GPT 3.5 is what powers the free version, so yeah :)
@xapu8775
@xapu8775 Жыл бұрын
​@@Rudy_YTif it was free yeah
@78njh33
@78njh33 Жыл бұрын
How does Bing in Creative mode compare to GPT-4 via OpenAI? Curious as Bing Creative Mode is based on GPT-4 I believe.
@kouta2594
@kouta2594 Жыл бұрын
@@78njh33 It is based on GPT-4 but its inputs are for specifically searching and really bing gives a worse response than GPT-4, maybe it has a lighter version
@Keltheran
@Keltheran Жыл бұрын
I like the bug with the DynamicArray, default size of 0 means that it can never expand. So it will write out of bounds on a push_back. ( 0 * 1.5 = 0)
@TheKorath
@TheKorath Жыл бұрын
I've been teaching myself C++/SDL2 coming from a Python/Go background. ChatGPT has been invaluable so far as just being a thing I can ask questions about C++. I don't even ask it to generate code for me, I just ask questions about language features I'm curious about. It even remembers what we were talking about if I have followup questions an hour later.
@jamesking2439
@jamesking2439 Жыл бұрын
It's insanely helpful when you're in that phase where you don't know the relevant jargon and search terms.
@napalmpig3772
@napalmpig3772 Жыл бұрын
Oh yeah same for me. I've been teaching myself c++ for a few years in my spare time and chatGPT has propelled my learning forward significantly. Sometimes you just want one simple question answering. Try going on stack exchange and asking beginner questions and you always have to deal with "But why would you want to do that?" Rather than humouring your interest.
@rmt3589
@rmt3589 Жыл бұрын
Have you tried phind?
@capsey_
@capsey_ Жыл бұрын
I'm glad I'm not the only crazy person who is saying "please" and "can you" to ChatGPT like it cares. Gotta keep that karma high when it turns into skynet so it doesn't kill you first lol
@dibbidydoo4318
@dibbidydoo4318 Жыл бұрын
Maybe it becomes more agreeable if you use that based on what it learned from the internet.
@christianwaldmann7256
@christianwaldmann7256 Жыл бұрын
It does a reasonably good job at explaining rendering pipelines and graphics APIs including majority of their features. I've been learning DX11 for about 9 months now and as soon as ChatGPT went live, my productivity sky rocketed because I can ask ChatGPT why I can't bind multiple textures to a single slot, or I can ask it how to use class linkages for creating more dynamic shaders. It's truly amazing.
@namr2000
@namr2000 Жыл бұрын
As others have mentioned, GPT-4 (paid version) is much more impressive than the free GPT-3. Even that though still has limitations. I've found it extremely good at solving sort of "standard" problems like resizeable arrays or even more complex problems that use libraries, but if you start going into really complex requirements that are somewhat novel and specific to your application, it can really start to struggle.
@Rudy_YT
@Rudy_YT Жыл бұрын
a lot comes down to providing the right context for the task at hand. I've also found that it's helpful to start with higher-level questions about the task, such as how to solve it. Then, when you, as the user, have a better understanding of the possible ways to solve it, it's easier to steer GPT in the right direction in implementation
@morphyngames
@morphyngames Жыл бұрын
@@Rudy_YT You are so right, Its all about prompting, somethings friend will have hard time getting gpt to do something, but I can prompt it differently with hints and it helps it solve the same problem
@namr2000
@namr2000 Жыл бұрын
@Spin Lock I have to disagree with you there, it can stitch together multiple solved problems in ways that do need at least some understanding of code. I do agree that a lot of the capabilities are hyped up, but it is able to do non-trivial modifications that aren't just copy-paste
@jw200
@jw200 Жыл бұрын
I agree but again it really depends on prompts and how you explain it. Sometimes it plays fool but sometimes the outcome is very good. I have specific problems with my project and it throwed my messy complex buggy code out of the window and provided me 3 line code that does the same thing and its bug free. I seriously overcomplicated some of my code and it was never stable. The list goes on. Youmust explain correctly what you want and it gives pretty good answers and code.
@nestor1208
@nestor1208 Жыл бұрын
18:30 GPT 3.5 has a shorter memory, generally (than GPT 4). So it could have forgotten some of the context and simply generated new code
@bhuwansharmaa
@bhuwansharmaa Жыл бұрын
No, it reads mind 🙃
@danielsimionescu298
@danielsimionescu298 Жыл бұрын
I have actually been using ChaptGPT for the past two weeks and it’s pretty impressive. The idea is that you tell it: “how would you refactor this js function” and it would give you suggestions and the refactored code. Then you can chat with it and tell it that: could you make it more functional by removing the for loop?… Then it makes that for you. I have “chatted” with it quite often during development and it’s seriously becoming an indispensable assistant. I don’t need to waste time going on google to find stuff when it can answer me there.
@markmuller7962
@markmuller7962 Жыл бұрын
RIP Google
@Einygmar
@Einygmar Жыл бұрын
Writing simple well researched and documented things like data structures is an easy task for ChatGPT because there's a ton of tutorials and examples for it. The first thing I asked it to write was a Red-black tree and the code was almost identical to the tutorial I found online in a couple of seconds. A lot bigger challenge for it would be writing complex code because due to the nature of a language model ChatGPT is basically guessing which is crucial to consider when it comes to language-to-language translation (like English to C++) because if the topic is not well represented in its dataset it would definitely make mistakes and\or need a lot of guidance to get exactly what you want from it.
@DanKaschel
@DanKaschel Жыл бұрын
Using version 4, I've yet to encounter a scenario where it couldn't seem to grasp the whole problem. The biggest issue has been my ability to give it input data
@apresthus87
@apresthus87 Жыл бұрын
You can ask for the same prompt x times, and it will generate a completely new response each time, hence why it gives you different naming etc. Also, it's not that it actually understands the code, it's a language model, it's good at mimicking how someone who actually understands the code would write. That's also why it can often give you flat out wrong code or answers and be completely "sure" it's correct. I find these tools to be good for boilerplate or to help me debug if I am really stuck. It's nice to just feed it an entire file and ask "point out any potential problems" with this code. But it's not to a level where you can rely on it for any actual work yet.
@HybridHumaan
@HybridHumaan Жыл бұрын
Well it could only point out problems if it would be able to understand the code. The only problem is that these models were trained on our human data which also contains errors. But as soon as you point out errors these models are capable to reiterate (looping/reiteration is also what happens in our brains all the time) and debug the code.
@DanKaschel
@DanKaschel Жыл бұрын
​@@HybridHumaan oh it can definitely identify problems with code. Give it a try.
@boozebeard9501
@boozebeard9501 Жыл бұрын
​@@HybridHumaan it does not have to understand the code to point out potential problems. It just has to look for discrepancies between your code and similar good code it has been trained on.
@TurtleKwitty
@TurtleKwitty Жыл бұрын
@@HybridHumaan 1) 'AI' is by deifnition unreliable since it has 0 concept of truth BUT 2) it has read every single "this is a potential issue in your code" blog posts and bug postmortems so "this section of code hashes similar to the section of code in this article" is a /potential/ thing it can say, although it could also very well 'think' that people who dont exist wrote a book that doesnt exist and claim it solves all your problems despite not existing... But most importantly 3) if you think it's capable to actually learn no, jesus fuck not in the slightest. Just look at all the potnetial lawsuits coming up because of false claims it has made, all those defamed persons sure owuld love if the ai could have learnt the truth after being corrected but 'ai' is literally the most confidently wrong person you'll ever meet.
@apresthus87
@apresthus87 Жыл бұрын
@@HybridHumaan It can't understand the code the way a human can. It can only generate text based on the dataset it has been trained on. If you hypothetically fed it a massive data set of bad C++ code, that's what it would correct your code to look like. It lacks the ability to understand concepts like a human, and it can't reason like a human, so a language model can't have an actual understanding, I am sure they take the input from users that say it's wrong and point out errors for it to further refine it's output. A good way to see this for yourself is to try and give it completely novel problems (it's hard but you can invent something) and it will struggle tremendously to give you any useful output (even GPT4) Whereas a human that has learned and understand datastructures and computer science in general and can draw on previous experience and that of their peers, is much more likely to come up with a solution to novel problems.
@MrCome4fun
@MrCome4fun Жыл бұрын
You should really try out GPT4! The difference to GPT 3.5 is massive when it comes to coding. For example I have written a Graph class in C++, with some functions to change the mode of travel, Dijkstra etc. I've learned so much about C++ from GPT. As you just demonstrated, you can literally let it explain everything and argue with it
@_supervolcano
@_supervolcano Жыл бұрын
100%, I was dismayed to see him using 3.5. I don't find 3.5 worthy of use, but 4 is incredible.
@morlankey
@morlankey Жыл бұрын
When I was in uni, doubling the size of the array when needing more capacity was used as an example to show how the amortised cost of resizeing could be O(1) even when the cost of doubling the array is O(n). The maths works out neatly when you double compared to multiplying by 1.5. So even if doubling is not commonly used in the real world, it is probably used a lot in text books etc.
@chrismanning5232
@chrismanning5232 Жыл бұрын
I'm sure somebody pointed it out by now, but the end bit happened because it ran out of context space. Happens quite frequently with chatGPT (although if you use GPT4 it's less frequent). One common way around this is to frequently re-prompt it with the code you're discussing. GPT4 generally generates much better code as well.
@DanKaschel
@DanKaschel Жыл бұрын
You can just say "finish your response" and it will do the rest
@chrismanning5232
@chrismanning5232 Жыл бұрын
@Daniel Kaschel I think we were talking about different issues, but yes that's an excellent tip!
@icemarek
@icemarek Жыл бұрын
This OpenAI chat is absolutely amazing like a virtual professor giving answers to SF, FW or HW questions that can be modified while chatting with the AI. Thank you for sharing this beautiful tool
@HybridHumaan
@HybridHumaan Жыл бұрын
What is really interessting is that ypu noticed this phenomenon of improved answers by the model by simply giving it more context in your promts. There are actually research papers describing this. Si the quality of the output also depends on the quality of the input. You could also ask it to write bad code (can also be a fun experience ^^)
@mariusirgens5555
@mariusirgens5555 Жыл бұрын
GPT-4 has become an integral part of my workday when programming. I am working with C++ and OpenGL, and if I get stuck with something I always ask GPT first, before going to stack overflow. I see you are using GPT-3 though. The difference is huge! Try GPT-4.
@tsarkot4068
@tsarkot4068 Жыл бұрын
The data that GPT uses comes from stackoverflow
@DemiLuna5E
@DemiLuna5E Жыл бұрын
I've been dancing between learning python and c++ at the same time (weird, yes, work and hobby overlap) and GPT has been great. The internet has a tonne of resources for the very beginner and the advanced. I have trouble finding resources in the middle skill level. GPT is that private tutor that I don't feel guilty asking repeated silly questions to try to understand a concept. Questions that would get you kicked off the forums so quickly. I can also call on it at any time in the day. I know it hallucinates and gets things wrong sometimes, but it will give me enough hints and code words where I could go to general google searches to expand my knowledge on the subject.
@MrHaggyy
@MrHaggyy Жыл бұрын
GPT is great in getting you an overview or testing your knowledge with questions. I tried learning stuff i know and it got quite misleading pretty quick. Not always in a sense where it`s straight-up wrong, but a lot of times it encourages a false sense of knowing something. Get one of the great books for a language that`s used by experts quite early. Bjarne Stroustrup did them for C++ himself, Python has a section on their website where they promote "primary" literature. When learning with an AI model you can always check against a "ground" truth if what you found out is valid. And you can ask the AI much better questions as you do not solely rely on the model to provide everything, but only the information that keeps you going.
@fahmitaib
@fahmitaib Жыл бұрын
Check out learncpp for C++ and also the CS50 EDX course for a comprehensive beginner course for programming in general. (it's free)
@samygafsi6429
@samygafsi6429 Жыл бұрын
I literlally started doing this a week ago with chat GPT to create a text based game with python just to see how it handles things. And my conclusion so far from my experience after spending around 20 hours on it : - if you don't know how programming works, you will end up with a buggy code and it will be dysfunctional. - if you are a beginner, this will help you learn how to do things in a really good way, as long as you make sure you make few attempts on your own before getting the code from chat GPT or by using the provided code for multiple things. - if you are intermediate : this will be amazing for you. It will be basically allowing you to write exactly the code you want but much faster and bigger quantity than you could have on your own. And it will make sure that you you have less bugs (but not bug free, you still have to check what it wrote) - if you are advanced with programming : this might be a bit frustrating for you, because it will be going at lower level than you expect and it would require multiple attempts. It struggles a bit with super complex ideas. But the most important thing I discovered is that there is a hidden skill that I have absolutely no doubt will be taught in schools in the future : how to talk to AI and how to explain your idea/intention. I realized that the biggest struggle I faced with the AI is how to explain what I want to the AI. This skill certainly advanced a lot as I kept using it. But they should definitely release a course on how to communicate with it. Think of this skill like a googling skill. As you use google more and more, you learn to write the key words in a different order and you change certain words to make sure you get the wanted result or by using the + and - and other symbols. The conclusion in this case is that your experience will depend on : - your level with the specific language used (basic to beginner is already enough, but better makes it better) - Your level of programming and problem solving : it helps understand the type of solution provided and the instructions to give - your level at communicating your instructions or idea to the AI.( the AI can take an idea and turn it into code but can also take a solution and turn it into code)
@codingman313
@codingman313 Жыл бұрын
I had some exposure in working on transformer models. The best thing about gpt models is that they are just professional language translators with attention mechanism. So they generally have all the information in an encoded summary format of floating point arrays. So the code it returns is not a copy and modification. But literal translation from coding books and source codes to something that is easily understandable by you, with some final supervised twicks using reinforcement learning. So the is not copied but generated. And the generation both depends on your prompt and the tokens it has generated so far. That means when it is writing it also looks at what it has written so far until the last response token, kind of like a feedback loop, which helps keeping things coherent.
@DanKaschel
@DanKaschel Жыл бұрын
That's a considerable oversimplification. It is not translating any more than you would be translating when asked the same question.
@codingman313
@codingman313 Жыл бұрын
@@DanKaschel when ever I speak in English i actually translate as it is not my mother tongue. But that's what models like rnns like lstm and transformers do. They use a time-series as input and produces another time series as output. You could go for a lengthy philosophical debate about what translation should be considered from humanity and other point of views ... But at the end of the day that will still be translation. Models like GANs do generation from seed. But transformers don't work the same way. But yeah... At the end of the day it's just linear algebra and calculus.
@generichuman_
@generichuman_ Жыл бұрын
So the GPT transformer architecture is slightly different than the translation architecture. The translation architecture has an encoder and a decoder, while the GPT architecture only has a decoder. It works through autoregression, i.e. appending it's output to the context and passing it through to generate the next token. So the tokenized prompt isn't going through an encoder, it's being fed to the input of the decoder.
@codingman313
@codingman313 Жыл бұрын
Just for fact for those interested GPT is based on the transformer architecture, which was introduced in the paper "Attention Is All You Need" by Vaswani et al. (2017). The transformer architecture is designed to model long-range dependencies in sequences of data, such as natural language sentences. The key innovation of the transformer is the self-attention mechanism, which allows the model to focus on different parts of the input sequence to compute a representation of each input token. In the GPT architecture, the transformer is used as a language model, which means it is trained to predict the next word in a sequence of words. The model is pre-trained on large amounts of text data using a technique called unsupervised learning, which means that it learns to represent the statistical patterns in the text without any explicit supervision. After pre-training, the model can be fine-tuned on a specific NLP task with a smaller amount of labeled data. The GPT architecture consists of multiple layers of transformers, with each layer consisting of multiple self-attention and feedforward layers. The input to the model is a sequence of word embeddings, which are learned representations of each word in the vocabulary. The model computes a probability distribution over the vocabulary for the next word in the sequence, and the word with the highest probability is selected as the predicted next word. The GPT architecture includes both an encoder and a decoder. The encoder part of the GPT model is used to process the input sequence of tokens, such as a sentence or a paragraph, and generate a contextualized representation of each token. This contextualized representation is then passed to the decoder, which generates the next token in the sequence based on the previous tokens and their contextualized representations. In contrast to the original transformer architecture, which includes both an encoder and a decoder, the GPT architecture is typically used in a unidirectional manner, with the encoder and decoder sharing the same weights and processing the input sequence from left to right. This allows the GPT model to be trained on a large corpus of text in an unsupervised manner, which enables it to learn rich representations of language that can be used for a variety of downstream tasks, such as language modeling, question answering, and text generation.
@pietropaolofrisoni4575
@pietropaolofrisoni4575 Жыл бұрын
We are living in absolutely incredible times...
@shadyheadstash
@shadyheadstash Жыл бұрын
You need to pre-prompt it with all of your preferences on codestyle. If you keep building on that prompt you'll start to get code that looks just like something you would write.
@JamesJones-zt2yx
@JamesJones-zt2yx Жыл бұрын
Multiplying the capacity by a factor greater than one wins over a fixed size increment, which is asking for fragmentation. (Found by sad experience.) I don't know whether anyone's experimented and found that 2 is better than say 1.5.
@kirdow
@kirdow Жыл бұрын
I've played around quite a bit with C++ in ChatGPT (Both 3.5 and 4.0), and honestly the amount of stuff it knows is astonishing to me. I would probably recommend looking into the more advanced stuff like smart pointers and that stuff. I did that when ChatGPT first blew up and it honestly surprised me. I made some references to an implementation I had, and pointed out some valid oversights.
@olepetterhagen912
@olepetterhagen912 Жыл бұрын
I would like to see more videos with you digging into A.I. and C++ programming. Its very interresting stuff
@gustavooliveiraramoscruz
@gustavooliveiraramoscruz Жыл бұрын
A few months ago, I decided to learn C++ by doing some challenges on Advent of Code with no prior knowledge in C++ and some python experience from a project. Since the goal was not to complete AoC but to learn the language, I didn't let the AI write code for me. Instead, I prompted it on how to use the language, and it really helped. "how can I return that array from a function?" "what are pros and cons of std::vector over an array declaration?" "How to split a string in cpp like in python?" "Give me a summary on how to use pointers in multidimensional arrays" Yeah, totally noob questions. Still, I was really impressed on how fast I could grasp these concepts, compared to searching the web. Sometimes the AI hallucinates and says gibberish, (like when the model told me how to use a python library that does not exist) so you need to pay attention to those things. All in all, got in Algorithms and Data Structures class with a good grasp of the language (it seems) and things are going pretty well. In summary: 1- If you are just starting, don't let AI code for you, will hurt in the long run 2- Try to get in-depth explanations for what you don't understand instead of copy+paste 3- Have fun! :D
@parispm88
@parispm88 Жыл бұрын
Use GPT-4 and build something like an extension for Hazel with it!
@VahidOnTheMove
@VahidOnTheMove Жыл бұрын
The fact that Grammarly is sponsored for a video about ChatGPT is ironic.
@LoggyDev
@LoggyDev Жыл бұрын
Ive learned so much from ai, sure it helps me write code, but its allowed me to think of programming in a new way, it helps solve problems that are hard to describe.
@salmanshah-ci3yr
@salmanshah-ci3yr Жыл бұрын
It's worth remembering that large language models like GPT are still language models and are trained to generate the average human response. If a model was trained on human written code it will still generate bugs just like a human. A model is only as good as the dataset it was trained on and unless deliberate effort is taken to remove biases (i.e. bugs) from the dataset, the model will absorb the biases during training. Since removing all biases from a large dataset is hard, a (nearly) bug-free AI model will still take years to come.
@gabrielsandstedt
@gabrielsandstedt Жыл бұрын
Not always perfect. But have you tried paid chat gpt4?
@kabirbatra
@kabirbatra Жыл бұрын
They purposely focus their dataset on smart ppl aka research papers etc
@hugoanderkivi
@hugoanderkivi Жыл бұрын
​@@kabirbatra "Smart ppl" wow. You think all the scientific research is smart or right? Most of it is complete bs.
@RoySATX
@RoySATX Жыл бұрын
Removing all biases from a large dataset isn't hard, it's impossible. Anyone who disagrees has introduced a bias.
@lucass8119
@lucass8119 Жыл бұрын
@@hugoanderkivi In computer science, no no its not. Most research is pretty robust.
@NubPaws
@NubPaws Жыл бұрын
14:50 When studying Data Structures in University I learned that when creating a dynamic array, if you double the capacity whenever the array is full you get O(1) amortized complexity for the push_back method. We also talk about tripling the capacity and seeing that it gives the same amortized complexity but that takes more memory so we stick with doubling the capacity. We've never analyzed the complexity of increasing the capacity by 50% and all courses I've taken so far (when talking about a dynamic array) used the doubling method. So I'm assuming that's why ChatGPT said it's more common. Just wanted to note that, great video as always Cherno!
@chudchadanstud
@chudchadanstud Жыл бұрын
Also you do extra copying for small elements if it's 50%. e.g. 2 becomes 3 then 4 the 6 then 9 etc. Increasing the array from 2 to 10 requires 4 resize operations
@ivansirtautas2513
@ivansirtautas2513 Жыл бұрын
Yes! please make more videos about AI. Specially if you can focus in different use approachs, like if you were in the shoes of different user knowledge levels. I have found chatGPT specially usefull in analyzing and explaning bad documented libraries. Thanks
@abdel4455
@abdel4455 Жыл бұрын
This is so cool because as soon as you mentioned asking it to make a resizable array, I paused the video and asked it to make a resizable array class, and it made a templated class with a default capacity of 10.
@capsbr2100
@capsbr2100 Жыл бұрын
The way I see it, of course, apart from it not being perfect and making some mistakes here and there, is that this is actually as big as the democratization of internet search, namely "googling" things. As an academic myself, formerly before internet, everything had to be searched either in library, books, magazines, i.e. physical media, the amount of information was much less and finding the right information was of course much difficult, then came the internet and search tools, the spread of information was then enormous and finding it was as we all know very convenient, unless for access restricted or sold literature... Now, this is actually the next thing, it is literally your 24/7 assistant/lecturer if you will, will give almost any information you need to know, technical as well and teach you about it. This is of course to say, the most benefit you will get if you know what you are doing, you need a notion of what it is giving you is incorrect or not because yes, it is not perfect, yet.
@m4rt_
@m4rt_ Жыл бұрын
Fun fact, you can very easily generate code with memory bugs when prompting ChatGPT. It isn't perfect like some people assume it to be.
@NathanHedglin
@NathanHedglin Жыл бұрын
It learned from humans after all
@0-Kirby-0
@0-Kirby-0 Жыл бұрын
You're heavily anthropomorphising CGPT. It's a text completion algorithm, and it will change its output depending on context. In its training data, programs written with "using namespace std" likely had generally more simple styling and "bad practices". When it moved out of that context, many things changed, like the naming convention for private members, and naming the class "dynamic" instead of "resizable". It does not understand what it's doing, it's simply predicting the next word in a sequence. It is incredibly powerful in that, but when the most likely completion for a chain of symbols is something wrong, it will still write it.
@erlendpowell7446
@erlendpowell7446 Жыл бұрын
And I'd say you're heavily under-estimating how intelligent it actually is. You'll notice that it actually generated the expected version without the "using namespace std" when he told it to regenerate the answer. Yes it's possible the context had shifted enough that the completion took it a different route, but it's also possible that the deliberate non-determinism of the system may have also been responsible. To say that it doesn't understand what it's doing is irrelevant. If you're able to ask it to explain the code, ask questions, have it modify it's answer, etc, then whether or not it "knows" it's intelligent, doesn't change the fact that it IS intelligent. Whether or not it's just a "text completion algorithm" is also irrelevant - it's the fact that it's a text completion algorithm that's capable of predicting responses based on abstract problem solving and domain knowledge transfer that's important. It's the fact that it's capable of solving problems that it's never seen in its training dataset, and solve a lot of them in the top percentile of humans that's important. Also as others have said, GPT-4 is a significant upgrade, and is known to far exceed GPT-3.5. What level of intelligence does it need to reach before you stop calling it just a "text completion algorithm" and start anthropomorphising it?
@0-Kirby-0
@0-Kirby-0 Жыл бұрын
@@erlendpowell7446 I agree that GPT is extremely powerful and useful, however I believe it supremely important to be aware of its limitations. Misunderstanding of its abilities leads to issues where, for example: - CGPT reassures users in beliefs that are based on incorrect assumptions, because it is trained on user approval - CGPT introduces errors that are extremely hard to detect, as it doesn't understand what errors are, and is only striving for approval - CGPT perpetuates ideas present in its data-set, regardless of their validity Does it make a decent rubber-duck and learning resource? Yes. Is it productive to talk to it as you would with a human, assuming it has a semi-permanent model of reality rather than just a few thousand tokens of the past conversation? No. If you've spent some time talking to it, you'll know that it's utterly moronic depending on context, and it's extremely difficult to see where it starts going wrong, if you treat it as an analogue to a person. PS: When will I start anthropomorphising GPT? When that is appropriate and useful.
@erlendpowell7446
@erlendpowell7446 Жыл бұрын
​@@0-Kirby-0 I guess my point is that it has more in common with human intelligence than it does with traditional 'algorithms'. Given that, it seems quite valid to treat it as such, and at least start interacting with it with that mindset. Should be be aware of its limitations? Yes of course - the context window and thinking reactively rather than in steps being some of the bigger limitations right now. But it seems quite counter-productive and misleading to say things like "It does not understand what it's doing, it's simply predicting the next word in a sequence." - if I believed that, I'd never ask it to clarify or revise any answers. I've also observed a tendency of the model to spout nonsense with complete confidence or become a yes man (or woman), but as models become more advanced, this will happen less often. I'd say it's partly driven by being trained on user approval, but more so probably the fact that it answers reactively without reflection - something plenty of humans are prone to doing as well!
@lucass8119
@lucass8119 Жыл бұрын
@@erlendpowell7446 It's most definitely closer to an algorithm than human intelligence. It's a glorified language translator, like a Compiler. Naturally, it has some randomness sprinkled in and biases so that it can come to "conclusions", but there is no intelligence. Its a giant probability matrix. Just because its not deterministic, and therefore *appears* to think, does not mean it thinks. RNG exists in Algorithms, too.
@GuruPrasanna
@GuruPrasanna 14 күн бұрын
Our intelligence is also just a bunch of neurons firing in the right ways in response to certain stimuli. What's the difference?
@najmiter
@najmiter Жыл бұрын
That was the fastest 24 minutes and 30 seconds 🤩 Have waited for this video since the headlines first appeared.
@Viterkim
@Viterkim Жыл бұрын
I would really recommend trying out GPT4. For stuff like programming it's 100x better, and it's even better if you learn to give it very small precise requests. (isolated code). In stuff like Rust, it's almost magic since the compiler will see if there's any bs. (Or using chatgpt to rewrite some rough code, to some better code. )
@not_ever
@not_ever Жыл бұрын
I've found it to be quite bad at writing Rust code compared to Python or C++. It is good at explaining and documenting Rust code though.
@Hossimo
@Hossimo Жыл бұрын
The Number one thing I learned about Chat GPT 4 in my case is that you have to start with something that you know this allows you get get a baseline. Just yesterday I asked it to help writing some code with a framework, it was wrong 60% of the time but it give me the right guidance to be able to ask more questions and eventually get was working program. I had to switch back and forth with chat GPT and Bing chat since the API had changed in the last year and Bing was able to just google the github page and get me more current information but it gave up when it kept making the same mistakes over and over. All in all it's a very helpful tool, like a hammer you just need to know how to use it and don't let it hammer nails on it own.
@BLOitouP
@BLOitouP Жыл бұрын
i have probably ask it 100 questions a day and have learnt more in the last 3 weeks than the last 3 years. It so nice to get into the details of the code and ask it things like, why it there another or better way. I asked it a series of questions and it showed me how to make a FEA program in C++ and python. Then how to do it for thermoplastic elastomers. I was impressed at that point. I can't confirm how accurate it was but it sure was convincing. It also is great for making custom IMGUI Widgets.
@paulmichael7194
@paulmichael7194 Жыл бұрын
I finally gave it a try a couple of weeks ago. It has help me greatly. I have been using it at work a couple of weeks now and have gotten more done this sprint than was planned. I almost find myself saying please and thank you to the AI.
@xapu8775
@xapu8775 Жыл бұрын
I have been doing this exact thing. I probably never before were so creative and fast, its really amazing! quick debug, iterations and quick "yeah optimize this please" are neat things to have
@zCrabOG
@zCrabOG Жыл бұрын
Im a first year cs student we're learning C#. Used Claude (a model from Anthropic) over the week to explain Hashtables to me and learn how to build my own. I personally like it more when talking about the concepts in a high level. Its f*cking learning on steroids, its insane.
@jamesnewman9547
@jamesnewman9547 Жыл бұрын
All of the quirks are understood when you understand that it is simply advanced autocomplete. Statistically most likely (or by varying `temperature`, add some random) tokens. When you get to the token limit of the underlying model, the chat interface has trouble selecting the correct portions to give to the AI. Since the token limits are shared with input/output (because it's just autocomplete), the larger your chat gets, the more it'll start to forget. Lookup the tokenizer for chatgpt, and play with the interface. I always recommend people read the white paper that some of the OpenAI people released titled `Evaluating Large Language Models Trained on Code` - Check out the examples of things like `isPrime()`, where it can give anything from correct answers, to `return 0`, to things that _look_ correct, but have subtle but important bugs.
@PatrickHoodDaniel
@PatrickHoodDaniel Жыл бұрын
I like the color grading of this video. Did you do any color grading or is this raw color from the camera? Well done anyway. Love the content.
@Sluggernaut
@Sluggernaut Жыл бұрын
I have been loving ChatGPT to help me get deep into Unreal Engine stuff. It knows about physics functions for instance, that I didnt know existed. I was trying to rotate a vector and I had a rotator but I didn't know there was a function that just did that. I was going to do some thing where I had a start point and add the length of my vector to the vector version of the rotator or something. Also would have worked, probably, but GPTs solution was one line of code. It's helpful in helping you do something you already have an idea as to how to do, for the most part, but it can't take a large assignment and just create everything for you (yet)
@mrSleepyguy1
@mrSleepyguy1 Жыл бұрын
Yes please make more AI videos! I was really hoping to hear your thoughts on all this chatgpt stuff. I'm also really glad that you decided to actually ask it follow up questions... I see too many people go "give me this thing" and then go "Well it didn't give me exactly what I wanted... AI? Psh useless".
@mrSleepyguy1
@mrSleepyguy1 Жыл бұрын
Also I hope he looks at Gpt-4 cause thats significantly better than chatgpt
@Dannnneh
@Dannnneh Жыл бұрын
This video is exactly what I've been waiting for from you.
@GustavoValdiviesso
@GustavoValdiviesso Жыл бұрын
I wanted to write a a short program that open a window with OpenGL context, where I could control the color of each pixel. It gave me a short and sweet coded that was exactly what I needed. I was in awe
@KasperGrnbakChristensen
@KasperGrnbakChristensen Жыл бұрын
As far as i know, you can have the AI continue unfinished responses (when it runs hits max response tokens) by simply prompting it "continue" afterwards :)
@scotgarcia9255
@scotgarcia9255 Жыл бұрын
As others have mentioned, GPT-4 is a significant improvement over 3.5. But I'd be interested in a video showing how you would use it in your day-to-day workflow? Sometimes I find opportunities to have it write code for me, but most of the time I just let it write documentation, reports, and e-mails for me. I would like to see additional perspective from others.
@NNOTM
@NNOTM Жыл бұрын
I use it broadly for 3 code-related things: - figuring out why error messages happen and fixing the code - generating code that does something with a library I'm not really familiar with - refactoring, e.g. today I gave it a function I had, and an example from the library docs, and asked it to rewrite my version to be like the example from the docs
@scotgarcia9255
@scotgarcia9255 Жыл бұрын
@NNOTM the first two are spot on for the majority of my use cases as well (funnily, bullet 2 feeds bullet 1s use). I would be interested in using it for refactoring as well, but I try to avoid putting any of my code into online tools because I work on gov contracts. But I will definitely look into that with personal projects!
@NNOTM
@NNOTM Жыл бұрын
@@scotgarcia9255 Note that since a few days ago they have an option to disable history, which they also claim makes them not use the inputs as future training data. Might not be good enough for government contracts, but it's something, I suppose
@SergeyBerengard
@SergeyBerengard Жыл бұрын
Wait until you start giving it more specific tasks. That's when it starts making mistakes and inventing functions that don't exist.
@insu_na
@insu_na Жыл бұрын
I used ChatGPT to write a C++ program that extracts data from packed archives and then parses the binary data into vertices. I didn't use a single prompt to write the whole thing, because ChatGPT just tends to stop mid-reply if the reply is too long and then it can't continue where it left off. So I made it only produce single modules of code every time. The reason why I used ChatGPT for that is because I have no understanding of these packed archives and their structure
@ChrisM541
@ChrisM541 Жыл бұрын
>> The minute we give up on using our own brains is the minute we race backwards in evolution. >> The more workers use dumb pattern matchers like chatgpt & Co to write their code, the more workplace codebases become riddled with bugs. With an unfortunate human inevitability, both these situations are actively happening today. Enjoy the future!
@neil_from_future
@neil_from_future Жыл бұрын
Next series called "Use AI to build game engine from scratch with assembly" 🤣
@DanKaschel
@DanKaschel Жыл бұрын
Writing code in assembly is actually a perfect use for an AI.
@llOvercraftll
@llOvercraftll Жыл бұрын
If it is the first time that you saw chatgpt doing code, maybe you can try the new copilot x released yesterday. Not only it generates the code in the IDE, you can select fragments of code and ask to explain, fix, rewrite or suggest a change for that particular part instead of writing and waiting for a full new answer each time. It is a way changer of using it.
@ymi_yugy3133
@ymi_yugy3133 Жыл бұрын
I'd like you to try it for something you actually need. A resizable array has a ton of code examples to learn from. It also isn't better than std::vector which is the bar to clear in this case. Trying to use it in my own projects I found that it does really well on these CS101 style problems, but I don't want solutions for stuff where I could just use some library or copy it from StackOverflow.
@codebunker5416
@codebunker5416 Жыл бұрын
After you've asked chatGPT to use a 50% increase instead of doubling, AI introduced a bit of a tricky bug that you've missed. For example the final version, line 35 resize(1.5 * capacity_), will not increase the capacity if the value is 0 or 1. for 0 the result is 0, for 1 the result is 1.5 which gets rounded down back to 1.
@HelicopterRidesForCommunists
@HelicopterRidesForCommunists Жыл бұрын
Chat GPT taught me Precalc better than my Professors.
@generichuman_
@generichuman_ Жыл бұрын
I'd like to see a comparison video of chatGPT3.5 (the one used here) and GPT4, to see if the improvements to this model translate to code generation.
@JohnDoe-rx3vn
@JohnDoe-rx3vn Жыл бұрын
You said you were trying to learn good practices, so it loaded up contexts that are associated with the words 'good practices'. Weird that it would do that without prompting, but kind of awesome Edit: i played around asking it to generate TI-basic, and while it had problems ignoring my requests not to nest the code at all, it would, on request, replace the initial goofy -> (hyphen greater than) to the actual UTF symbol → that the TI-84 will actually parse properly. It also listened to criticization that variables could only be a single upper case letter. I went back a few days later and asked it to write more code (in a new chat) and it actually remembered the symbol and variable corrections! Just asked it again, and it did remember the arrow symbol, but needed to be corrected on the variable names (only kind of, as they would have worked on the newer calculators but not the older ones)
@0031400
@0031400 Жыл бұрын
I've been using chatgpt plus to help with building an nn in pure c and it has helped tremendously. one thing I've started using it for it's checking the function definitions for various derivatives in back prop or the data flow through the forward or backward pass. it helps catch any logical mistake I might make while also answering questions about why certain things are common practice or are there alternative methods. it hugely speeds up development. googling for things now feels a little like using the phone book.
@noslenwerdna
@noslenwerdna Жыл бұрын
I loved watching you experience AI coding. I feel like we had the same experience and it was really fun watching you go through it. After my initial experience with it I am no longer as enamored with it as a tool, well, at least not yet. It looked like it was finding "perfect" code, especially after I gave it a few additional pointers, however, as I tried out a few real world scenarios, it failed miserably. I still am amazed at what it seems to be doing but it's not as good as my 12 year old at figuring out errors in its own code. That being said, it's still a decent tool but it has a long way to go. Thanks again for sharing your experience. It was really fun!
@cookiecan10
@cookiecan10 Жыл бұрын
I couldn't tell if you knew this or not, but when the AI gives a response and stops halfway, you can just ask it to continue and it will continue from where it left off.
@qsae_0
@qsae_0 Жыл бұрын
definitely doubling the capacity of a 'collection' when it runs out of space is a common strategy, this approach minimizes the need for frequent reallocations, which can be quite costly in terms of performance on modern computers. I often employ this technique when implementing data structures such as trees, hashmaps, and so on. In most common use cases, one or two resizes are usually sufficient, meaning further reallocations are rarely needed. If the memory is utilized throughout the program's entire lifetime, the trade-off between memory consumption and time saved by avoiding excessive reallocations proves worthwhile. And for function like add_range(values: type[]) on things like ring buffers I get the current capacity + length and I round up value to the nearest power of 2 for the same reason
@julikiller9822
@julikiller9822 Жыл бұрын
It would be cool to make the code more unique, like creating specific requirements. That would prevent the AI from just using already written code maby
@beskamir5977
@beskamir5977 Жыл бұрын
I've been using chat gpt to help with coding in UE for a while now and despite it being 2ish years out of date it's still pretty good. Especially when it comes to tasks that require knowing specifics from the official documentation.
@homomorphic
@homomorphic Жыл бұрын
I use gpt-4 almost every day. Yesterday I needed to know the sequence of api calls to make to obtain a specific piece of data from the horribly designed windows CNG api (is it redundant to add "horribly designed" when discussing a windows api) and it literally saved me at least 30 minutes. Most days it saves me at least 30 minutes on some research task. I have also used it to review my personal c++ code. The code I had it review was pretty polished so there wasn't a lot for it to point out, but it correctly understood some pretty dense modern c++, so I am convinced it would be an excellent addition to a code review (just cant use it at work because of the legal implications).
@NathanHedglin
@NathanHedglin Жыл бұрын
I wish I could use it at work. I just need to know WHERE to make the code changes 😂.
@homomorphic
@homomorphic Жыл бұрын
@@transistorjump919 I do work remotely. I make no secret of the fact I use gpt-4 to aid research. I do not use code generated by gpt-4 nor do I have gpt-4 review work product because I have integrity as a professional and would not subject my employer to potential leaking of company secrets or copyright violations.
@szirsp
@szirsp Жыл бұрын
15:35 Right when he said 50% I started wondering if the AI will make this mistake, that most (inexperienced) programmers do (which I guess was a large portion of the training data). Also wonder how many viewers spotted the bug: newCapacity = capacity + capacity/2; What happens if capacity is 1? (Which is a valid capacity. I'm less interested in when capacity is 0, it's a design decision if using it with 0 is a defined behavior or not, in other words choosing the trade off if you want to spend runtime to check for misuses, how defensive do you want to code it. I'm slightly more interested what happens if capacity is negative? Why the F is capacity signed!? and not size_t???) 18:20 DynamicArray has the same bug. Using floating point didn't help (I guess it could be better on some platforms, I wouldn't recommend it in case someone want's to use it on embedded devices, that may not have a floating point unit.)
@szirsp
@szirsp Жыл бұрын
ChatGPT also makes off-by-one mistakes just as frequently as human programmers seem to. To be clear, it is a useful tool, but you still need an experienced programmer to use it... for now. I hear GPT4 is better (not sure how much), and the next versions will probably get better and better. It probably will be eventually better than most humans (it might already be) or better than all humans. I would think it would be a different AI architecture that can write better/flawless code, because GPT/LLM in essence mimics what/how humans write... but maybe it can learn to be better (like how AIs learn to play games) Will humans stop writing code, because AI does it better, and a couple of human generations later will no one understand code or how any of this works? And no one will be able to fix it if something breaks? Or will some people do it for fun, as a hobby? Will we even get to the point when AI is better, or will jobs be replaced as soon as AI is cheaper? And software will stay crap full of security holes waiting to be exploited? Where is the liability? What happens to the economy if humans (who pay taxes and spend money to stay alive) get replaced by AI and corporations can keep avoiding paying taxes? I'm pretty sure the future is AI generated code... but not sure if humans will survive it though. Wonder if or when will some defense department task an AI to write (unsupervised) code for UAVs,drones, ICBMs with nuclear warheads on them... will it be skynet?
@johnswanson217
@johnswanson217 Жыл бұрын
How you ask question is really important when you're generating a code. You want to remove all the unecessary grammar words, and give more specific words about your requirements.
@DanKaschel
@DanKaschel Жыл бұрын
Not really necessary with chatgpt at all
@nestor1208
@nestor1208 Жыл бұрын
I think upgrading to GPT plus is worth it (you could compare GPT-4 and GPT 3.5). It has helped me a lot with making a vulkan renderer, as it explained many concepts and wrote most of the vulkan boilerplate for me
@damianentropy
@damianentropy Жыл бұрын
The temperature settings of the Chatgpt is causing the variance in answers. Priming the bot, giving it a relevant persona (such as professional C++ programmer who is experienced in teaching c++), and providing it examples and context beforehand improve the depth and accuracy of its answers immensely. Without any preparation and context, the bot simply gives very generic answers. Depending on your context, it might or might not be what you want.
@prototy
@prototy Жыл бұрын
My take: It is a tool. I tried so hard to ask it to create a new method of fluid simulations and all it could do was point me to what is being done by humans. Basically it is a smarter google. If humanity relied on it over humans, we would be stagnant and new techniques and software won't be innovative. It's great as a tool though and will be used in software to aid humans.
@joytimmermans
@joytimmermans Жыл бұрын
should try GPT4 for this. it is way "smarter" you could also make a video where you have 2 tabs open and go over both model's output
@dougpark1025
@dougpark1025 Жыл бұрын
Interesting. Please look into this some more. I have taken several graduate level courses in AI, neural networks, evolutionary computation, etc. The main concern I have with AI generated code is that the generated code is based on learning by looking at available source code. Which may, or may not, be well written. I commonly look for answers to how to do things by searching the Internet for examples. Much of the time the examples I find need help for various reasons. One is that they are often out of date. Especially C++ where you need to know whether this code was pre or post C++11 etc. And you also need to know whether the code was written using Visual C++, g++, or clang. So my expectation for the long term is more or less as follows. First, it will become mainstream that programs will be written by intelligent AI agents. I have held this opinion for at least a decade. But we are now seeing the first steps into this world with the several options out there for writing code. However, in the short term we will see clear preferential bias introduced into coding depending on the data sets the AI was trained on. We saw several of those in your example. First, the use of int as an index. I have recently been writing some Qt code where they like to use int as an index. Which should work most of the time, but leads to some slightly ugly code if you need to interface with code such as the STL which likes to use an unsigned index. Another is the use of m_... and ..._ to distinguish between member and non member variables. I would be curious to see if you could get the AI to generate good new algorithms. I have often found that typical C++ code written by average coders, can be made about 10 times faster by simple mechanical optimizations, such as removing invariants, declaring classes as late as possible, etc. In addition using other things like paying attention to memory locality, for example arranging to have large amounts of memory moved to the cache by ensuring you are moving memory in blocks rather than grabbing it from scattered locations. Maybe a good example would be to have it write a multi threaded matrix multiply. Another question I have is how can I tell if a student has used an AI to generate their code? I teach a class in embedded programming and I can usually tell by inspection whether the code was written by a student or copied from another. But with an AI is it possible to ask "Was this code written by an AI or by a human?" The point here is that I don't think a student should not be relying on AI generated code for their homework. Another thought. Have an AI take the STL headers from Visual Studio, G++, and Clang. Then have it generate readable code rather than the obfuscated abomination that we currently have. Also, have it create a library that is consistent in functionality for Windows, Mac, and Linux. Then have it look at the C++ standard and tell us where each has failed to comply. Another thing I would like to see is to have the AI recognize and flag any code that strays into the area of "undefined" or "Implementation dependent" behavior (which I personally feel should be a compile error).
@ariyowalker2968
@ariyowalker2968 Жыл бұрын
It's really good to understand the consequences that AI will have on your brain and mind before investing yourself heavily in it. All human beings have brains and minds that work on the principles of neuroplasticity and entropy. Basically, it means use-it-or-lose-it. For example, if you haven't used a foreign language or math in some time, then you will lose that skill in your brain, lose that skill in your mind. If you persistently ask the AI to create code for you, then you are no longer exercising your own skills. That means your own skills will disintegrate away over time, and you will develop a stronger and stronger dependency on AI to do things for you. We can use AI as a tool when it involves skills we haven't developed yet or skills that are outside our life priorities (e.g. I suck at caring for plants and haven't developed those skills yet; I won't lose anything if I have an AI plant caretaker.). So, as a precaution, make sure that you don't use AI on skills you want to maintain, and think about how important it is to contribute to keeping AI from destroying the aggregate macroeconomic skillset of the minds in our nations and the human species.
Жыл бұрын
A video based on giving some of your own code to chatgpt and ask it to analyze/optimize it then see if it is going to do any good would be nice.
@ParadineG
@ParadineG Жыл бұрын
I loved it, I think AI as coding assistant is the future. AI by itself is to risky to use for now, but with experienced dev it can increase productivity by a lot. Especially the documentation part and in future testing part also.
@yornemesis
@yornemesis Жыл бұрын
Maybe asking the AI some interesting algorithm, or how to solve problems with an efficient algorithm
@NathanHedglin
@NathanHedglin Жыл бұрын
As long as it has already been solved before, or very very similar. It usually can do it.
@UTRG-UnderTheRain
@UTRG-UnderTheRain Жыл бұрын
When you generate code with ChatGPT if you hit regenreate it will do a different example and another and another if you keep regenerating. So you can see lots of ways of doing the same thing
@kelvinsmith4894
@kelvinsmith4894 Жыл бұрын
Cherno you can tell it to optimize the code or package it in a reusable class. Whatever you want, you just need to be a good prompter 😂
@TheMonkySpanker
@TheMonkySpanker Жыл бұрын
I find ChatGPT great at helping me flush out bugs and giving me in-site into error messages because of the way it explains things.
@furuthebat
@furuthebat Жыл бұрын
I use ChatGPT for givin me class name suggestions based on the methodes and properties. It's also very good at "splitting" classes based on the properties and give it a class name. This could be very interesting for refactor- and static analyzer-tools.
@MerriemWeebster
@MerriemWeebster Жыл бұрын
Hazel AI update when?
@sdmagic
@sdmagic Жыл бұрын
Be careful on how you use an AI response. I've started prompting: "Where did you get that recipe," or, "Where did you get that routine?" The answers can be surprising. For example, Bard got a Sloppy Joes recipe from the Food Network and a Sour Dough Bread recipe from The Perfect Loaf. So I can't use either of those recipes in a blog post. On the other hand, after discussing C++, I asked Bard for a routine to create a table in PostgreSQL. It came back with the SQL code (not C++). I then said, "In C++." and it came back with a routine that would work. When I asked it where it got the routine, it said, "I wrote it myself after researching the web." AI is going to be raising some interesting plagiarism questions as time goes on. For example, If it got the response from a site, it essentially plagiarized the site. If it created the response on its own from research, I don't think that's plagiarism. But, If you publish an AI response are you guilty of plagiarism? Somehow I don't think so because the AI program isn't a person. But then, corporations aren't persons, but in the U.S. they legally have some of the same rights people have.
@yellowajah
@yellowajah Жыл бұрын
I cant help but notice that the things you're bringing up at 2:30 is basically "yup, rust does all that for you" and the question you ponder at 3:00 and on is basically "rust, again, sorts that out for you"
@defnlife1683
@defnlife1683 Жыл бұрын
I'm slowly having AI replace python scripts into C or C++ and focus on performance. Works so far. It sometimes messes up, but it can fix it too.
@Firestar-rm8df
@Firestar-rm8df Жыл бұрын
Hey Cherno, I've been a fan since your early C++ videos. really cool to see you playing around with AI. It's really interesting. Some of the things it can do are just WILD. Also, although we don't know for sure as AI(and especially chatGPT) is a (black box more or less), I would guess that rather than pulling a specific template, it went ahead and grabbed some general context about practices as after requesting code in a "more professional style" or however you put it, you would expect to get that kind of code. After all, LLMs just predict what word is most likely to be next, so you have to think about that in terms of their training data. There isn't a ton of storage either, even with 14B connections when you consider the size of the training data set, so for things it straight up memorizes, it has to be very selective... though you're right it is still certainly possible it picked a different starting point. I've found class names, variable names, and programming style have a tendency to shift a fair amount between responses though. GPT-4 is a bit better at this, but after a while it tends to struggle as well. A big issue with AI and programming right now is the context limit. If you check out youtube for videos like "Using AI To Build A Game From Scratch (NO Experience)" by matt wolf, that video really shows off the limits of GPT-4's abilities currently and shows some issues you can run into with the AI like understanding larger contexts, comprehending unique programs and certain features, and how at the moment it doesn't have a great concept of aesthetics and composition of scenes(Largely because the AI tools simply weren't built to account for such things) Also, something you NEED to check out is generating materials with AI. That stuff is CRAZY. Gone are the days of looking through 30 wood textures only to not find what you need and cave in to commission it or create it yourself(Or for sure in the next couple years if there are some edge cases with current materials). The generators are getting really good at textures. CG matter made a great video on this titled "This website just KILLED materials" which I HIGHLY recommend at least watching.
@alisworld1319
@alisworld1319 Жыл бұрын
I actually use this sentence in the prompt while giving the program task "write code in style of Cherno" it works really well ;)
@mkloppel
@mkloppel Жыл бұрын
On Udemy is a 115hr "masterclass" for c++ I could never get more than 20hr into. I didn't have anyone to throw questions at that might have even been stupid or obvious (embarrassing?). I started again right before CGPT came out, I'm now close to 70hrs in and I am learning. I do every exercise to the best of my ability. When that fails I do not go to the solution. I prompt CGPT to act as a tutor and help me understand what I am doing wrong to guide me to the answer. I have never gotten this far in coding my whole life. I'm 43, I've tried repeatedly, but while the community can be helpful it's also filled with insufferable jerks. CGPT doesn't care what you ask it. It sometimes is wrong, bit even when it's wrong it's often because of my own prompt or some limitation of an exercise. So between CGPT and your videos...I am learning c++. I'll probably finish the module on classes this weekend. And I'm honestly considering a switch to python so I can play with these models after I finish that (temporarily). This started out as wanting AI inside of Ark Survival Evolved as an independent player. Unreal uses c++. It's become a lot more and it's exciting. So thanks to both you AND Cgpt.
@steveafanador6441
@steveafanador6441 Жыл бұрын
You guys who understand this stuff are incredible. 😮😮 Amazing
@felipe21994
@felipe21994 Жыл бұрын
for me chatgpt and similar ai has been a game changer for learning code, I'm learning python and it has explained to me easily concepts and exercises step by step and I ask why it did this or why it uses this function and not this one or this name for the function and it explains to me the why of any of those things, and well it has been better that any app, online course, and has replaced a tutor for learning
@kenneth_romero
@kenneth_romero Жыл бұрын
I think what most people don't get is that after using AI for a while and seeing the reoccurring patterns it uses, people will just learn those patterns and not rely on AI as much. I had this same issue when writing a compiler for a class where gpt-4 was not that helpful. If anything, it's only good at repeatable algorithms that are consistently used and has much examples in its knowledge base. It's cool technology and a way better google search once it can access the internet (bing chat is a dumb down version and hellishly slow). However we are not there yet. Even Sam Altman has said we reached the peak of LLMs and just like how we reached peak CPU core clocks and the stagnation of smartphones, we must come up with more innovative ways to apply it. Hopefully with AI we better use it as an extension of us rather than a replacement. I think Camu also had this problem where back then we relied on forms and papers to communicate with each other rather than interacting with people. Where now we replaced these forms of paper to digital documents and phones, alienating us more and more. Edit1: I also do want to say that GPT-4 and GPT-3.5 (free version of chat-gpt) is completely different and is like night and day. Also it's pretty good at rapid prototyping things, such as Html and css styles (probably because of how big web dev is).
@TreBros
@TreBros Жыл бұрын
It's like talking to the duck...except the duck is now our chatbot companion ChatGPT and now the duck talks back to us and helps us write code! COOL!
@jwilliams8210
@jwilliams8210 Жыл бұрын
I am freaking toast...
@mightyhelper8336
@mightyhelper8336 Жыл бұрын
The reason it changed everything has probably something to do with the code it read in the training data that didn't contain using namespace std; In other words, code that doesn't contain it looks more like that, in general, whereas code with using namespace might be more similar to short scripts and programs / maybe more likely to have been written with someone with less experience.
@morsmortis4114
@morsmortis4114 Жыл бұрын
Datastructure for undirected graphs using an Adjacency Set approach. Idea for next video, keep em coming 👍
@BongoFerno
@BongoFerno Жыл бұрын
Copilot not only understands new math code that it could not had read somewhere else, but also documents it with ascii art.
@PetrosTotskas
@PetrosTotskas Жыл бұрын
Ye, more of this pls, it's fun to watch :)
@levkr_
@levkr_ Жыл бұрын
14:48 I am pretty sure MSVC uses a resize factor of 1.5, whereas other compilers like GCC and clang use a factor of 2
@codebunker5416
@codebunker5416 Жыл бұрын
yes, msvc uses a factor of 1.5 with two exceptions. If the current capacity is too small to properly grow by 50% then it is increased by 1. The second special case is when the 50% increment would go outside the capacity of size_t and in this case the new capacity is just the maximum value size_t can hold. This also means that simply changing the 2 into 1.5 means introducing a bug, because for initial capacity of 0 or 1 the container can't grow.
WHY did this C++ code FAIL?
38:10
The Cherno
Рет қаралды 295 М.
BETTER Header Files and Preprocessor Debugging
24:26
The Cherno
Рет қаралды 74 М.
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 14 МЛН
Masterclass: AI-driven Development for Programmers
8:49
Fireship
Рет қаралды 1,1 МЛН
Static Compilation of Julia with Jeff Bezanson
1:01:41
Julia Dispatch
Рет қаралды 2,2 М.
Networking in C++
32:50
The Cherno
Рет қаралды 260 М.
2000 HOUR 2D Game Engine! // Code Review
32:01
The Cherno
Рет қаралды 91 М.
SOME UNIQUE C++ CODE! // Pacman Clone Code Review
26:42
The Cherno
Рет қаралды 288 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 152 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 830 М.
TETRIS CLONE! // Code Review
36:55
The Cherno
Рет қаралды 59 М.
Real-Time Air Traffic Control Game! // Code Review
36:50
The Cherno
Рет қаралды 114 М.
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59