News for hackers. Stuff that matters.
Re:Lisp and Haskell (2015) by Kednicma on Thursday October 08, 2020 @10:32AM (#24719384)
And Python provides readable syntax. Your example has an easy-to-spot bug, just from reading the code and knowing Python's semantics. Haskell's "programmable semicolon" ends up being a problem here because, thanks to typeclasses, the programmer usually does not know which semicolon they are programming under!

"Python provides many tools that can be used to solve programming woes. One such tool is its strong and readable syntax." Do you see how empty this sort of platitude is?

Re:Lisp and Haskell (2015) by gtf21 on Thursday October 08, 2020 @10:54AM (#24719620)
I don't think that illustrates that promotion of the type system as a useful tool is an "empty platitude". A well constructed syntax is certainly a nice feature of a programming language. One might say a language like brainfuck does not have a syntax which makes the code easily readable, and therefore is the worse for it.

Similarly, one might say that a strong type system is a useful tool. That doesn't make it a panacea (and I don't think that this was the claim), but that doesn't mean one can't appreciate it as a good tool.

Re:Lisp and Haskell (2015) by ghostwriter on Thursday October 08, 2020 @11:30AM (#24720052)
The problem with this comparison is that readable syntax is a subjective notion, whereas type system is an objective thing that can be evaluated based on its strictly defined boundaries - it's either possible or impossible to encode all required software specification with a provided type system, and if something is not possible, we know exactly what are these things that don't fit into the type system, and therefore we cannot rely on the compiler to prove their correctness.
Re:Lisp and Haskell (2015) by wk_end on Thursday October 08, 2020 @01:16PM (#24721362)
Er, the difference here is that we're given the Python code for `getUsers` but not the Haskell code for it. That makes the error in Python obvious. The incorrect `userCount` in Python looks just as obviously correct as the incorrect `userCount` in Haskell; and conversely, if we were given the code for the Haskell `getUsers` (or even just the type signature!) the error would be just as easy to spot.
Re:Lisp and Haskell (2015) by tome on Thursday October 08, 2020 @10:37AM (#24719438)
I didn't intend to make this into a competition between Haskell and Python.