Hacker News new | ask | show | jobs
by enraged_camel 45 days ago
>> AI rarely seems to write better code than humans.

This assertion is at the crux of a lot of these debates. Fundamentally it depends on what is meant by "better code", does it not?

Code that is bug free? Frontier models are inarguably better at that, because they can think of far more edge cases and test each one much faster than you can. You can argue that its code and surrounding tests are frequently overkill, but that's a dial you can tweak until you're happy.

Code that is performant? Frontier models are inarguably better at that too. They can create a benchmark harness and run it over and over to optimize the code they wrote while you're still poring over the docs on which method of iterating over a list is faster.

Code that is secure? Frontier models are also better at that, for the above two reasons: they can create complex security vulnerability plans and run swarms of agents to audit the code and attack the system that runs that code until it's like a god damn fortress.

Code that is easily understood by humans and fits coherently with the rest? I think humans are better at this still, because humans are definitionally the best at understanding what is easily understood by humans. I posit that this definition of "better code" is quickly going out of fashion though.

1 comments

> Code that is bug free? Code that is performant? Code that is secure?

I have found that on the level of an individual function, this might very well be the case. On the level of an entire system, it very quickly falls apart and you get a lot of redundancies which cause security, bug and performance recessions, because nobody has really solved the issue of AI understanding whole systems at the time of inference.

I think it goes beyond individual functions. AI is capable of building complex features in a coherent manner. But it has trouble realizing those features exist as part of a larger system and need to fit upstream and downstream workflows. IMO that's where human engineers come in.