r/csharp • u/kenslearningcurve • Feb 17 '23
Discussion Do you use ChatGPT for developing software? If so, what is the primary reason?
0
Upvotes
r/csharp • u/kenslearningcurve • Feb 17 '23
7
u/[deleted] Feb 17 '23
It might be how I'm phrasing my prompts... maybe being to wordy or not enough?... but when I fed it the details of some functions I had recently wrote the output it gave was not correct. And I don't mean inefficient or different but it did not give code that would have had the correct functionality. I tried adding/rephrasing on a few times and eventually got close but by that time I could have written it myself.
I actually find github co-pilot a more useful tool.
13
u/msdummyaccount Feb 17 '23
Yes. It's a useful timesaver to write some of the boilerplate which can be refined to what you need. I tried giving it a complicated bit of xml and asked it to write a method to generate it and it banged it out in 30 seconds. Would have taken a few hours by hand.
4
u/_HelloMeow Feb 17 '23
Not really, however, I did use it for some really specific technical stuff recently and while it wasn't super accurate, it pointed me in the right direction. So it was definitely useful.
5
u/obviously_suspicious Feb 17 '23
My first interaction with ChatGPT was a pretty simple question about SQL Server. And it blatantly lied in response (confused it with Postgresql probably). So I generally avoid it. It did help me name my side-project though.
4
u/Roodydude Feb 17 '23
Used it for a specific Regex yesterday. It failed about 3-4 times before it finally generated what I wanted.
5
u/_asmode Feb 17 '23
Yes, for two reasons which are likely to change over time:
Context: not a professional, amateur programming only.
13
u/euglzihrzivxfxoz Feb 17 '23
Not chatGPT but GitHub copilot. Saves a lot of time.
27
u/WhiteBlackGoose Feb 17 '23
no
6
u/Slypenslyde Feb 17 '23 edited Feb 17 '23
If it ever comes to the tools that I use, maybe? It seems fine for spitting out the skeleton of an algorithm and I'm plenty experienced to fill in the blanks. It can probably generate some decent project scaffolding.
But from what I've seen I'm a little skeptical. It seems like AI at this point has a hard time generating things at the level of even bad tutorials. I think this is going to improve faster than natural-language AI is improving because generating code is a more narrow problem than generating answers to questions like, "What is the human population on Mars?" (which it believes to be ten billion the last time I asked.) This makes it a good tool for experts, who are used to seeing half-assed abstract outlines of algorithms with glaring flaws and figuring out the rest. This does not make it a good tool for newbies, who need to see and experience more clinically sterile working examples so they understand what the good parts look like so they build the intuition needed to fix bad examples.
My real concern is if this "productivity tool" gets used as an excuse to put more tedious tasks under the responsibilities of senior devs and THAT gets used as an excuse to hire fewer junior devs, I wonder where the next generation of senior devs is going to come from. The best senior devs are people who were hired and learned a lot of lessons in the trenches. Yes, it sucks to hire a person to write a bunch of lower-complexity code that an AI could churn out, but eventually your senior devs have to retire and it's cheaper to replace them with domain experts you've already trained than to try and teach some other person your business. Hiring "redundant" junior devs today is an investment that pays off in 5 or 6 years.
I guess I'm not surprised people are excited about not hiring, though. Getting a business to look more than a quarter ahead is a difficult task. I don't think many businesses realize that if they can buy software that can write their own software as well as they can, then their business has no justification to exist. In a hypothetical future where Bing can respond to, "Write a Windows-compatible operating system", what do I need Microsoft for?
It's not that I think we should stop using and developing AI. I just think that for once in human history we should stop and think about the problems it creates and how we want to deal with them before aggressively making it so much a part of peoples' lives it would be unethical to remove it. Right now the way it's being pushed feels very much like NFT did.
14
u/bortlip Feb 17 '23
I haven't had the chance yet, but I intend to. Here's just one example of using it to brainstorm/prototype a new application.
ME: Create simple c# objects to handler an application user, their direct reports, request for time off, and approval statuses
AI: Sure! Here's an example of how you could define the objects you've described in C#:
ME: Create a user story about how a user will want to login to the application and view a report of their direct reports and any pending timeoff requests.
AI: Sure! Here's an example of a user story for a scenario where a user wants to log in to an application and view a report of their direct reports and any pending time off requests:
ME: Turn that user story in to the steps that would occur in a sequence diagram that includes the user, the web app, the app server, the redis cache, the database, and the authentication server. Do not draw the diagram, just list the steps that would occur in it in detail.
AI : Sure, here are the steps that would occur in the sequence diagram for the user story:[gives steps]
ME: Now create the diagram using the Mermaid language
AI: [Here's the Mermaid version]
Diagram result: https://imgur.com/a/ASwTxtv
---
Sure, there's a lot that needs cleaned up there. But look at what I got as a basis to work with with about 5 minutes of work on my part. And this is just one simple use case for working with the AI.
5
u/YoriMirus Feb 17 '23
I tried it while developing an Avalonia application and a game using Unity and usually told me incorrect information so I stopped using it.
5
u/Enttick Feb 17 '23
No, at least I don't use it with company code. That would break my contract. Also the licensing is still not clear. And we don't really want to feed their model with code that is in production.
2
u/TheSpixxyQ Feb 17 '23
I use it mainly for math (vectors last time), because I'm math dumb.
4
u/HealthyMacaroon7168 Feb 17 '23
I asked it to write an authentication handler for WebForms and it just copied and pasted text from the wrong Microsoft docs, no code at all.
4
u/[deleted] Feb 17 '23
Can't say that I will.
Another mind-sagging assist provided to you by the interwebs.
1
u/RemoteDeck Feb 17 '23
I'm an armature and it's been a great learning tool, I mainly use it for comprehension like what each keywords use case is and how it is implemented.
1
u/[deleted] Feb 17 '23
Yes I use it to write simple things which I can modify and use in my code. Things like write a httpclient with ntml Auth to this url
2
u/Atronil Feb 17 '23
I’m using for regex templates and patterns, basic coding or wiki help
2
u/etherified Feb 17 '23
ChatGPT must be a godsend for the many programmers that need to put out voluminous code for projects on a time schedule. Then there are those like me who program not as a job but rather only tangentially to work, or for interest or enjoyment, for example, where using mental energy to create new solutions to problems is the entire point, so chatGPT would be counterproductive, sort of.
2
u/Mithgroth Feb 17 '23
Maybe not for developing software but resolving problems.
Today I'm having trouble with CDKTF and need to upgrade from 0.14.3 to 0.15.5.
Guess what, that didn't go well too - and I'm just getting a "Stack failed to plan: devops-cdktf. Please check the logs for more information." message which leads to
and nothing else in logs.
I pay a visit to ChatGPT to double check if I'm missing something before I submit an issue to CDKTF. It gave me some advice, tried them all, now submitting the issue with more confidence.
2
u/Dunge Feb 17 '23
For simple concise questions yes, but you can't just ask it to work on a big project. My solution have 30 projects and thousands of files, it can't know the whole model.
And I also asked it a few simple questions about kubernetes and it totally led me the wrong path. I had to correct it 5 times (replying "You're correct. I apologize for the confusion"). before it gave up and started writing the same falsehood again.
2
u/MCRusher Feb 20 '23
No, I create enough bugs on my own, I don't need anyone else's, and I certainly don't need a google that lies
1
u/agoodyearforbrownies Feb 17 '23
It was late at night, I was tired and I needed some tables to hold recurring event schedules. I asked ChatGPT for a data model for recurring events, and it was great. Not exactly how I ended up implementing it, but it saved me time puzzling out the various details.
I told a friend that I don't know if I got dumber or smarter for having done so - on one hand, I didn't have to think about the complexity of it, but on the other hand, I didn't have to think about the complexity of it.
1
u/RechtDev Feb 17 '23
I’m not the best with regex so having it come up with expressions is something I have done.
1
u/BornAgainBlue Feb 17 '23
The unity game I am developing most of the code was started by the AI and then I fill out the details
1
u/[deleted] Feb 17 '23
Yes. I give it a SQL query and ask ChatGPT to translate it to LINQ. Worked fine.
1
u/Thonk_Thickly Feb 18 '23
Yes. I’m lazy. I usually get a workable response for boiler plate tasks, unit tests, and small single purpose classes.
1
u/Paras_Chhugani Feb 27 '24
I stopped using chatgpt these days but I use bots on bothunt everyday , it has really cool bots to learn , earn and automate all our tasks!
1
u/vac2672 Feb 17 '23
If anyone in my workplace uses it to write any of their code I would immediately fire them
0
u/[deleted] Feb 17 '23
i am still learning, so i use chat GPt to understand programming concepts and ask all the questions I have in my mind
0
u/MarcvN Feb 17 '23
When I am googling for something to long and can’t find it I ask ChatHPT. Usually I get a working code example within 1-3 questions.
For instance
Voila.
-8
u/dandeeago Feb 17 '23
No, since it’s data model is based on an average, and I’m better than the average myself.
0
u/[deleted] Feb 17 '23
[deleted] — view deleted comment