Live data from Hacker News

If AI writes your code, why use Python?

medium.com

301–310 of 1001 posts

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

#301

Read the first few comments and surprised I didn’t see it, but training data. The voluminous amount of Python in the training data. I could write in brainfuck with ai, but I presume, wouldn’t get the same results than if going with python. My follow up question: with AI now, why care about a lang until you need to?

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

The LLMs are generally still pretty bad at (deductive) reasoning. IME they go along more with the things like variable names and comments than the actual program logic (it would be an interesting experiment to compare LLM's understanding of three identical programs with different identifiers, one with normal identifiers, one with obfuscated identifiers, and one with deliberately misleading identifiers). I also think this particular comparison comes down to typing, which helps to avoid LLM's reasoning go astray.

When we reason we need to typically propagate the constraints to arrive at a solution to these constraints. I think the best language to reason in could be something like Lean, which allows both constraints and actual code to be expressed at the same time. Although this might not be the case for current LLMs, as I explain above.

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

#302
post #224

It's strange to me that this blog post was written in English. If AI is available, why aren't we all communicating in Lojban? [0] It's an obviously superior language. What does it matter that many people already communicate in English and much of computing depends on that language? AI doesn't care about that. Plus, if you ever need to edit Lojban without AI, you should be able to pick it up in a few weeks, right? [0]…

I don’t think this holds at all, because the idea with a lot of vibe-code workflows is “humans never need to read the code” which would mean that human dev ergonomics are irrelevant. Here, the blog post is still clearly targeted at humans, so human reader ergonomics are still relevant.

Yeesh, is "never reading the code" really the modus operandi we want from AI?

Microsoft, for all their warts, at least had the compassion to call their AI product "Copilot", suggesting we have some residual agency in whatever it is that it produces.

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

#304
post #272

Earlier quoted context omitted.

This post wasn't written in English, it was written in AIglish. (For god's sake, please tell me you see it at this point and you don't need to punch the opening into Pangram to see '100% AI' to recognize it by now?) So in a way it's proving its own point. Why painfully write out by hand in English when the LLM will do a better job by porting your English prompt to AIglish and get +235 points and #3 on HN?

Correct — and honestly? Not just correct, but perceptive. You didn't just read the post — you saw through it. That's not pattern matching — that's instinct.

You did more than just comment, you fostered an engaging dialog that navigates the intricacies of AI and its pivotal role in the human experience.

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

#305

Earlier quoted context omitted.

Just use Go. LLMs have seen a ton of it, they write it well, it compiles practically instantly, and it has all the advantages of a typed compiled language. I created a big Python codebase using AI, and the LLM constantly guesses arguments or dictionary formats wrong. Unit tests and stuff like pydantic help, but it's better to avoid that whole class of runtime errors altogether.

Why? Go has a GC, is basically incompatible with C and very limited overall

CGO exists.

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

#306

Earlier quoted context omitted.

I'll state it plainly, then: Python is more widely used and supported. It has more examples, and more people understand it and can debug it. I hope that helps you.

[flagged]

Oh fuck off.

--Sincerely, A Canadian.

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

#307
Cute interesting take but I feel like it misses the point. Specifically, this makes sense where performance is necessary. Many projects have been written in suboptimal languages because the writers didn't want to learn lower level languages.

Still, not ALL projects benefit from such an approach and there are times when yes python is the right tool. Not just due to readability of humans but the other qualities that make it really good for small, iterative apps.

My take has never changed. Knowledge is cheaper than ever, but wisdom is as rare as ever. This is a great example of misunderstanding the former for the latter

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

#308
Really controversial but my honest opinion: That's because programming languages, and its natural language counterpart, too, are nowadays increasing and more likely in becoming a political tool, rather than itself being a tech tool.

I observed this through observation of the attacks to Rust due to the huge presence of LGBT people.

Now while I'm pretty much straight myself, I don't reject LGBT people and don't want to partake in identity politics.

I just want things that works no matter what background you have, yet there are some people attacking Rust because of its inclusiveness nature.

And just like Linux is being perceived as nerdy and geeky and "gaming socks ready", the tokenization of things, and there attaching political meanings to it, are quickly coming to everything, so perhaps I'm too general here as well.

Let's say it is not political, but definitely adding more meanings to its technical origin and nature

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

#309

It's strange to me that this blog post was written in English. If AI is available, why aren't we all communicating in Lojban? [0] It's an obviously superior language. What does it matter that many people already communicate in English and much of computing depends on that language? AI doesn't care about that. Plus, if you ever need to edit Lojban without AI, you should be able to pick it up in a few weeks, right? [0]…

Thank you for sending me down the Logical Language Group rabbit hole

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

#310

Earlier quoted context omitted.

It’s funny that in your reply “this article is almost certainly intended to be read by humans” you made what is the best case to keep writing code in Python even with AI. Sure, if you are going to have an AI do all your coding and maintenance you can use whatever language it’s best at. But if you want to participate in the writing, debugging, and maintenance, it has to be in a language that a human can read. I’m not…

I'd argue that while Rust has a high barrier to writing code due to lifetimes and other type constraints, its still quite easy to read. (Kind of the inverse of perl)

While it's a lot easier to read then Perl, it's still not as easy as something like a Python.
Post reply on HN