Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Funnily, GPT-4 seems like it generates pretty bad C code but pretty good Python code.

The C code will have silly things, like bad style or `double d = malloc(sizeof(double))` (instead of `double*`), which makes it evident that its training data was full of pretty bad C code. Which makes sense since most C code out there, like on StackOverflow, is bad. Same with Bash code.

The worse quality of code available in these langs suggest to me that these langs are inherently more difficult, which means people are more likely to be bad at them.

Whether they deserve blame for that, or whether it disqualifies them as legitimate technologies, is subjective. Objectively, though, you're accepting a higher rate of failure by using them over less difficult alternatives. If "good <X>" colloquially means "<X> with high likelihood of generating desired outcomes" and "bad <X>" means "<X> with high likelihood of generating undesired outcomes", I think it's fair to call both "bad langs". ;p



view as:

> Funnily, GPT-4 seems like it generates pretty bad C code but pretty good Python code.

Back when OpenAI had code-specific models based on GPT-n they were generally specifically advertised as best at Python; I suspect their coding-related training data and human feedback on coding tasks all favors Python by a significant amount (and I supect that that actually gets reinforced by positive feedback, since this makes it most likely that they get used with Python over time, too.)


:o Huh. I guess it's not a fair sampling of code out in the wild then.

> Funnily, GPT-4 seems like it generates pretty bad C code but pretty good Python code.

It's only a matter of time. And likely not a lot of time.

I asked ChatGPT to write a fast CRC-16 calculation algorithm in ARM assembler given a set of preferred registers and other constraints. I compared it to my own code, written a while back. Not too bad.

It wasn't clever about using assembler tricks experienced assembler coders understand, yet the code passed my test suite. My code was much faster because it was written with the benefit of experience that had me reaching for optimizations ChatGPT did not.

The interesting part was when I asked that it modify the code to work with a different buffer structure and be able to compute CRC-8, CRC-16 and CRC-32 with various modifiers.

It did it in just a few seconds. The code passed 100% of my tests. Not super fast or efficient, but it worked. I remember when I had to do that myself with my own code, it took over a day.

This is today, mid 2023. Give it a year or two (maybe less?) and it will be a tool to contend with. People who like to blame everything else rather than their lack of knowledge and experience will not do very well in that world.

Why would I pay someone to do <X> when they bring nothing special to the table?

Here's the huge paradigm shift (at least for me):

I could not care less what someone knows or does not know. I care about the range and breath of their experience and how they approach learning that which you do not know.

Someone like that can use any available tool, including AI tools, to deliver value in almost any domain. Someone who blames others (tools, people, the system, whatever), cannot.

We might just be entering an era in which experience will be shown to have serious value.


Legal | privacy