by tkgally · 3y ago · 0 comments
I’m not a programmer myself, but I have made quite a few static web pages over the years for my own use. I code the HTML and CSS by hand, and I think I have a basic understanding of how they work. But JavaScript has always been a mystery to me.
So the other day I asked GPT-4 to teach me the basics of JavaScript. It responded with an understandable outline of the language and a few code samples. Nothing special there. But then I tried asking it questions, and that is where it really shone.
When, for example, I asked “In expressions like console.log("x is greater") or window.onload = function(), what is the role of the period (.) between console and log and between window and onload?,” it replied “The period (.) in JavaScript is used to access properties or methods of an object” and continued with a multiparagraph explanation, including examples. I then followed up with “How many properties or methods does the 'window' object have?,” and it gave me a list of common properties and methods. I continued asking questions and asking for feedback on some code I wrote until I hit my prompt limit. I felt like I was learning very quickly.
The next day, I tried a similar thing with Python, which I also knew nothing about, and once again the lesson went very smoothly.
I have no idea how good it would be for more advanced learners, but for a beginner like me GPT-4 seems like a great programming teacher. Being able to ask questions and get full answers and feedback immediately was particularly exciting.
Despite this, it’s still been a lot more helpful than searching, is mostly correct, and is my go-to resource.
Another example where GPT-4 can be used productively for learning despite its fallibility is with human languages. It doesn’t always explain grammar correctly, and it can spout out hallucinated facts. But its ability to interact almost as if it were a real person, as well as its ability to explain the meanings of words and sentences quite accurately (in the case of major languages, at least), is of enormous value for people learning other languages. Few human language teachers are as knowledgeable and accurate as it is.
AI is such a wonderful tutor/assistant/teacher. I feel like we’re just scratching the surface so far with what skills we can develop with it.
You can't ask a book questions about parts you don't understand. Books will also talk about things that are not directly related to the problem you are trying to solve, which can be frustrating.
The biggest issue with GPT is when you are working with new or rapidly changing tech. For example it might suggest Godot 3 syntax when you are working with Godot 4. But working with OpenGL for example, I find questioning GPT-4 to be more useful than reading a book. The book was probably in it's training data, anyway.