Live data from Hacker News

If AI writes your code, why use Python?

medium.com

891–900 of 1001 posts

Re: If AI writes your code, why use Python?

#891
post #651

Earlier quoted context omitted.

Haskell would be my vote, and Rust too, actually, both because of their very strong type systems. The type system lets you very quickly figure out what something is before you figure out what something does , and it turns out that separating those two concerns as hard as those two languages do often results in doing the whole one-two punch faster.

Bit of a nit, it isn't the strong typing that makes Rust great for LLMs, it's the very strict compiler. Plenty of languages have strong (enough) typing but their compilers happily let you or the LLM footgun yourself.

Same reason Zig is great for LLM's

Re: If AI writes your code, why use Python?

#892
post #759

Earlier quoted context omitted.

the trend is AI also does the code review. Too many anecdotes and studies showing AI is a better code review that a human and the models are just going to get better. Whether we get better results if AI reviews Python or Rust I'm not sure. But I suspect Rust will win out as the training data likely has more content around Rust correctness and language usage than Python does.

You must have a low bar for human code review. I've seen that in practice too. But I've also been on teams that took code review very seriously, and frontier AI really doesn't come close to a good human code reviewer imo

They're complementary. AI reviewers are bad at spotting inappropriate architecture patterns and unnecessary verbosity, but they're very good at identifying various types of complex logic bugs and detecting mismatches between code docs and implementation. They add substantial value.

Re: If AI writes your code, why use Python?

#893

But under this frame, it appears that the developer's task involves prompt engineering. This is not the case. Even if an agent generates 90% of the code, each and every diff is going to be in my review queue. Code readability of Python isn't an advantage during write; it's an advantage while reviewing. As an agent generates a piece of code, I will have to read the code, comprehend the code, and determine whether it d…

except this will go away. we will likely reach a point sooner rather than later (I think 2027) where it will be infeasible for humans to review the code. This will happen at startups first rather than big corps obviously and the engineers who design systems (dark factories) fully leaning into this will have a huge advantage. And yes there are exceptions to this and a play on the other side but the this is where the b…

This has already been happening since the last 8 months according to many people who work in startups with greenfield code.

Re: If AI writes your code, why use Python?

#894
post #508

Earlier quoted context omitted.

That was the hardest part of learning PHP, all the code examples online were just awful.

Worked on a PHP project once. Every time I asked why something was done a certain way the answer was "dunno, we copy pasted this code snippet." Certain popular PHP codebases appear to use a similar methodology.

It's why I consider PHP to be "RCE as a Service".

So much copy/pasted code, some of it REALLY bad, and PHP has a lot of foot-guns that can lead to RCE.

Re: If AI writes your code, why use Python?

#895
Why not have the LLM go straight to LLVM IR? What would a program look like when you remove all (or most) of the layers of abstraction needed by humans? Or are LLMs too contaminated by the training data to do this? I almost wish I could try this.

Re: If AI writes your code, why use Python?

#896

As always, "it depends." I'm using coding tools to build a complex media-intensive application. The approach I'm taking is to build a _reference implementation_ in Python, which is in its design specifics, constrained to use patterns which transliterate into the actual deployment targets (iPadOS/MacOS/Web). Why start with Python? Because I can read it, reason about it, and run it, trivially, which are Good Things for…

One can use a language as a sort of prototyping tool. I've once or twice done an implementation of some algorithm or idea in python and worked through all my conceptual errors and then done it again in C.

I think it was a hell of a lot easier than working through all that change in C first.

Re: If AI writes your code, why use Python?

#897

Earlier quoted context omitted.

But what is the selling point for Go? I get that it is allegedly hailed to be a simple language with basically no batteries included, but why is that a selling point? Does Go excel at anything no other language does?

Go has a very full featured standard library. It's simple (do you really ask why that's a selling point?) It's fast to compile. It's fast to run. It's good with parallelism. It has myriads of examples, and LLMs can pick it up well too. It has good backing. It has good tooling. It's fun. It statically compiles to a trivially deployable binary. It's excellent at cross compiling. It has good adoption.

Fun it is not.

    if err != nil
It's amazing how they managed to design a new language with all the flaws of '90s languages.

Re: If AI writes your code, why use Python?

#899
In this paper AutoCodeBench https://arxiv.org/pdf/2508.09101 LLMs seemed to do best on the strongly typed and functional language Elixir. This is surprising since there isn't very much training data. However the examples that it's seen are usually high quality and there aren't a large number of different way of doing the same thing in Elixir.

Re: If AI writes your code, why use Python?

#900

Earlier quoted context omitted.

Surprisingly, LLMs are actually much worse at reasoning in Python than other common programming languages for agentic coding tasks. Data here: https://gertlabs.com/rankings?mode=agentic_coding

Cool to see my hunch be backed by data. Python is a scripting language with OOP bolted on. Means there’s not really a styling consistency that other languages have, with things tending to look like PHP, a collection of various scripts that invoke one another

They don't tend to look like that. Grab any one of the packages people use in Python at is generally well-disciplined OOP code.

There are teams of people who don't come from an engineering background who do utilize Python as a series of scripts with some extra sugar. Just because you can do that doesn't mean that you should.

Post reply on HN