Skip to content

Is it bad to use AI to generate code ?

Hi I've been studying video game development for over a year now and I've always generated code using chatgpt, I was wondering if that was a bad thing, I use Unity and I set up the scene and the components of each gameobject etc, I just never write the code myself, is this cheating ? Our professor knows that most of us use AI chats but he wants us to be able to answer his questions and I always do mostly well, and get good enough grades, but I still feel bad about myself, and worry I can't get a job because of this.

0 points42 comments
Open on Reddit
About this post
Posted
Archived
Score
0 · 33% up
Kind
Text
ID
1fv86so

Author

1
posts
4
comments
0
media
View profile

52 comments

never write the code myself

This is a problem. It’s fine to use AI to generate some code for you but you need to then take the time to understand the code it has generated and be able to know if that code is good and correct. Also if this is for school assignments, yeah, you’re cheating. 100%.

55 points

If the AI writes all the code for you, what happens when it introduces a bug and you have no idea how anything works?

Yes, it's bad and you'll end up in trouble very quickly at a workplace.

34 points

Nowadays, it's pretty common to be writing code with co-pilot on to help generate code. But you say you *never* write code yourself? Do you understand what the code is doing? If not, then you're going to have a bad time in the real world.

Eventually, you're going to discover that being a programmer that works on a team isn't so much about "writing code" but more so about how you structure your code and the project itself. Right now ChatGPT and Co-Pilot have a hard time understanding that.

Personally, I believe that if you're going to use AI in its current state, you need to understand when AI is giving you bad code, and I find it hard to believe you'll be able to do that without writing your own code and understanding the process of developing it.

14 points

Yeah I decided to forego ai assistants for quite a while to actually learn but lately Ive been letting copilot handle some stuff and it works decently well now because I'm writing good code already and provide it with structure. It's also gotten quite good at using standard libraries for both c# and python as well as converting between them which until recently was not possible. I gave copilot a working but somewhat slow python script to translate to dotnet. The code it gave me didn't work at first and while I pointed out the issue I didn't write any code for it and surprisingly it did actually come up with the right answer after some bullying and it ended up being quite a bit faster than my python script even when compiled to C with nuitka

1 points

I am a novice coder and I just completed a diploma in IT that included coding and cyber security. I am making a game on unreal engine 5.7.1 and i am using c++ and blueprints. I am learning as i go, and I have corrected Gemini pro sometimes and it corrects me, and it only gives me information based on what I tell it to give me, and i examine it and research and check step by step if it is correct and it is working.

I am learning the more I work and It explains why a part of code or a node is needed and when it is needed and I show it to the ai and it troubleshoots it and tells me what went wrong and it reminds my of my python mentors teaching style from when i was studying to complete my IT diploma. It is literally my development partner and teacher that only does what i want it to do and It enables my vision.

1 points

You should NEVER rely on AI to write code if you don't have a solid understanding of basic coding. Ive recently started using AI for certain aspects of coding myself so I do understand and respect it's utility. But I think it's best used sparingly. I think you're really setting yourself up for failure if you mostly rely on AI to write large chunks of your code, a problem that will become more and more prominent as your projects grow bigger

I wouldn't call it cheating per se, but stop and ask "could I do this myself if AI wasn't an option?" If the answer is no, you should probably learn the basics a bit better

10 points

At university do you not have exams?

In a job AI might be banned. How are you going to debug and fix bugs in code you don't know? Even if work allows AI it's unlikely to let you post code into AI for confidentiality reasons.

7 points

Our exams are project-based our professor does weekly follow ups, until the final validation, every week he ask us questions about the overall work including the code, they give us some advice about what to change and that's it. So far I’ve been able to answer those questions correctly.

0 points

You're in school to learn. If you are generating your code with ai, you aren't learning to code and are wasting your time/money at school (its not like a vg dev degree is particularly valuable on its own).

Using chatgpt to help problem solve, find solutions, automate stupid tasks, or elucidate code is fine. At least make sure you understand what you're copy pasting. But if you're not learning to code, you are going to hit an issue where you have no idea how to fix the tangle of buggy code you've copy pasted

