3 ms·
> In Python I run into a lot of programmer related bugs that Haskell's rigid type system prevents. Isn't your productivity gain coming from using a statically
by laureny 14y ago
> In Python I run into a lot of programmer related bugs that Haskell's rigid type system prevents.
Isn't your productivity gain coming from using a statically typed language rather than Haskell specifically? It feels like any statically typed language is a leg up from Python :)
- freyrs3 14y ago> Isn't your productivity gain coming from using a statically typed language rather than Haskell specifically I think it's a bit more than that, Haskell has a much more sophisticated type system than quite a few of the popular statically typed langauges ( C, Java, C# ). Static typing is only the start, to be really useful we need modern type inference methods and a concise way of expressing generics. Both Scala and Haskell do this very well.
- mightybyte 14y agoPurity is a big factor too, and Haskell is the only pure language I know of that is mature enough for production use.
- codewright 14y agoAre we still spreading that canard where type errors are somehow some kind of bugbear in Python? It's not a profound part of writing code in Python for anybody that's spent more than a few weeks with it.
- mercurial 14y agoA profound part? Maybe not. However, I noticed yesterday that a provisioning tool I wrote was blowing because I was assigning by mistake an empty string coming from a CSV instead of a None value to an integer field in an sqlalchemy model. That's a bug a static type system would have found.
- donri 14y agoAlmost every exception a Python program ever throws is or can be made a type error (or otherwise statically caught) in Haskell and similar languages. A type error is not the same thing as a TypeError.
- sbmassey 14y agoWhen someone dumps a large Python codebase on you, it is significantly harder to figure out how it works than with a statically typed program, since it is harder to figure out what types to use and are returned by any given function call.
- merijnv 14y agoIt depends on what you mean by statically typed language. If you mean other stuff like SML/Ocaml, I agree. If you include C/C++/Java/C# in your definition "statically typed", then I beg to differ. I have considerable experience in C, Java and, to a lesser extent, C++. And all in all I consider their type systems worthless for error prevention, the flexibility of python gains you more than their type systems do. In this sense I suspect the OP would say the same about any ML-like static type system, but not many other static type systems.
- cies 14y agoin though statically typed meant C++ or Java, and probably it does.. i never felt compelled to the way they do typing, so i gravitated towards Ruby and Python. but to me Haskell is a different league.. Haskell-typing actually helps /me/, where i feel C++/Java-typing merely help the compiler.