←back to thread

1244 points adrianh | 4 comments | | HN request time: 0s | source
Show context
kragen ◴[] No.44491713[source]
I've found this to be one of the most useful ways to use (at least) GPT-4 for programming. Instead of telling it how an API works, I make it guess, maybe starting with some example code to which a feature needs to be added. Sometimes it comes up with a better approach than I had thought of. Then I change the API so that its code works.

Conversely, I sometimes present it with some existing code and ask it what it does. If it gets it wrong, that's a good sign my API is confusing, and how.

These are ways to harness what neural networks are best at: not providing accurate information but making shit up that is highly plausible, "hallucination". Creativity, not logic.

(The best thing about this is that I don't have to spend my time carefully tracking down the bugs GPT-4 has cunningly concealed in its code, which often takes longer than just writing the code the usual way.)

There are multiple ways that an interface can be bad, and being unintuitive is the only one that this will fix. It could also be inherently inefficient or unreliable, for example, or lack composability. The AI won't help with those. But it can make sure your API is guessable and understandable, and that's very valuable.

Unfortunately, this only works with APIs that aren't already super popular.

replies(23): >>44491842 #>>44492001 #>>44492077 #>>44492120 #>>44492212 #>>44492216 #>>44492420 #>>44492435 #>>44493092 #>>44493354 #>>44493865 #>>44493965 #>>44494167 #>>44494305 #>>44494851 #>>44495199 #>>44495821 #>>44496361 #>>44496998 #>>44497042 #>>44497475 #>>44498144 #>>44498656 #
suzzer99 ◴[] No.44492212[source]
> Sometimes it comes up with a better approach than I had thought of.

IMO this has always been the killer use case for AI—from Google Maps to Grammarly.

I discovered Grammarly at the very last phase of writing my book. I accepted maybe 1/3 of its suggestions, which is pretty damn good considering my book had already been edited by me dozens of times AND professionally copy-edited.

But if I'd have accepted all of Grammarly's changes, the book would have been much worse. Grammarly is great for sniffing out extra words and passive voice. But it doesn't get writing for humorous effect, context, deliberate repetition, etc.

The problem is executives want to completely remove humans from the loop, which almost universally leads to disastrous results.

replies(8): >>44492777 #>>44493106 #>>44493413 #>>44493444 #>>44493773 #>>44493888 #>>44497484 #>>44498671 #
normie3000 ◴[] No.44492777[source]
What's wrong with passive?
replies(9): >>44492812 #>>44492911 #>>44493037 #>>44493206 #>>44493881 #>>44494192 #>>44494775 #>>44497998 #>>44504610 #
plemer ◴[] No.44492911[source]
Passive voice often adds length, impedes flow, and subtracts the useful info of who is doing something.

Examples:

* Active - concise, complete info: The manager approved the proposal.

* Passive - wordy, awkward: The proposal was approved by the manager.

* Passive - missing info: The proposal was approved. [by who?]

Most experienced writers will use active unless they have a specific reason not to, e.g., to emphasize another element of the sentence, as the third bullet's sentence emphasizes approval.

-

edited for clarity, detail

replies(6): >>44492974 #>>44493094 #>>44493447 #>>44493807 #>>44493921 #>>44496472 #
coliveira ◴[] No.44493807[source]
Many times this is exactly what we want: to emphasize the action instead of who is doing it. It turns out that technical writing is one of the main areas where we want this! So I have always hated this kind of blanket elimination of passive voice.
replies(2): >>44494137 #>>44494165 #
insane_dreamer ◴[] No.44494137[source]
The subject can also be the feature itself. active/passive:

- The Manage User menu item changes a user's status from active to inactive.

- A user's status is changed from active to inactive using the Manage User menu item.

replies(1): >>44497116 #
normie3000 ◴[] No.44497116[source]
Object-orientated vs subject-orientated?
replies(1): >>44499346 #
1. trealira ◴[] No.44499346[source]
The passive voice just switches the roles so that the patient is the subject and the agent is the object (e.g. in "The ball was kicked by John," the ball is still the patient despite being the subject). It's just that with English word order, it also switches the places of the things in the sentence.

In languages with more flexible word order, you could just switch the two without passive voice. You could just say the equivalent of "The ball kicked John," with it being clear somehow that the ball is the grammatical object and John the subject, without needing to use the passive voice at all.

replies(1): >>44503721 #
2. kragen ◴[] No.44503721[source]
While that's true, many of those languages with more flexible word order, such as classical Greek and classical Latin, also have the passive voice. Classical Greek even has a third voice called the "middle voice".
replies(1): >>44504202 #
3. trealira ◴[] No.44504202[source]
You're right. Those languages have morphological passive voice conjugations for their verbs. That, combined with their flexible word order, offers expressivity.

I was just pointing out that English, due to its strict word order, is more reliant on the passive voice to change word order than less inflexibly-ordered languages.

To borrow from a sentence I used in an earlier comment, here's a fragment of Spanish.

"...sólo porque te impresionó un espectáculo de magia barato."

The equivalent English would be "...just because you were impressed by a cheap magic show."

The English sentence has to use the passive voice to put the verb "impress" at the beginning of that phrase, whereas you still use the active voice in Spanish, just with the word order putting the verb first.

replies(1): >>44504511 #
4. kragen ◴[] No.44504511{3}[source]
I agree. The OVS order in that Spanish clause is unremarkable, though SOV is perhaps more common "un espectáculo de magia barato te impresionó". Up to the 19th century I think SVO or VOS would have been acceptable but now sound archaic: "un espectáculo de magia barato impresionóte", "impresionóte un espectáculo de magia barato", and as far as I know OSV and VSO are completely forbidden: "te un espectáculo de magía barato impresionó", "impresionó un espectáculo de magia barato te".

You can play tricks to come close to OSV and VSO for purposes of emphasis: "A vos un espectáculo de magia barato te impresionó", "Te impresionó un espectáculo de magia barato a vos," but the "te" is still obligatory. And you can do something similar in informal or poetic English: "Just because, you, a cheap magic show impressed you." But the passive offers more flexibility. I posted some other English examples yesterday in https://news.ycombinator.com/item?id=44493065.

But Spanish's inflectional structure is very much reduced from classical Latin, with a corresponding reduction in word-order flexibility. I think any of the six permutations discussed above would be perfectly valid in classical Latin, although my Latin is very weak indeed, so I wouldn't swear to it.