6 points

in school yeah it's cheating
Problem tho is that if you don't understand what the hell you're copy pasting and when it'll eventually break (depends on how basic what you do is) it'll be even harder to debug
At least take time to understand why each line is there and if you don't ask chat gpt (it's a great teacher)

For the furture, everyone will use it, but clearly not to generate everythingjust as a tool. what you are doing is probably simple enough that you can get stuff that always works, but in the future when doing more complex stuff, especially when you will have to inovate, not having the basics is gonna be hard

3 points

It's only a problem if it's important to you to understand how your program works.

3 points

Do you understand what the code stands for? Do you understand how to fix bugs? Would you be able to solve (coding) problems on your own?
If any answer for the above questions is no, then yeah, it is bad to use AI. Use AI as an extension that makes your life a little easier but not as a replacement for your brain.
And if you are worrying yourself, why are you still using it? Most developers have to solve problems on their own, if you are not able to do this without AI, it will be quite hard to get a job (I mean, why should someone hire someone that is not able to solve problems / write code independent? If they just want someone who asks AI, they could hire anyone)

3 points

It is indeed cheating, and a path to utter failure as a developer. Why not learn to code? If you dont want to at all, then maybe look for a different path? How will you pass exams if you can only basically copy/paste code? Its like obviously not gonna Lead to anything to continue on this path of "not learning". Its a waste of your time and the teachers. And programming isnt for everyone and thats ok. Then just spend your time persuing other careers/paths in game dev. Anyways gl with it all!

3 points

You're working on improving your skills, what do you expect to gain by relying solely on AI? The most essential skill to develop anything is planning an architecture for your game and if the AI does that you are useless. If the requirements for a game you're working on changes you'll need to start from scratch, one thing is doing this while studying but it's a major problem if you're working on a game, you'll waste time and money and no company wants that.

3 points

Programming for me is not about writing the code, but its about understanding what it needs to do and how. You can probably get through school just fine without ever even understanding what AI wrote for you. Many programming patterns are essentially solved and AI's are very good at replicating those. The problem comes when you are programming something that no one has ever done before, AI's can't really help then.

So, its really a question of who you want to become after school.
If you want to become a true wizard programmer you should probably try to rely on AI to generate code for you as little as possible, especially while learning. At least make sure you take the time and ask the AI questions so you understand what the code does.
You only said video game development, which might not mean coding at all. There are many disciplines out there that don't really require coding, but it always helps.

When it comes to jobs, think of it from an employer's point of view, would you hire someone that can only do programming with AI?

3 points

Thank you all for the responses. I noticed someone asked whether I understand the code that is generated, and to clarify, I do understand it. However, there are times where I encounter something I don't fully get, so I ask the AI chat for clarification, which is why I'm able to answer my professor's questions.

I used to think this was pretty normal, especially since around 90% of my classmates do the same. But when I think about my professional future, I start questioning whether I should rely so heavily on AI. At the same time, I don't see myself pursuing a job where coding is the primary task.
For example, my sister works as a software tester, and I know that some software testing jobs require coding, but my sister works in a role where minimal coding is involved.
It made me wonder if there are similar roles (other than QA) in game development that don’t demand intensive coding.

That said, I’m planning to work on reducing my reliance on AI as I move forward.

3 points

I know of a company that banned ai generation altogether due to possibilities of copyright infringement possibilities.

3 points

This sounds like as good a place as any to post this:
I'm currently working for a client that has a fledgling codebase built almost entirely with chatGPT. They hired a contractor who perhaps had some understanding of programming, but was using chatGPT for basically everything.
Literally nothing works all the way in this codebase. I'm essentially having to re-write things from almost nothing. There are snippets that are great, but that's just about all chatGPT is good for: snippets.

Unless you know exactly what the chatgpt snippet does, and exactly how it fits into the broader context of the program, do NOT use chatgpt code.

