Hacker News new | ask | show | jobs
by azeirah 1106 days ago
I don't have any super concrete examples, but I can confirm it _helps_ in writing software for me.

Things it has helped with, that are now part of a codebase I work in and get paid for.

Generated example css to center a text element onto a sibling image. I'm decent at css, but I didn't know I could do this easily. This definitely saved me a decent amount of time

Write some boilerplate react hook wrapping over an axios request. Something along the lines of "Write a React hook to make a request to ..., using these parameters ... Return ..."

The one that I've probably used most is "Write a MySQL query to ..., these are my schemas: {COPY PASTE RELEVANT TABLE SCHEMAS". I can write MySQL queries just fine, but getting one with some decently complex calculations takes me some time. GPT-4 gets very close most of the time. For exploring the database GPT really has helped save me quite some time. I just don't now MySQL as well as I do my primary languages like TypeScript, PHP and Python so this is a godsend.

Otherwise, I also use it a decent amount in some other scenarios. The Phpstorm plugin I have gives me a right-click menu that pastes my code in a chatGPT window. It has stuff like

1. Refactor

2. Explain

3. Write docs

4. Write a custom prompt

I use these a lot. They save me a decent amount of time. They're super quick to access right in my IDE. In some cases using the "Refactor" command, GPT-4 gives better results than myself. I found that it doesn't really make typos in making sure variable names and stuff stay the same, and it also doesn't mess up control flow which I sometimes do. And yes, this is an admission that I do sometimes refactor without tests, I'm working on it :x

1 comments

Does the ChatGPT plugin for PHPStorm actually analyze your existing code? As-in... can you ask it to code something using your pre-existing utility functions, classes, and so on?
The one I use is CodeGPT. It doesn't. It's a simple chat-like wrapper over the GPT4 api.