Hacker News new | ask | show | jobs
by prepend 35 days ago
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.

5 comments

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.

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 personal experience having run large eng teams for both types.

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.

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”

When I was working on large python code bases, a full 50% of my time was spent dealing with tests failing because:

* someone assumed duck typing where it wasn't or the inverse. Or changed the assumed interface of a duck.

* somewhere doesn't handle None properly even though it's a valid agrument.

* making sure every function properly checked that the input parameters were valid and generated a meaningful error message

* making sure side effects of the ducks and the meta-bs didn't break other things

AKA all type related nonsense.

With go, and even more-so rust, the time the compiler saves me by obviating all that type related testing is far larger than the time spend dealing with the type related testing. Even when you factor in the extra time twiddling with types adds to the coding. And don't get me started with the whole "deal with type bullshit in dynamic languages" mess that occurs when a bug slips through into prod....

It's sort of an open question how LLM authored code will stand up over the years/decades. It's a lot of code, but maybe the capabilities for reading lots of code will also improve, or maybe the way human shops can snarl up in giant balls of mud that are terrifying to work on, the rate of change for a given system authored by LLMs will show an S-curve shape rather than staying responsive to changing conditions or whatever.
Programmers, at least the mass market programmers, have optimized for ease of writing code for many decades. It's a natural urge, but in the long run for successful applications, it's more important that code is readable and maintainable. As the years go by the initial cost of tapping out the code becomes more and more negligible.
They are? Nobody writes JavaScript anymore. Everything is Typescript. Even PHP and Python have sort of back ported type annotations. What major language is still purely dynamic these days?

I know the whole dynamic vs static typing is an age old flame war, but it sure seems that static is winning to me.