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

3 comments

> 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.