Having worked with undergraduate programming students for a short while now I've found that data types seems to be one issue that gets some students confused. This leads me to wonder whether teaching with dynamically typed languages may be better?

It seems to make sense that relieving students from having to worry about learning what data types are and from the extra opportunities for mistakes arising from having to declare variables and type in data type names should benefit them in learning to program; it's one less thing to consider when they're learning to use control structures and procedural abstraction. But on the other hand, there's potentially a lot more subtle potential for confusion when languages are still strongly typed (as most candidate dynamically typed teaching languages are, Python, Scheme, Smalltalk). Student programmers will still do incorrect things with variables which will cause errors in any strongly typed language. If that language is also dynamically typed, then the consequences of those mistakes are merely commuted from compile-time to run-time. Run-time type errors, I think, are probably more confusing than compile-time type errors. Therefore it makes more sense to me that students should learn about data types early on in learning to program, that a sound grounding in data types is as important (or even more) than one in procedural abstraction and that a language that promotes good understanding of data types by being very explicit about them is probably a better choice than a dynamically typed language.

Now, where's my Haskell text book...

Posted Sun 27 Dec 2009 18:01:00 GMT