I've been using OpenAI's ChatGPT for Java development for a while now. I'm using the free version but they also have a subscription available.
I've found I've got to work with GPT, that GPT by itself is insufficient. Debugging is typically your problem but once you point out the problematic code to GPT then it is usually able to patch the code in short order. GPT doesn't have access to a compiler so can't even get compilation error messages unless you provide them.
I was working on some code with GPT the other night and in an hour I was able to put together an app that probably would have taken me 2+ hours to complete by my self. This was code that I've created bits and pieces of in various projects over the years but I would have had to pause numerous times to reference Java APIs and occasional examples whereas GPT was able to throw the framework together in less than 30 seconds. The initial cut made use of anonymous classes and at some point I asked GPT to use lambdas in all places appropriate and it swept through all the code making the replacements. Unfortunately one lambda expression caused a compiler error which I passed on to GPT and GPT made the necessary corrections. There was one place where GPT couldn't come up with a formula for the size of one of the JPanels and I had to modify the code myself and give the code snippet back to GPT that added it to the app. Then there were the usual feature requests and refinements I asked GPT to add, and as long as my instructions were clear enough, GPT succeeded nicely.
So, not a perfect system, but I highly recommend working with AI and becoming familiar with it because that's the future, and you may find you learn things and save time.
P.S. I believe they also have a plug-in for Eclipse but it requires the GPT subscription.
Thanks Carey for sharing your experience. Some colleagues of mine are quite afraid that AI in general will replace programmers.
For me, it isn't a fear I feel. My point of view is that at the current state of the art (and, reasonably, for a very long time, until a different approach will be found to create and train a real general AI), tools like chat GPT and alike will follow the same destiny which was followed by calculators: calculators let humas to rid of calculations made by hand, AI tools will avoid human programmers to write by hand tons of code.
I think that your way of using AI as a code helper will be a common work scenario in the days to come.
What do you think about ?
I’ve described it as paired programming with a junior developer who has memorized every bit of documentation and who can answer questions about it and who can write pseudo code quickly but who needs someone who understands what it all means to put it together.
Seeing as how my memory is not as good as it once was this fills a gap for me.
I haven't figured out how to work with GPT on a project running several thousands of lines long yet. Probably need the subscription and probably the Eclipse plugin. May also need to feed GPT logical chunks to work on.
[Y]ou cannot simply cut and paste a 2000-line Java project into a GPT-3 prompt. GPT-3 has limitations in terms of the input length it can handle, and it is primarily designed for processing natural language text rather than entire codebases.
GPT-3's maximum token limit for a single request is typically around 4096 tokens, and the model's tokenization may not work well with complex programming languages like Java.
If you want assistance with a specific problem or task related to your Java project, you can provide a concise description or a specific code snippet as input to GPT-3, and it may provide suggestions or explanations based on that input. However, attempting to process an entire Java project with thousands of lines of code would likely not yield meaningful results within the token limit and may not be the most efficient approach.
For assistance with a large Java codebase, it's usually better to work with traditional development and debugging tools, collaborate with experienced developers, or consider code analysis and refactoring tools that are specifically designed to handle large codebases.