And if you are going to use snippets, make sure you recognize when chatGPT is generating something you already have code for. What I'm working with right now has SO much repeated code, because the last person working on this copied and pasted in every half-assed helper function that the LLM generated. There's 3 half finished/mocked JWT verification implementations. Half of the endpoints that are supposed to use them used hard-coded example user ids instead. There's two sets of functions to save files that are LITERALLY only different in name.

Im going crazy with it. You must understand the code you write and use, or I guarantee you will run into significant frustration eventually.
I use chatGPT fairly often, it's super useful, but only if you've already got the knowledge to completely understand what's being generated.

3 points

I would guess you probably can't get a job coding anything if you don't write your own code?

2 points

I think you missed the point. Using AI is not ‘bad’; I use it every day, and all companies use it. However, it won’t make you an engineer. Even if coding is no longer needed tomorrow, I and others with a CS degree will have an advantage over you because we understand models and paradigms. You should really reconsider how you approach the situation.

2 points

I see it as basically equivalent to copy-pasting code you found online. If someone asks you to explain what your code is actually doing and why you chose to do it that way, you're not going to be able to answer that kind of question. Which means if subtle and annoying bugs crop up you're not going to be able to find or fix them. That said I sure did a lot of copy-pasting while learning to program, there's a balance to be struck between struggling to find the answer to a problem and seeing some actual results.

Arguably, not understanding what code does is representative of the majority of programmers, since an enterprise codebase could contain millions of lines of code, or we could be using 3rd party libraries that could have their own array of security vulnerabilities or bugs.

It's a new technology and people have opinions about it. Von Neuman believed that assembly language was cheating because you're wasting valuable compute cycles turning human readable code into machine code and that kind of clerical work is best done by humans. But also when Visual Basic came out various non-technical people thought that would also replace developers, and they were wrong.

Also the average CS graduate can't program their way out of a paper bag, which is why everyone has to do technical assessments when applying for jobs. So on that basis alone I'd recommend not using LLMs if you can avoid it because a job probably isn't going to let you ChatGPT through a technical interview.

2 points

I treat ai writing code as I would an intern. Get them to write it, if it works look to see if overall it isn’t too messy or might give you problems later. If things don’t work, you can normally get the ai to troubleshoot them and redo which solves a lot of problems. Sometimes ai tries to solve problems in weird ways which will never work so you need to go back and say, when you solve this problem use X approach. Ai saves me heaps of time on my small projects as I am solo coding, but I would never recommend people who don’t know how to code at all using it as a solution. On the upside, I have learnt ways of doing things that I would never have even considered by using AI.

2 points

If you're learning, it's best not to use AI to write the actual code for you. You need to know how stuff works. At my workplace, we're encouraged to use GitHub copilot but review the code before committing it, but we always know what the AI has generated. But I wouldn't recommend using AI to produce code for university. You're there to learn everything from the ground-up, and you should avail that opportunity as best you can. Grades aren't the be-all-end-all. Just make sure you're learning!

2 points

AI is useful if you already have a solid foundation or have something very specific you’re confused on since it’s USUALLY correct and can explain each line of code to you (but ai can still be wrong and confidently wrong). Beginners shouldn’t be using AI, stick to proper tutorials. There’s plenty of them.

2 points

I've been programming for 10 years, have a masters in computer science and have worked professionally as a programmer for 5 years.. ChatGPT writes a lot of my code and before then StackOverflow wrote a lot of it.

They're tools and can be great ones if used correctly. Though as others have mentioned it's important to understand what you're doing as well as the code thats being generated. Both to make sure that thd code actually does what you want it to, because chatgpt have more than ones come up with really weird solutions, but also to make sure you understand coding enough to be able to give chatgpt good instructions on what you want..

So I'd actually recommend against using these tools and try to write as much yourself as possible just in the interest of learning. Same goes with third party libraries! Write your own libraries when you're learning! You'll probably never have to write your own sorting algorithms, random number generators or linked list implementations in 'real life', but knowing how these things work under the hood will make you much better programmer.

Then once you feel confident in your coding abilities, go ahead use as much chatgpt, StackOverflow and third party libraries as possible to avoid writing any of your own code

2 points

I rarely use AI to generate codes, I only use AI to analyze my codes and refactoring sometimes.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.