Live data from Hacker News

If AI writes your code, why use Python?

medium.com

121–130 of 1001 posts

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

#123
you still need to look at the code oneday so id say c++ still would be a preferred target language even for ai. i know i hear a lot about rust but im still getting the idea its a niche language overall. i know people love it and point out its advantages, but sometimes good enough is good enough (i.e. c++)

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

#124
post #93

Earlier quoted context omitted.

Training data can't be the whole answer. LLMs are really good at translating to different programming languages. This makes sense, given that they are derived from text translation systems. I'm getting great results in languages with comparatively small bodies of freely available code. The bigger hurdle is usually that LLMs tend to copy common idioms in the target language and if it is an "enterprise-y" language like…

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

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

#125
post #93

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?

Training data can't be the whole answer. LLMs are really good at translating to different programming languages. This makes sense, given that they are derived from text translation systems. I'm getting great results in languages with comparatively small bodies of freely available code. The bigger hurdle is usually that LLMs tend to copy common idioms in the target language and if it is an "enterprise-y" language like…

In higher dimensional vector space, yes it can.

Dimensionality gets bizarre in 1000-D space. Similarity and orthogonality express themselves in strange ways and each dimension codes different semantic meaning.

Therefore, if the training data is highly consistent you are by definition reducing some complexity and/or encoding better similarity.

In Go the statement

    result, err := Storage.write(...)

Is almost always going to be followed by

    if err != nil { ... }
In a highly dynamic language you may not get

   try { Storage.write() } catch (error) { ... }
Unless explicitly asked for.

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

#126

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?

> I could write in brainfuck with ai, but I presume, wouldn’t get the same results than if going with python.

https://esolang-bench.vercel.app/

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

#127

The article applies to a narrow case of a totally green field application that's going to be completely vibecoded. This is the only case where you reasonably can be indifferent to what the language is, and so you can abandon familiar Python and go with unfamiliar Rust. (If you _are_ familiar with Rust, the point of the article is moot.) This "fair weather development" approach feels very risky if that application is…

You’re behind the state of the art. I’m not exaggerating when I say AI can diagnose and solve those issues for you too.

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

#128
I had agents code up an app for me in Swift a while back and the entire experience was so much better than your typical Python experience. The agents took full advantage of the compiler and static typing. There were far fewer bugs than expected.
Post reply on HN