Top
Best
New

Posted by indigodaddy 1 day ago

If AI writes your code, why use Python?(medium.com)
889 points | 941 commentspage 13
pyrale 23 hours ago|
If ai writes my code, the code is the documentation/context.

Why use any programming language, if we’re going to be maximalists?

mtoner23 23 hours ago|
Because programming languages are the clearest way we can write down instructions for computers to execute without ambiguity.
Koshkin 21 hours ago||
For some reason it took a while for Copilot to write an executable machine code for Hello World.
isaisabella 1 day ago||
Really agree. Python is popular because it's easy for human to implement. But now if the coder becomes AI, then Rust would be preferable for agent, just like Python for human. In addition, it brings better performance.
jkausti 1 day ago||
Python has during the recent years become unnecessary complex and especially the type hints system is so dumb and already have a lot of legacy syntax that confuse AI agents.
prepend 23 hours ago||
Because I want to be able to read and debug it.

Giving up ever understanding your code with AI is a bad idea.

It’s like asking why use English.

brainless 1 day ago||
I build all my projects with Rust and Typescript (https://github.com/brainless). I had started learning Rust around 2023 but was progressing very slow. Since I left writing (or even reading) code line by line about a year ago, I build exclusively with Rust and Typescript. API types are generated from Rust. All my projects have a shared-types folder with a utility to generated Typescript types. I have a template that I use for each of my projects: https://github.com/brainless/rustysolid.

I am from a Python background (11 years or so), PHP before that and C/C++ in college days. Rust works very well with coding agents. The amount of code in training data may be less but I would rather have the agent fight the compiler. Given that OpenAI and Anthropic seem interested in Rust, chances are that there is a ton of synthetic code generated with Rust.

nraynaud 1 day ago||
Funny, along the same lines I asked an AI to write some wasm text. It was ridiculously bad and I had to intervene heavily to get something working as intended.
semiquaver 1 day ago||
Great question. And I don’t think that Python, Ruby and PHP have a good answer. Scripting languages cater to human weaknesses. The 10-100x perf cost was never really worth it but now it’s impossible to justify.
throwaway2037 1 day ago|
One question I have asked myself many times: What if Python had a strictly-typed mode? (It would require strict type hints/annotations.) Or there was a well-maintained branch that enforced strict types. I also thought that Python is a beautiful language, but the weak(er) typing is such a no-go (for me, personally) and causes ridiculous slowdowns at runtime due to this type flexibility. Finally, I know the answer why it has not been done: The ecosystem of 3rd party libraries is far too large to impose such a requirement. It would be the Python 3.0 upgrade all over again that took more than ten years to complete.
v3ss0n 1 day ago||
So you are not going to review code? So you are not going to modify code? How many cases that AI Can always modify code correctly without human input?
jmward01 22 hours ago|
Language wars are, in a word, silly. You use the language that your team knows best 99% of the time. All the arguments about performance and safety have fallen flat for me because the majority of times performance and safety are most impacted by complexity which is driven by how good people are with a language more than the language itself. I have seen rust and go that the team was uncomfortable with that led to slow and unsafe results where the same team could have shipped faster and safer python. Additionally, per line speed is driving actual performance less. Is that web page load slow because of python or the 16 API calls to LLMs and other big services you are making? Did switching to rust speed those calls up 10 or 100x? So the opening arguments are predicated on an assumption I don't accept. rust isn't 10-100x faster, it -can be- when rendering a fractal for fun but in practice is it?

To answer the title question though, why use Python? I think Python and higher level languages will become even more valuable since pairing up with code assistants requires keeping a higher level view of what is going on. You want to avoid the weeds, not emphasize them. You want the language used to be as easy for the human as possible so the human can stay involved. That means that my opening argument stays intact, use the language that the team knows best 99% of the time and only when needed force a language that is 'faster' when that is actually required.

More comments...