nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Share your AI-supported coding experience here #314

Open damithc opened 7 months ago

damithc commented 7 months ago

If you used AI tools (e.g., ChatGPT, GitHub Copilot, etc.), in the iP/tP or elsewhere, consider sharing your experience (both positive and negative observations) here. It can encourage other classmates to try such tools too, and can be useful for others trying such tools already but looking for ways to get more out them.

camille-readbean commented 7 months ago

I tried getting ChatGPT (GPT) 4 to generate some of my user guides and it was meh to good.
What I did was pass in the few critical files (you can only upload 10) and it can infer from some of them what commands there are and the command format (I think there was a few data poisoning because one of the file already contain the built in help message with the format for the answers so I guess at worst its a format translation). Also discovered some "markdown injection where it do not properly escape markdown code... but its md not html so I dont think its a security vuln. I guess if I had more docs to write, ChatGPT would be better but I spent more time wrangling the format then writing it myself.

It's more useful for answering JavaFXML questions because the documents on it are absolutely hard to understand.

My take away: I feel getting automated away is a really real concern. I keep up with the latest happenings in AI and LLMs. They are here to stay and I think its better to start getting used to working with them then burying one head in the sand and refusing to acknowledge their strengths and weaknesses.

The most basic jobs can probably be automated, some of the more humans orientated stuff is probably here to stay, finding user stories (not writing but discovering what the user actually wants), working with stakeholders and etc. The best way is to have a conceptual understanding of what you are doing, you are the architect, AI can be the builders. But eventually one day they might be the architect too. 🤖 🏗️

yisiox commented 7 months ago

I find ChatGPT (3.5 at least) and similar generative AI cannot help with the programming aspects other than

For more complex issues its just a roll of the dice whether it generates a relevant response.

It is however excellent at miscellaneous tasks like

I mostly used generative AI for the A-Personality increment and "searching" for concepts that I needed. I didn't use Copilot as I wanted to go through the process of writing the code and not be over reliant on (possibly wrong) autocompletion. I don't think I used the AI tools optimally and getting more out of AI tools is probably a skill that can be learnt.

kokerinks commented 7 months ago

Personally I used Github Copilot during development of the iP. Here are some of my insights:

GitHub Copilot (GCP)

TLDR: If used efficiently, you can potentially cut your production time by up to 40 or 50%. If used haphazardly, you could end up wasting more time instead debugging code which was poorly-written by GCP. Personally found GCP helping more than it hurt, but need to be conscious of which suggestions you are accepting.

ejnan commented 7 months ago

Copilot was a great time saver for generating javadocs, though sometimes it missed out some parts like @params but that was trivial at least for me.

Other than using VSCode to package my classes and implement checkstyle, I attempted to use CLI for most of my coding, and I found myself turning to ChatGPT first, and then Google (Stack Overflow) when I had errors.

I found AI very convenient to use alongside coding, so long as I knew what I was doing and could spot mistakes. I felt that I saved a lot of time from trivial coding using ChatGPT which allowed me to implement stretch goals and optional implementations.

Bonus skill I learnt from using AI is prompt-engineering. With newer, more powerful AIs that can read and generate code better, it is a tool that I think we should all become familiarised with and know how to make the best use out of it.

simkianseng commented 7 months ago

I consulted ChatGPT for ideas on how to structure our code.

Sometime around week 4 our codebase got fairly large and it got somewhat disorganized for me.

One particular suggestion that caught my eye was how we can organize our commands into multiple classes, where there is a Command interface and the different command classes implementing from that interface. However at that point I had already implemented Java Enum, push and tagged it already and hence decided to ditch that idea. Below shows the suggested structure:

Suggested structure from ChatGPT ``` chatbot-project │ ├── src │ ├── main │ │ ├── java │ │ │ ├── chatbot │ │ │ │ ├── interpreter │ │ │ │ │ ├── Interpreter.java │ │ │ │ │ ├── Command.java │ │ │ │ │ └── (Other interpreter-related classes) │ │ │ │ ├── parser │ │ │ │ │ ├── Parser.java │ │ │ │ │ ├── Token.java │ │ │ │ │ └── (Other parser-related classes) │ │ │ │ ├── core │ │ │ │ │ ├── Chatbot.java │ │ │ │ │ └── (Other core chatbot classes) │ │ │ │ ├── utils │ │ │ │ │ ├── InputReader.java │ │ │ │ │ └── (Other utility classes) │ │ │ │ └── Main.java │ │ │ └── (Other packages for additional functionality) │ │ └── resources │ │ └── (Configuration files, if any) │ └── test │ ├── java │ │ ├── chatbot │ │ │ ├── interpreter │ │ │ │ └── (Test classes for interpreter) │ │ │ ├── parser │ │ │ │ └── (Test classes for parser) │ │ │ ├── core │ │ │ │ └── (Test classes for core chatbot functionality) │ │ │ └── utils │ │ │ └── (Test classes for utility classes) │ └── resources │ └── (Test resources or configuration files) ├── lib │ └── (External libraries, if any) ├── target │ └── (Compiled bytecode and build artifacts) ├── .gitignore ├── README.md └── (Other project-related files) ```

However it was a good to know for future projects.

The full conversation can be found here.

Lin-Shuang-Shuang commented 7 months ago

I used ChatGPT to generate some of my Javadocs at the start. I used it because I was not certain what to include in the Javadocs and also to get used to the syntax. After some time, I stopped using ChatGPT to generate Javadocs, and started writing them myself.

I found it really time-saving to use ChatGPT for Javadocs, as it took me quite a long time when I wrote them myself. The Javadocs generated were mostly correct and accurate as well, as long as the correct context was provided. There were some errors here and there but those were easily fixed.

baskargopinath commented 7 months ago

i use gpt4 to help me find out what methods and classes would be appropreiate to use. i want to try copilot to increase effeciency but im worried that it might impede my learning

lynnetteeee commented 7 months ago

@bgopi23 I'd say you could still give it a try!! It really helps with efficiency :)

From my experience of using GCP, what I tend to do is to first write the line(s) of code by myself to ensure that the implementation is in the style and format that I want it to be (of course, accepting trivial suggestions).

Then, if there are other similar methods or chunks of code to write (which was quite common when designing classes that involved abstracted methods created for each command e.g. in Ui.java or Parser.java), I will then use the GCP suggestions to complete some similar lines of codes. With this approach, I get to practise writing the code itself, and I felt that I was still learning since the logic flow of the code was ultimately designed and decided by myself!

Hope that your experience with GCP (if you ever try it out) will be a good one too XD

jyztintan commented 7 months ago

I think that GPT4 is really useful in helping you phrase your user stories in TP. I think that the bulk of the ideation should still be done by your team, for reliability and for your team to come to the same consensus. However, after getting the rough ideas behind each user story, GPT4 can nicely refine your idea into the User Story format: As a {user type/role} I can {function} so that {benefit}

This was especially useful for my team in building our developer guide since I could use GPT to output the user stories in the md table format too.

baskargopinath commented 5 months ago

@damithc prof are we allowed to use ai tools to help us generate javadocs?