Found another absolutely wonderful use case for ChatGPT. I was sitting today, doing code review, as usual. I feel something's not right, some solution turned out too coupled, dependencies spread, Android dependencies leaked where they shouldn't.
As a good reviewer, you in principle always spend quite a lot of time to suggest some alternatives, direct to some more successful solution. Without context and without understanding the code, it's not so easy to do, just from experience there's some intuition that right here it could have been better. Here you could clearly take all this ugly configuration and Android SDK horrors and put them behind a simple and clear abstraction.
I wrote by hand an absolutely clean and beautiful interface without unnecessary Android dependencies, everything as we love, a few lines of code. And I say, ChatGPT, write me an Android-specific implementation of this interface. It did it just amazingly. I'm not even sure if I need a developer now, heh. Passed Context in the constructor, understood that I need to wrap a broadcast receiver in a coroutine there, registered for it, unregistered where needed according to the coroutine scope, just a miracle.
For ChatGPT, the more constraints, clarifications and instructions the better. This was noticeable even from regular text queries. You, a smart person, set these boundaries. It, a smart machine, acts within these boundaries and gives you an amazing prototype, which you can also fine-tune with subsequent queries. I'm not sure if it generated the correct code for me, if it will compile, that's not the point, this is a gorgeous tool to elaborate your thought in more detail in a comment to MR, suggest a visual option.
But there's a nuance. If I were stupid, this probably wouldn't help me much. I just know how to write such an interface so that it's even possible to write such code for it. If I wrote at least a couple of key words in the interface itself wrong, the result would be much dirtier and more unpleasant. In general 10 out of 10, I recommend, saves a lot of time.