Live data from Hacker News

If AI writes your code, why use Python?

medium.com

981–990 of 1001 posts

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

#981

Earlier quoted context omitted.

As far as the AI is concerned, it's more like Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo versus Buffalo:PN buffalo:N Buffalo:PN buffalo:N buffalo:V buffalo:V Buffalo:PN buffalo:N I think the second one makes much more sense.

In the rare case that all your concepts use the exact same descriptive word, you are probably right! The majority of the time you can infer the type from reading well written code (to the extent that the shape of the type matters in the context of that piece of code)

You are basically rehashing the false beliefs of the codeless programming camp. Human language that is 99% correct is a standing ovation for a speech writer while it is paying a cyber ransom as the software maker.

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

#982

Earlier quoted context omitted.

But every abstraction that an LLM has to write is a choice. Your way of writing Python may not match that choice. The next run of the agent might not choose the same way. Because the language gives you many different tools, an LLM generated codebase can get inconsistent and overly complicated quickly. The flexibility of Python is a downside when you’re having an LLM generate the code. If you’re working in an existing…

To me applying LLMs to a python (or similarly dynamic) code base where it’s currently spaghetti and monkey patched, it can miss things just like I can. But… I have to admit Opus 4.7 has been very pragmatic in detecting root causes and proposing sensible fixes to bugs in this situation (ie bugs encountered in production not compile time). It’s also fine at matching current styles and conventions (which is great if the…

The larger models really are more reliable at following instruction and reasoning their way to solutions. I haven't found that the harness makes that much difference. CoPilot, Claude, Pi, all see similar results for me. What really does make a difference is clean task separation and a clear plan / todo / implement workflow. I've consolidated a lot of the way I work with agents in https://www.agentkanban.io - the task board keeps the tasks discrete and minimal. I built in plan todo implement into the agent instruction that binds the board task to the chat.

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

#983

Earlier quoted context omitted.

It's a VC backed company using "scoreboards" as a means of marketing. There is nothing scientific or academic about this, stop assuming as much.

You’re probably correct, but the problem I have is that even a lot of “scientific” benchmarks have similar issues. The whole AI benchmark landscape seems to suffer from similar issues, that benchmarks don’t appear to be matching real world experience (eg open weight Chinese models scoring super high on all benchmarks, while clearly being inferior when using in real life).

No offense, but honestly look into who are making these "benchmarks" it's all industry insiders little to no academics to be found. If you listen to actual academics on the subject they are far more realistic than what VC fools will tell you otherwise, which makes sense: one has an incentive to further the knowledge of humanity while the other wants to rat fuck the world to make a quick buck.

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

#984

Earlier quoted context omitted.

So you would find bracketed code without any use of indentation easier to read than python?

It's no more 1990, when Python was born. Editors have been automatically indenting bracketed code for a long while. Probably notepad doesn't, or maybe plain vanilla vim.

The comment I replied to stated brackets helped them more than indentation.

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

#985

Earlier quoted context omitted.

If static has won, why are dynamic languages more popular now (even since 2023). Comically, I’ve witnessed people say this since the 90s. For me, I don’t care about static because dynamic is easier. For the very few conditions where it matters, I’ll use static. Otherwise I like the simplicity of dynamic languages, especially python. IDEs provide support and jump to definitions in dynamic languages, too.

I was on team dynamic for a long time and have moved to team static. For any long-lived code base, dynamic piles up invisible problems over time. It's great for short-lived throwaway stuff, but as soon as you know you'll be maintaining a large code base for a long time, the "easier" part of dynamic actually becomes harder than just spelling stuff out. It's obviously a trade-off and not everyone agrees, but that's my…

This is exactly my experience as well.

If it were up to me, I'd start out by using the AI to port a Python web app to a compiled language like Go. Then we could maintain that going forward instead.

In reality, a Python code base is maintained by Python programmers, most of whom would vote against such a change.

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

#986

Earlier quoted context omitted.

I’m curious about the design space of languages & frameworks which are lower level than LLM prompts but higher level than Python, Ruby and Common Lisp. Do you have any recommendations for systems where reasoning about large systems is easier than in python?

You have to go into live programming, code in a system, and saving images. Readability is no longer a factor, what you want is easy access to documentation, quick navigation, and a playground.

[dead]

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

#987
I am still in love with Python since version 2 in 2000 (yes, I am so old!).

But I have already started to replace some of my compute-intensive modules with Rust ported ones, indeed with the help of agentic AI for programming, while keeping Python as a glue language tool.

Rust is basically entering my software development activity like a drug injected in small doses, ;-)

It is going to be very exiting over the next decades!

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

#988

Earlier quoted context omitted.

Very true. I have to steer models hard for C++. They constantly suggest std::variant :P

is that bad? Godbolt got a 2x speed improvement switching from what he thought was a good fast impl to std:variant https://www.youtube.com/watch?v=gg4pLJNCV9I

More fundamentally -- it creatively finds ways to use std::variant that I don't think any person would ever naturally conceive :)

And I think it's extremely fascinating, because I have absolutely no idea why. Claude can plow through my TypeScript and read my mind easy peasy, but C++? It's just a constant battle to convince it not to use std::variant.

Basically if there's any two branches of possibilities, I look forward to seeing a complicated proposal for std::variant.

And then I inevitably push back, and Claude gives the "You're right, I was overcomplicating it" and it does an if/else like you'd expect.

Maybe something about my particular repos cause that, but none of them use std::variant a single time. I also wonder if it's far more commonly used than I realize, that also occurs to me.

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

#989
post #857

Earlier quoted context omitted.

"manipulate the code in unprecedented ways" is pretty vague and of uncertain value, can you elaborate?

You need to understand the basic principles of how Lisp REPL operates. Simple example - if you're building a web scraper in Clojure, you can connect to the browser and "poke" through elements interactively, without reloading, without compiling, without losing the state. Now imagine the same principle works with backend services, e.g. we've enabled nrepl endpoint in our staging k8s service, we can modify the behavior…

You explained the magic behind this better than I ever could. But hey, I'm one of the nuschool kids on this, and we want this great language to breach escape velocity too!

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

#990
I did a project with Claude. With unit and integration tests, whole shebang. First in Python. Reached 25% of MVP and understood that I spend more time fixing subtle type mismatches (int/str, function signature vs call etc.), than adding new code. I've switched to Go (note: I've also made sure tests/frontend/backend code are built within the same context) and finished the MVP, without encountering the same problems even once.
Post reply on HN