Haskell v Ada v C++ v Awk... An Experiment in Software Prototyping Productivity
haskell.org
haskell.org
> The Haskell Report was given to a newly hired college graduate, who was then given 8 days to learn Haskell. This new hire received no formal training, but was allowed to ask an experienced Haskell programmer questions as issues came up during the self study. After this training period, the new hire was handed the geo-server specification and asked to write a prototype in Haskell.
A college student who had just started learning Haskell eight days ago managed to put out a very credible prototype! Clearly, Haskell is by no means impossible to learn.
We describe the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center (NSWC) requirement for a Geometric Region Server. The resulting programs and development metrics were reviewed by a committee chosen by the Navy. The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++.
http://haskell.cs.yale.edu/wp-content/uploads/2011/03/Haskel...
This hard fact says more than thousand committee reviews.
Pen and paper are my debugging tools, not a type system.
Most likely, the Haskell development time includes the time to write 465 lines of documentation, while the Lisp development time includes the time to write 12 lines of documentation. That makes it pretty obvious where the discrepancy in time comes from.
Writing documentation for Haskell programs seems to be needed - especially short Haskell programs written by experts tends to be cryptic.
There was a second Haskell program. 8 hours to write, still far from 3 hours for Lisp.
reverse (PS x s l) = unsafeCreate l $ \p -> withForeignPtr x $ \f -> c_reverse p (f `plusPtr` s) (fromIntegral l)
form http://www.haskell.org/ghc/docs/latest/html/libraries/bytest...
People who write code like this should be banned. Code should be written in a way to be easily read by people, not a compiler. This is not a coincidence that there are 500 lines of documentation. This is how typical Haskell code looks like.
Description is rather clear: "To get a feel for what real world Haskell looks like..."
id :: a -> a
id x = x
you can't really say anything more about what x is, since it could be anything. There are also patterns, such as xs is a list of x, and n is a number. When it's something a lot more specific, names that describe the variable's purpose should and are used. Typically, both the name of the argument and the type signature are looked at to quickly gain knowledge of what the function is probably doing.The lengthy documentation tends to be more descriptive of what the code's purpose is rather than explaining what the arguments to it are.
I do acknowledge that Haskell code isn't usually too pretty to look at. I tend to find it rather readable myself, although that varies from library to library, and application to application. Applications tend to be a bit more readable than libraries, since the library implementation sometimes deals with concepts that are not exposed to the library's user.
It is the only language I know of which makes trivial problems hard and hard problems impossible.
Because of its syntax you have to write 10x as much documentation, as experiment shows and I can confirm this from my own experience. Haskell is full of BS.