Hacker News new | ask | show | jobs
by xapata 3566 days ago
> there is high probability that my code will work correctly right away

I'll bet my Python code has a similar probability of working correctly on the first run, conditioned on the complexity of the task.

3 comments

Actually, based on my experience, what I found most remarkable about writing code in Haskell (which I admit I haven't done much of) is that I'd spend an enormous out of time wrestling with the compiler, but once I finally got all the type errors to clear out, the odds were surprisingly high that the code would "just work", which is not an experience I had with even other compiled languages (Java, C#, etc).

'course, it probably wouldn't work fast, and it was 50/50 whether I'd introduced space leaks, but...

> I'll bet my Python code has a similar probability of working correctly on the first run, conditioned on the complexity of the task.

Having developed professionally in both Python and Haskell, the probability for me was significantly higher in Haskell.

> conditioned on the complexity

Indeed, difference in complexity is the key here.

I'm confused. Are you agreeing with me?
It's a back-handed agreement. Static typing increases value with project complexity and head count. So yes, if you only ever do small tasks with low or singular head count, then dynamic typing probably works OK for you.
As complexity increases, the probability approaches zero that any code works exactly as desired on first execution. I'd still take that bet. Of course, I'd have to be able to use the REPL about as often as a someone uses a compiler.