Live data from Hacker News

If AI writes your code, why use Python?

medium.com

451–460 of 1001 posts

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

#451
post #63
post #2

Bit off topic but why in the world are people still posting on medium? The reading experience is abhorrent; I couldn’t even finish reading this article before a full screen popup literally blocked the sentence I was reading. Is there some incentive I’m not seeing?

They have made an honest attempt to pay writers. It's a different model than substack, but that's why. I look at it the same way I look at pay walls for newspapers. I don't like them but I understand why they are there.

Which is why it failed though. It turns out people won't pay one dollar to read an article like "If AI writes your code, why use Python?"

The situation is very unfortunate. We had perhaps once-in-a-lifetime chance to solve micropayment but we fucked up (crypto).

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

#452
post #445

Earlier quoted context omitted.

> I observed this through observation of the attacks to Rust due to the huge presence of LGBT people. Never seen that before, but then again I'm not in the rust community. > don't want to partake in identity politics. If you write Rust, or let AI write rust, do you have to partake in the identity politics? The internet is full of memes and jokes on how shitty Java and Java Script. Yet it came never up at work. Never…

> Never seen that before, but then again I'm not in the rust community. As a straight guy, number of times people attacked Rust for catering to "that crowd", "DEI-language", and "woke mind-virus" has been pretty huge on Xitter. Which is always hilarious to me, since language itself doesn't have anything offensive. > If you write Rust, or let AI write rust, do you have to partake in the identity politics? Answer is of…

Fascinating.

> However by choosing to write it you'll be perceived as anti-Zig, anti-C, pro-woke, etc.

I don't even know what zig or C is. (Please don't tell me) Edit: Oh, C the language. From context I thought it was short for something on the anti-woke site :)

But who is checking what language you are vibe coding at? And does it matter to you that those people perceive you as anti-zig?

There is probably someone on Xitter who thinks me not using VIM is just plane wrong, but that has no influence on me. To be completely honest, this all sounds like a non-issue.

I mean there is also an anti-ai crowed (r/antiai) but who cares what people on the internet think?

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

#453
One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get.

If you're using an LLM to write code I think the rules would be

1. Use a language you know really well so you can read it easily, and add to it as needed.

2. Use a language that has a large training set so the LLM can be most efficient.

3. Use a language that is easy to read.

If your language has a small training set or you don't intend to do much addition or you don't really know any language that well or are restricted from using choice 1 for some reason, 2 and 3 move up, and python has a large training set and it is easy to read.

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

#454
post #232

Earlier quoted context omitted.

1. Amount of Rust training data isn’t as much as Go. 2. Golang syntax and style is very verbose yet simple. There’s not as many options nor programming language to domain mapping needed as in Rust. Leads to needing less sophisticated LLM to spit out Golang than Rust successfully and efficiently.

This must really depend on your niche. I assume you do web stuff or something? Good luck finding any golang examples in a lot of other fields. Rust, on the other hand, is taking over the world in systems programming.

>Good luck finding any golang examples in a lot of other fields.

There are go examples (and full blown programs) for anything, from servers to Kubernetes and Docker.

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

#455

Earlier quoted context omitted.

why,i have same question

I’m heavy into rust and never really use golang, but one big benefit of go over rust is compile times are significantly quicker, which could be more fun if you’re running CI checks 50 billion times

>which could be more fun if you’re running CI checks 50 billion times

Even running them 5 times it's WAY more fun

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

#456

One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. If you're using an LLM to write code I think the rules would be 1. Use a language you know really well so you can read it easily, and add to it as needed. 2. Use a language that has a large training set so the LLM can be most efficient. 3. Use a language that is easy to read. If…

Python is locally readable. Reasoning about larger systems in Python is where things get really hard, because you have to describe how many small individually readable things interact with each other in a very limited vocabulary.

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

#457

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.

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.

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

#458
post #323

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?

No batteries!? Go has a huge stable standard library no other language even comes close to. Built in tooling for unit testing, performance testing, debugging, code formatting, package management, etc. And most go binaries can be compiled statically so libc is not even a dependency. Golang is the definition of batteries included.

>Go has a huge stable standard library no other language even comes close to

Well, Java and Python do.

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

#459
post #188

Earlier quoted context omitted.

For one thing it’s statically typed and has many fewer foot guns than Python, so the llm-produced code is more likely to do what you expect.

Go is statically typed but the type system leaves much to be desired. Go’s benefit are primarily around simplicity, readability, and concurrency.

>Go is statically typed but the type system leaves much to be desired.

Not that much. Looking at Rust or Haskell complexity, I don't really desire it.

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

#460

One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. If you're using an LLM to write code I think the rules would be 1. Use a language you know really well so you can read it easily, and add to it as needed. 2. Use a language that has a large training set so the LLM can be most efficient. 3. Use a language that is easy to read. If…

Python is locally readable. Reasoning about larger systems in Python is where things get really hard, because you have to describe how many small individually readable things interact with each other in a very limited vocabulary.

That’s true. Once you have APIs and want to use classes to create larger structures, the language is full of warts.
Post reply on HN