News for hackers. Stuff that matters.
Re:TDD: tastes better without the T? by barrkel on Wednesday April 28, 2010 @10:41AM (#1301633)
The biggest problem I have with TDD, or unit testing specifically, is the contortions (interfaces, mocking, delegating construction and configuration, configuration files, library dependencies, etc.) one has to go through to invert dependencies in statically typed languages. If only higher order module systems (think: parameterizing modules by their module dependencies, a bit like generic types are parameterized by type) were more popular, then huge chunks of this work wouldn't be necessary.

Add in preconditions, postconditions, DbC etc. and you can let the language help you out a whole lot more.

Re:TDD: tastes better without the T? by bruceboughton on Wednesday April 28, 2010 @11:23AM (#1301751)
I'd be interested for you to expand on what you mean by "higher order module systems". Do you have any links?
Re:TDD: tastes better without the T? by silentbicycle on Wednesday April 28, 2010 @04:11PM (#1302544)
The ML community usually calls them "functors".

For examples, a package which implements a data structure, say, a red-black tree. The module is parametric over the tree type, so you have module of type "(some record) rbtree". It customizes the module for those, at compile-time.

Or, a module that does a compiler's code generation, which takes another module which provides specification for the processor architecture.

Everything is typechecked, etc. at compile time. There's overlap with both the STL and Haskell's typeclasses, but in ML it's done as part of the module system.

Re:TDD: tastes better without the T? by kunley on Wednesday April 28, 2010 @12:27PM (#1301921)
I guess he meant systems like functors in ML/Ocaml.