ChatGPT is already chipping away at my Google searches. I'm more and more just starting there for coding related questions.
I've had chatgpt help me with the following just this week among other things.
- solved a complex issue with scaling and transformations using pixijs upon providing a code example. The solution was 99% there and saved me hours of debugging.
- refactored JavaScript to the async/await pattern
- simplified a complex nested logic in c# with citations
- scaffolded a MySQL create table statement upon providing several c# classes. Again saved me the tedious steps of typing them out.
I asked ChatGPT to decode a Diameter header in Java (RFC 6733 Section 3).
It supplied this :
// Parse the Diameter header
ByteBuffer buffer = ByteBuffer.wrap(message);
int version = buffer.get() & 0xff;
int flags = buffer.get() & 0xff;
int length = buffer.getShort() & 0xffff;
First problem, it's version, length, flags. Second problem, length is 24 bits, not 16. Third, 24 bits unsigned won't fit in a Java int (which is signed). Then there is the extra masking, which isn't a bug but is (I'm reasonably sure) unnecessary.
That's 3 sneaky bugs in 4 lines of code, and it didn't even try to parse the rest of the header.
I'm impressed that it produces _anything_, but it's dangerous to trust.
ChatGPT is as reliable a source as any friend in a pub after 3 beers. It is definite in its answer, convincing with its phrasing and more than likely misremembering something it overheard on the radio while driving to work.
When I tried re-prompting, it produced more complicated, just as incorrect code.
Same here. Worked on a lazy list in js for mobile. The component had a nasty array lookup every scroll event. I asked chatgpt if it could optimize the lookup algorithm. I suggested me to implement a binary search solution including the code itself. It worked immediately. I would have taken me probably a day to come up with something similar.
I also asked chatgpt to minimize my code including all method names , variables etc. Unfortunately the output of chatgpt is limited to x characters. 200kb of text isnt possible. But it is able to minimize. You can even ask to uglify the code by using animal names or street names in London.
ChatGPT struggled to tell me how to pin the bottom of a div to the bottom of its parent when scrolling (like a chat window does). It gave me the first thing that I tried (which is wrong). Eventually I figured it out, then confronted ChatGPT about it and it insisted on the wrong answer, and blithely dismissed the correct answer.
I've been trying to get ChatGPT to solve pretty basic calculus questions and it is often either totally wrong or wrong in some tiny detail. I got into an argument over dimensional analysis a few weeks ago where it felt like it was gaslighting me.
In the same way as building bridges and math are the same thing. There is some overlap, but not much for the every day tasks. If you want to build something completely new and unprecedented, you will need a lot more math, but still it will only get you so far
Can you use ChatGPT without a phone number yet? I thought about signing up a while ago but don't see a reason they need my phone number. Popular VOIP numbers don't work either.
I've been using it and Google in parallel and have find it generally helpful, but I've had multiple instances where ChatGPT completely made up new library functions. Same for others I've talked to.
I've found that if you give it pairs of "Why..." questions it'll happily argue both sides of the coin ("Why is X better than Y", "Why is Y better than X"). But in giving me justifications, it gives me fodder for further traditional searches. I don't trust it to give me a correct answer, but I do trust it to define the problem space a bit.
I've had chatgpt help me with the following just this week among other things.
- solved a complex issue with scaling and transformations using pixijs upon providing a code example. The solution was 99% there and saved me hours of debugging.
- refactored JavaScript to the async/await pattern
- simplified a complex nested logic in c# with citations
- scaffolded a MySQL create table statement upon providing several c# classes. Again saved me the tedious steps of typing them out.