I'm trying to do some fun stuff with scoping, but ...
# getting-started
r
I'm trying to do some fun stuff with scoping, but
ref
isn't visible on the inside:
Copy code
class Service {
    val ref = this

    class LocalBinder: Binder() {
        fun getService(): BluetoothBackgroundService {
            return ref
        }
    }
}
v
inner class
iirc
r
Yup, thanks!
👌 1
Ok, wtf. ChatGPT gave the same correct answer. I think I'll go ask it first next time.
v
That was pure luck. ChatGPT is just a nifty toy, nothing more. I've seen it multpile times nice looking code, that could never ever compile as it uses methods on APIs that never existed and so on, or write move reviews with facts it simply invented as similar sounding sentences were used in similar reviews to totally different movies. Besides that it does not know things happened the last two years. So be very careful with things it tells you
k
I’ve been asking chatgpt some stuff first as well, feels like it’s super useful only 1/10 times in my experience. I still ask it because if it’s a nasty one then it can really be a joy to have it fixed, but sometimes it even says “add library X with version Y” and the X is the incorrect library name and if it would be correct then version Y was incorrect…
l
I got an email a few minutes ago that they’re going to announce GPT-4. It’s supposed to do better with reasoning/logic, but I’ll believe what I see.
I’ve found ChatGPT to be most useful when I know little about a specific domain, but know the language well. I can read docs to see that a method doesn’t exist, but the high level ideas are generally right. I had it write me a ffmpeg program (which I know well enough to validate) in Kotlin/Native, and it seemed correct, except for cases where it translated C’s
struct Foo; init_method(&foo);
into
CPointer<Foo>? = null; init_method(foo)
, which is wrong. But I know enough about Kotlin/Native to see that and replace it with the correct details.
b
ChatGPT is the implementation details of Dunning-Kruger if it were an
interface
.
🤣 1
l
I would ask whether it really needs to be 100% right the first time to be useful to me as a dev. It’s not there yet, but if it reaches a point where the result is good enough that I can identify and fix issues faster than I could have written the code myself, it’s technically useful.
👍 1
k
The dumber the task though the higher the chance of success, you could give a big chunk of UI and prompt it to rewrite it in a different way and chance of success is rather large with that. At least I remember I was very happily surprised by it. It's something I'll be rly happy about when idd improvements come 😅