this post was submitted on 24 Jun 2023
30 points (85.7% liked)

Programming

16240 readers
197 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
30
submitted 1 year ago* (last edited 1 year ago) by rarkgrames to c/[email protected]
 

Over the last year I've been learning Swift and starting to put together some iOS apps. I'd definitely class myself as a Swift beginner.

I'm currently building an app and today I used ChatGPT to help with a function I needed to write. I found myself wondering if somehow I was "cheating". In the past I would have used YouTube videos, online tutorials and Stack Overflow, and adapted what I found to work for my particular usage case.

Is using ChatGPT different? The fact that ChatGPT explains the code it writes and often the code still needs fettling to get it to work makes me think that it is a useful learning tool and that as long as I take the time to read the explanations given and ensure I understand what the code is doing then it's probably a good thing on balance.

I was just wondering what other people's thoughts are?

Also, as a side note, I found that chucking code I had written in to ChatGPT and asking it to comment every line was pretty successful and a. big time saver :D

Edit: Thanks everyone for insightful and considered replies.

I think the general consensus is basically where my head was at - use it as a tool like you would SO or other resources but be aware the code may be incorrect, and the reality is there will be work required to adapt and integrate with your current project (very much like SO) and that's where you programming skills really come in to play.

I think I still have imposter syndrome when it comes to development, which is maybe where the question was coming from in my mind. :D.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 14 points 1 year ago* (last edited 1 year ago) (1 children)

No, it's not cheating. But you are expected to understand what your code does and how.

And this brings us to the explanations it provides. Keep in mind that these AI tools excell in producing content that seems right. But they may very well be hallucinating. And just as for code, small details and exact concepts matter.

I would therefore recommend you to verify your final code against official documentation, to make sure you actually understand.

In the end, as long as you don't trust the AI, neither for solutions or knowledge, its just another tool. Use it as it fits.

[–] [email protected] 4 points 1 year ago

I’d go as far as saying you should know what every line of code does or you’re risking the whole thing to have unexpected side effects. When you understand what the code is doing, you know what parts you should test.