Live data from Hacker News

If AI writes your code, why use Python?

medium.com

851–860 of 1001 posts

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

#852

Earlier quoted context omitted.

It seems clear to me from first principles. Humans are trained on human language. LLMs are trained on human language. Thus something that is easier for a human to understand is likely easier for an LLM to understand. That higher level language with well named variables reads more comprehensibly than code:VERB with:PREPOSITION types:NOUN, intermixed:ADJECTIVE, stems:VERB from:PREPOSITION first:ADJECTIVE principles:NOU…

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)

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

#854

The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…

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 mostly use C++ at work, but I love ruby for its expressiveness and use it all the time for small to medium sized scripts where performance doesn't really matter.

However I've definitely noticed that the larger a ruby program gets, the more likely I am to manually add type checks. Beyond a certain size I simply can't fit everything in my head at once. Even though these checks are still done at run time, debugging is much easier when I can find out ASAP when something is not what I expected it to be.

People often say "that's what tests are for!". But if I'm spending time writing tests that verify the types are correct, I see that as a waste of my time because that's exactly the kind of thing that a compiler could do for me in a statically typed language.

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

#856

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)

[deleted]

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

#857

The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…

Hard disagree, LLM's benefit from jacking in to the powerful nREPL dynamic languages in the Lisp family like Clojure, letting the agent manipulate the code in unprecedented ways.

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

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

#858

The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…

Strong typing has clearly won. However, verbose typing is likely a negative for LLMs. Algorithms written in "pseudo-code", aka a higher level language without type information, are far more readable to a human, and thus likely an LLM too. In regards to control flow and general concept of what code is doing, types provide very little info over well named variables. In fact they often impair understanding by breaking u…

I think Java shows that too much naming is a horrible idea even if there is a good type layer. It's exceptionally easy to have homonyms and other problems that feed errors in LLMs and if every mix of nonsense runs that's all the worse. Add to that attempts to put many English words together and there are no way points left. Everything is an exhausting essay by Dickens where two very long sentences are subtly different (to look at but not in results.)

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

#859
post #794

Earlier quoted context omitted.

> The static vs dynamic language debate is decisively over and static has won I wouldn't be so fast. It wasn't that long ago that the dynamic zealots were declaring victory. And before that the static zealots. And before that the dynamic zealots. Going back decades.

That kind of back-and-forth dynamic ideally ends up with something combining the best parts of both approaches. Is anything like that happening?

I agree and I believe that's what has been happening. In another post I mentioned an increase of type inference & related technologies. For instance, one annotates the type signatures for inputs & outputs of a function as well as any tricky constructs for readability, but doesn't bother with "int x = 5".

Reduces manual boilerplate and visual noise while retaining static typing semantics.

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

#860

Earlier quoted context omitted.

I think most people agree with you -- that's why. Also because I'd say most programmers don't care much about maintainability or quality. I personally find that AI writes better Scala than Python.

Before AI, I used to say types reduce quality by wasting dev time that could've been spent on testing. They may also encourage overly complex code. With AI, I don't know. If we're forced to use types, the AI does that work for me, but that added verbosity can't be good for it.

> could’ve been spent on testing

To me, this argument sounds similar to “making salads to eat reduces health because they waste time that could’ve been spent on working out” - it assumes the time savings will be spent on working out and not on sitting on the couch.

In the case of SWE, any time saved will always be spent on “2 more features we think we can ship this sprint if we deprioritize these pesky ‘additional tests’ tickets - don’t worry, we’ll circle back to those next sprint of course”

Post reply on HN