r/GraphicsProgramming • • 28m ago

Question Learning graphic api using Ai?

Hey all. I made a 2d game engine using opengl and using learnopengl awhile back and plan taking it a bit further and try to do 3d stuff. I found some resources and tutorials about vulkan and a little bit of metal but barely directx 12, I found chatgpt and was wondering if its a good idea to give claude or chatgpt the sources that I found, have ai simply it for me so I can understand and then write everything myself. Ai could code everything for me but I rather just do everything myself so I get the experience of being a programmer. What do you guys think?

0 Upvotes

2 comments sorted by

View all comments

1

u/Maui-The-Magificent 22m ago

So i am going to post some unsolicited advice. The following is a part from a learning aid I wrote for some class-mates about 3 years ago. I think it might help even if it is answering a different question than your post.

Learn to Use AI (The Double-Edged Sword)

I am going to be very honest with you: using AI is incredibly useful. It is so useful, in fact, that if you don't control yourself, you will end up not learning much at all. Despite the risk of being misused, it is very important that you learn to use it. Most of a programmer's job is to find information; experience in using AI to find that information is quickly becoming an important skill to have as a programmer. Soon it might even become a mandatory skill.

So, heed my words! If you take any advice at all away from reading all this, I pray it is this one. Don't use AI to look for solutions; use it as a tutor. Remember these questions:

How?

Why?

When?

Is it like […]?

They should generally be asked in this order as well. Let us go through them so that you can understand how to use AI responsibly.

The Four-Question Framework

You have a problem or an idea of something you want to do; what it is isn't important. You open up Claude, ChatGPT, or any other AI of your choice. You might feel stressed because you are short on time but understand that following these steps is important for you to not only do a good job but to learn how to do it in the future.

You put your fingers to the keyboard and ask:

"I have an idea/problem…"

Explain your particular situation and what you want to do in as much detail as you can. Try to use your own words as much as possible to describe what you want done. This helps you understand how to ask questions to an AI and makes you more familiar with all the new words and terminology you will be exposed to.

You then end your explanation by asking how:

How?

"How would I do that?" "How does this work?" "How will this turn out?"

A few moments later, the AI will give you an answer. You should read it carefully. If you don't understand how something works or should be done, ask another how question. If you still find it difficult, ask it to explain it to you in another way, maybe in relation to something else you are already familiar with. When you feel that you are starting to understand a little of what the AI is trying to do, you then ask why.

Why?

"Why would I do it that way?" "Why shouldn't I do it this way?" "Why must I do that?"

Asking why will give you an understanding of the rationale for what the AI is proposing. It will also help you build up an intuition about code structure of your own. AI will often give you bad solutions to problems. It will often give you code that either doesn't work or that won't work further down the line. It is therefore important to understand the motivation behind what the AI is suggesting. Remember, you can ask as many why questions as you want.

When you are satisfied with the answers you have gotten thus far, it wouldn't be strange if you felt you could stop there, but the next two steps are equally important. We often want to hurry and get things done, but if you think back to what I said in the beginning, programming is hard. If you want that feeling of everything about programming being absolute gibberish to go away, you need to persevere, so what do you do? You ask when:

When?

"When would I use that loop?" "When would I use that method?" "When shouldn't I use this?"

By now, you know what you can do and why you should do it; you also need to know when it should be done. This step is sometimes not as obvious as it might seem. It might not be clear to you when a solution should be implemented or what it depends on to function. There are often situations where one solution is better than another; asking when to use something will help you understand it in the context of actually using it. This knowledge, as it grows, also helps you to intuitively understand what steps you need to take to realize your ideas. You can't build a project without knowing what to do or where to start, right? Now that you feel like you understand how something is done, why one would do it that way, and when to do it, it's time to confirm our understanding. We end this journey with, So it's like…

So, it's like…?

"So, it's like working as a postman?" "So, it's similar to how a bank stores my money?" "So, it's like a combination of a number and a string?"

These questions look different each time; the point is to put what you've learned into something that is similar to something you already understand. You would be surprised how often you can compare some abstract concept in programming to something mundane in everyday life. Asking these questions not only affirms your understanding but also allows the AI to potentially fill any gaps in your comparison.