At the other end of the scale are functional language
s with a strong type system
. At my programming languages
class in university
, we wrote precisely one significant program in Haskell -- an interpreter for a simple Scheme
-like language (with proper static variable binding
, of course).
I worked out a beautiful design for the program, then wrote the program itself. Trying to compile resulted in several hundred lines of errors. Turns out that Haskell is whitespace sensitive in ways I hadn't realised (á la Python). So I fixed that.
Then it didn't compile for less frivolous reasons. 2 typing errors (the compiler was unable to find types for expressions) corresponded to 2 bugs. I fixed the bugs, and the program compiled; this entailed rewriting some of the code.
It still didn't recompile, but for idiotic reasons. Fixing those resulted in a compilable program. Unimpressed, I ran it.
It worked, first time, except for a silly bug in the connection between symbol names and builtins. I fixed that, tested 2 examples, and submitted.
Almost all errors had been compile time errors, not run time. They were unambiguous (since they didn't depend on the particular input of a run), and very clear. Evidently strong typing, lazy evaluation, and functional programming rulez!